Package net.sf.jstuff.core.security
Class AESEncryptor
java.lang.Object
net.sf.jstuff.core.security.AESEncryptor
- Author:
- Sebastian Thomschke
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
<T extends Serializable>
Tdeserialize
(byte[] data, String passphrase) byte[]
seal
(Serializable object, String passphrase) byte[]
serialize
(Serializable object, String passphrase) <T extends Serializable>
Tunseal
(AESEncryptor.AESSealedObject object, String passphrase)
-
Constructor Details
-
AESEncryptor
public AESEncryptor(byte[] keySalt) -
AESEncryptor
-
-
Method Details
-
decrypt
- Parameters:
data
- first 16 bytes of the array expected to be the initial vector- Throws:
SecurityException
-
deserialize
-
encrypt
- Returns:
- first 16 bytes of the array are the initial vector
- Throws:
SecurityException
-
seal
public AESEncryptor.AESSealedObject seal(Serializable object, String passphrase) throws SecurityException - Throws:
SecurityException
-
serialize
-
unseal
public <T extends Serializable> T unseal(AESEncryptor.AESSealedObject object, String passphrase) throws SecurityException - Throws:
SecurityException
-