public class SalesforceKeyGenerator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
LEGACY_KEYPAIR_ALIAS |
protected static java.lang.String |
MSDK_KEYPAIR_ALIAS |
| Constructor and Description |
|---|
SalesforceKeyGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearAll()
Clears all stored identifiers from shared preferences.
|
static java.lang.String |
getEncryptionKey(java.lang.String name)
Returns the encryption key being used.
|
static java.lang.String |
getRandom128ByteKey()
Returns a randomly generated 128-byte key that's URL safe.
|
static java.lang.String |
getSHA256Hash(java.lang.String privateKey)
Returns the SHA-256 hashed value of the supplied private key.
|
static java.lang.String |
getUniqueId(java.lang.String name)
Returns the unique ID being used.
|
static java.lang.String |
getUniqueId(java.lang.String name,
int length)
Returns the unique ID being used based on the key length.
|
protected static java.lang.String |
readFromSharedPrefs(java.lang.String key) |
protected static void |
storeInSharedPrefs(java.lang.String key,
java.lang.String value) |
protected static final java.lang.String LEGACY_KEYPAIR_ALIAS
protected static final java.lang.String MSDK_KEYPAIR_ALIAS
public static java.lang.String getUniqueId(java.lang.String name)
name - Unique name associated with this unique ID.public static java.lang.String getUniqueId(java.lang.String name,
int length)
name - Unique name associated with this unique ID.length - Key length.public static java.lang.String getEncryptionKey(java.lang.String name)
name - Unique name associated with this encryption key.public static java.lang.String getRandom128ByteKey()
public static java.lang.String getSHA256Hash(java.lang.String privateKey)
privateKey - Private key.protected static java.lang.String readFromSharedPrefs(java.lang.String key)
protected static void storeInSharedPrefs(java.lang.String key,
java.lang.String value)
public static void clearAll()