|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.force.sdk.oauth.context.store.AESUtil
public final class AESUtil
Utility for handling encryption logic with AES.
Method Summary | |
---|---|
static byte[] |
decrypt(byte[] value,
SecretKeySpec skeySpec)
Decrypt the value using the passed in key. |
static byte[] |
encrypt(byte[] value,
SecretKeySpec skeySpec)
Encrypt the value using the passed in key. |
static SecretKeySpec |
generateRandomKey()
Generate a random secret key. |
static SecretKeySpec |
getSecretKey()
call getSecretKey(String fileName) with the default filename. |
static SecretKeySpec |
getSecretKey(String fileName)
Read in a stored secret key from a properties file and create a SecretKeySpec object from it. |
static SecretKeySpec |
recreateSecretKeySpec(String key)
Create a SecretKeySpec object from an AES key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static byte[] encrypt(byte[] value, SecretKeySpec skeySpec) throws ForceEncryptionException
value
- data to encryptskeySpec
- encryption key
ForceEncryptionException
- ForceEncryptionException
public static byte[] decrypt(byte[] value, SecretKeySpec skeySpec) throws ForceEncryptionException
value
- data to decryptskeySpec
- The encryption key
ForceEncryptionException
- ForceEncryptionException
public static SecretKeySpec recreateSecretKeySpec(String key) throws ForceEncryptionException
key
- String
ForceEncryptionException
- ForceEncryptionException
public static SecretKeySpec getSecretKey() throws ForceEncryptionException
ForceEncryptionException
- ForceEncryptionException
public static SecretKeySpec getSecretKey(String fileName) throws ForceEncryptionException
fileName
- String
ForceEncryptionException
- ForceEncryptionException
public static SecretKeySpec generateRandomKey() throws ForceEncryptionException
ForceEncryptionException
- ForceEncryptionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |