@Test public void testCardDataEncrypt() throws Exception { String data = "4012888888881881"; String encryptedData = encryptor.protectFormattedData(data, null); assertFalse(encryptedData.equals(data)); assertThat(AES.unPackString(AES.decrypt(AES.decode(encryptedData), testKey.getBytes())), is(data)); }
@Override public String protectFormattedData(String dataIn, String format) throws EncryptionException { return protectGenericData(dataIn); }
AESEncryptor implements Encryptor { @Override public String protectFormattedData(String dataIn, String format) throws EncryptionException { return protectGenericData(dataIn); } }
AESEncryptor implements Encryptor { @Override public String protectFormattedData(String dataIn, String format) throws EncryptionException { return protectGenericData(dataIn); } AESEncryptor(byte[] encryptionKey); }
AESEncryptor implements Encryptor { @Override public String protectFormattedData(String dataIn, String format) throws EncryptionException { return protectGenericData(dataIn); } AESEncryptor(byte[] encryptionKey); @Override String protectSocialSecurityNumber(String socialSecurityNumber); @Override String protectFormattedData(String dataIn, String format); @Override String protectGenericData(String dataIn); }
AESEncryptor implements Encryptor { @Override public String protectFormattedData(String dataIn, String format) throws EncryptionException { return protectGenericData(dataIn); } AESEncryptor(byte[] encryptionKey); @Override String protectSocialSecurityNumber(String socialSecurityNumber); @Override String protectFormattedData(String dataIn, String format); @Override String protectGenericData(String dataIn);  }