Package org.jivesoftware.util
Class AesEncryptor
java.lang.Object
org.jivesoftware.util.AesEncryptor
- All Implemented Interfaces:
Encryptor
Utility class providing symmetric AES encryption/decryption. To strengthen
the encrypted result, use the
setKey(byte[])
method to provide a custom
key prior to invoking the encrypt(java.lang.String)
or decrypt(java.lang.String)
methods.- Author:
- Tom Evans
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrypt an encrypted String.Decrypt an encrypted String.Encrypt a clear text String.Encrypt a clear text String.void
Set the encryption key.
-
Constructor Details
-
AesEncryptor
public AesEncryptor()Default constructor -
AesEncryptor
Custom key constructor- Parameters:
key
- the custom key
-
-
Method Details
-
encrypt
Description copied from interface:Encryptor
Encrypt a clear text String. -
encrypt
Description copied from interface:Encryptor
Encrypt a clear text String. -
decrypt
Description copied from interface:Encryptor
Decrypt an encrypted String. -
decrypt
Description copied from interface:Encryptor
Decrypt an encrypted String. -
setKey
Description copied from interface:Encryptor
Set the encryption key. This will apply the user-defined key, truncated or filled (via the default key) as needed to meet the key length specifications.
-