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

java.lang.Object
  extended by com.elasticpath.commons.util.security.impl.StringEncrypterImpl
      extended by com.elasticpath.commons.util.security.impl.CreditCardEncrypterImpl
All Implemented Interfaces:
CreditCardEncrypter, StringEncrypter

public class CreditCardEncrypterImpl
extends StringEncrypterImpl
implements CreditCardEncrypter

General encryption/decryption class. Uses an encryption key and scheme configured in commerce-config.xml.


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
CreditCardEncrypterImpl()
           
 
Method Summary
 java.lang.String decryptAndMask(java.lang.String encryptedCcNumber)
          Decrypts and hides the first 12 digits of the credit card number.
 
Methods inherited from class com.elasticpath.commons.util.security.impl.StringEncrypterImpl
decrypt, encrypt
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.commons.util.security.StringEncrypter
decrypt, encrypt
 

Constructor Detail

CreditCardEncrypterImpl

public CreditCardEncrypterImpl()
Method Detail

decryptAndMask

public java.lang.String decryptAndMask(java.lang.String encryptedCcNumber)
Decrypts and hides the first 12 digits of the credit card number.

Specified by:
decryptAndMask in interface CreditCardEncrypter
Parameters:
encryptedCcNumber - - the credit card number to decrypt.
Returns:
- the decrypted and masked credit card number: ************5381