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
Exception
public boolean isEnabled()
public String encrypt(Object valueToHide) throws GeneralSecurityException
GeneralSecurityException
public String decrypt(String ciphertext) throws GeneralSecurityException
GeneralSecurityException
public byte[] encryptBytes(byte[] valueToHide) throws GeneralSecurityException
GeneralSecurityException
public byte[] decryptBytes(byte[] ciphertext) throws GeneralSecurityException
GeneralSecurityException
public static String generateEncodedKey() throws Exception
Exception
public void setSecretKey(String secretKey) throws Exception
secretKey
- The secretKey to set.Exception
public String hash(Object valueToHide) throws GeneralSecurityException
GeneralSecurityException
protected void checkEnabled()
public SecretKey getDesKeyOld()
public void setDesKeyOld(SecretKey desKeyOld)
desKeyOld
- the desKeyOld to setCopyright © 2005–2015 The Kuali Foundation. All rights reserved.