helpTestEncryptDecrypt(CLEARTEXT + CLEARTEXT + CLEARTEXT);
}
@Test public void testSymmetricEncryptionWithRandomKey() throws Exception {
SymmetricCryptor randomSymCryptor = SymmetricCryptor.getSymmectricCryptor();
ArrayList test = new ArrayList(Arrays.asList(new String[] {ALPHA_L, ALPHA_U, CLEARTEXT, NUMBERS}));
Object result = randomSymCryptor.sealObject(test);
//ensure that we can serialize
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(result);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bais);
result = ois.readObject();
ArrayList clearObject = (ArrayList)randomSymCryptor.unsealObject(result);
assertEquals(test, clearObject);
SymmetricCryptor cryptor1 = SymmetricCryptor.getSymmectricCryptor(randomSymCryptor.getEncodedKey());
clearObject = (ArrayList)cryptor1.unsealObject(result);
assertEquals(test, clearObject);
}