com.elasticpath.commons.util.security
Interface StringEncrypter

All Known Subinterfaces:
CreditCardEncrypter
All Known Implementing Classes:
CreditCardEncrypterImpl, StringEncrypterImpl

public interface StringEncrypter

Interface for encrypting and decrypting strings.


Field Summary
static java.lang.String ENCRYPTION_KEY
          Encyption key handle to value in commerce-config.xml.
static java.lang.String ERROR_ENCRYPTION_KEY_IS_NULL
          Error message thrown for null key.
static java.lang.String ERROR_ENCRYPTION_KEY_TOO_SHORT
          Error message thrown when encryption key is too short.
static int MINIMUM_KEY_LENGTH
          The minimum length of the encryption key.
 
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.
 

Field Detail

ENCRYPTION_KEY

static final java.lang.String ENCRYPTION_KEY
Encyption key handle to value in commerce-config.xml.

See Also:
Constant Field Values

ERROR_ENCRYPTION_KEY_IS_NULL

static final java.lang.String ERROR_ENCRYPTION_KEY_IS_NULL
Error message thrown for null key.

See Also:
Constant Field Values

ERROR_ENCRYPTION_KEY_TOO_SHORT

static final java.lang.String ERROR_ENCRYPTION_KEY_TOO_SHORT
Error message thrown when encryption key is too short.

See Also:
Constant Field Values

MINIMUM_KEY_LENGTH

static final int MINIMUM_KEY_LENGTH
The minimum length of the encryption key.

See Also:
Constant Field Values
Method Detail

decrypt

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

Parameters:
encryptedString - - the string to decrypt
Returns:
the decrypted string

encrypt

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

Parameters:
unencryptedString - - the string to encrypt
Returns:
the encrypted string