com.elasticpath.commons.util.security.impl
Class StringEncrypterImpl

java.lang.Object
  extended by com.elasticpath.commons.util.security.impl.StringEncrypterImpl
All Implemented Interfaces:
StringEncrypter
Direct Known Subclasses:
CreditCardEncrypterImpl

public class StringEncrypterImpl
extends java.lang.Object
implements StringEncrypter

General encryption/decryption class. Uses an encryption key and scheme configured in commerce-config.xml. See: http://www.msblabs.org/aes-crypt/AES.java for additional details.


Field Summary
 
Fields inherited from interface com.elasticpath.commons.util.security.StringEncrypter
ENCRYPTION_KEY, ERROR_ENCRYPTION_KEY_IS_NULL, ERROR_ENCRYPTION_KEY_TOO_SHORT, MINIMUM_KEY_LENGTH
 
Constructor Summary
StringEncrypterImpl()
           
 
Method Summary
 java.lang.String decrypt(java.lang.String encryptedString)
          Decrypts a give string.
 java.lang.String encrypt(java.lang.String unencryptedString)
          Encrypts a given string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringEncrypterImpl

public StringEncrypterImpl()
Method Detail

decrypt

public java.lang.String decrypt(java.lang.String encryptedString)
Decrypts a give string.

Specified by:
decrypt in interface StringEncrypter
Parameters:
encryptedString - - the string to decrypt
Returns:
the decrypted string

encrypt

public java.lang.String encrypt(java.lang.String unencryptedString)
Encrypts a given string.

Specified by:
encrypt in interface StringEncrypter
Parameters:
unencryptedString - - the string to encrypt
Returns:
the encrypted string