Class SimpleGCMByteEncryptor
- java.lang.Object
-
- com.ulisesbocchio.jasyptspringboot.encryptor.SimpleGCMByteEncryptor
-
- All Implemented Interfaces:
org.jasypt.encryption.ByteEncryptor
public class SimpleGCMByteEncryptor extends Object implements org.jasypt.encryption.ByteEncryptor
SimpleGCMByteEncryptor class.
- Version:
- $Id: $Id
- Author:
- Sergio.U.Bocchio
-
-
Field Summary
Fields Modifier and Type Field Description static intAES_KEY_PASSWORD_SALT_LENGTHConstantAES_KEY_PASSWORD_SALT_LENGTH=16static intAES_KEY_SIZEConstantAES_KEY_SIZE=256static intGCM_IV_LENGTHConstantGCM_IV_LENGTH=12static intGCM_TAG_LENGTHConstantGCM_TAG_LENGTH=128
-
Constructor Summary
Constructors Constructor Description SimpleGCMByteEncryptor(SimpleGCMConfig config)Constructor for SimpleGCMByteEncryptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] encryptedMessage)byte[]encrypt(byte[] message)static StringgenerateBase64EncodedSecretKey()generateBase64EncodedSecretKey.static SecretKeygenerateSecretKey()generateSecretKey.static SecretKeygetAESKeyFromPassword(char[] password, org.jasypt.salt.SaltGenerator saltGenerator, int iterations, String algorithm)getAESKeyFromPassword.
-
-
-
Field Detail
-
AES_KEY_SIZE
public static final int AES_KEY_SIZE
ConstantAES_KEY_SIZE=256- See Also:
- Constant Field Values
-
AES_KEY_PASSWORD_SALT_LENGTH
public static final int AES_KEY_PASSWORD_SALT_LENGTH
ConstantAES_KEY_PASSWORD_SALT_LENGTH=16- See Also:
- Constant Field Values
-
GCM_IV_LENGTH
public static final int GCM_IV_LENGTH
ConstantGCM_IV_LENGTH=12- See Also:
- Constant Field Values
-
GCM_TAG_LENGTH
public static final int GCM_TAG_LENGTH
ConstantGCM_TAG_LENGTH=128- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimpleGCMByteEncryptor
public SimpleGCMByteEncryptor(SimpleGCMConfig config)
Constructor for SimpleGCMByteEncryptor.
- Parameters:
config- aSimpleGCMConfigobject
-
-
Method Detail
-
encrypt
public byte[] encrypt(byte[] message)
- Specified by:
encryptin interfaceorg.jasypt.encryption.ByteEncryptor
-
decrypt
public byte[] decrypt(byte[] encryptedMessage)
- Specified by:
decryptin interfaceorg.jasypt.encryption.ByteEncryptor
-
generateSecretKey
public static SecretKey generateSecretKey()
generateSecretKey.
- Returns:
- a
SecretKeyobject
-
generateBase64EncodedSecretKey
public static String generateBase64EncodedSecretKey()
generateBase64EncodedSecretKey.
- Returns:
- a
Stringobject
-
-