public class EncryptionService extends Object
| Modifier and Type | Field and Description | 
|---|---|
| static String | ALGORITHM | 
| static String | HASH_ALGORITHM | 
| Constructor and Description | 
|---|
| EncryptionService(String key) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | checkEnabled()Performs a check to see if the encryption service is enabled. | 
| String | decrypt(String ciphertext) | 
| byte[] | decryptBytes(byte[] ciphertext) | 
| String | encrypt(Object valueToHide) | 
| byte[] | encryptBytes(byte[] valueToHide) | 
| static String | generateEncodedKey()This method generates keys. | 
| SecretKey | getDesKey() | 
| SecretKey | getDesKeyOld() | 
| String | hash(Object valueToHide)Hash the value by converting to a string, running the hash algorithm, and then base64'ng the results. | 
| boolean | isEnabled() | 
| void | setDesKeyOld(SecretKey desKeyOld) | 
| void | setSecretKey(String secretKey)Sets the secretKey attribute value. | 
public static final String ALGORITHM
public static final String HASH_ALGORITHM
public EncryptionService(String key) throws Exception
Exceptionpublic boolean isEnabled()
public String encrypt(Object valueToHide) throws GeneralSecurityException
GeneralSecurityExceptionpublic String decrypt(String ciphertext) throws GeneralSecurityException
GeneralSecurityExceptionpublic byte[] encryptBytes(byte[] valueToHide) throws GeneralSecurityException
GeneralSecurityExceptionpublic byte[] decryptBytes(byte[] ciphertext) throws GeneralSecurityException
GeneralSecurityExceptionpublic static String generateEncodedKey() throws Exception
Exceptionpublic void setSecretKey(String secretKey) throws Exception
secretKey - The secretKey to set.Exceptionpublic String hash(Object valueToHide) throws GeneralSecurityException
GeneralSecurityExceptionprotected void checkEnabled()
public SecretKey getDesKeyOld()
public void setDesKeyOld(SecretKey desKeyOld)
desKeyOld - the desKeyOld to setCopyright © 2005–2014 The Kuali Foundation. All rights reserved.