Class SimpleGCMByteEncryptor
java.lang.Object
com.ulisesbocchio.jasyptspringboot.encryptor.SimpleGCMByteEncryptor
- All Implemented Interfaces:
org.jasypt.encryption.ByteEncryptor
SimpleGCMByteEncryptor class.
- Version:
- $Id: $Id
- Author:
- Sergio.U.Bocchio
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstantAES_KEY_PASSWORD_SALT_LENGTH=16static final intConstantAES_KEY_SIZE=256static final intConstantGCM_IV_LENGTH=12static final intConstantGCM_TAG_LENGTH=128 -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for SimpleGCMByteEncryptor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] encryptedMessage) byte[]encrypt(byte[] message) static StringgenerateBase64EncodedSecretKey.static SecretKeygenerateSecretKey.static SecretKeygetAESKeyFromPassword(char[] password, org.jasypt.salt.SaltGenerator saltGenerator, int iterations, String algorithm) getAESKeyFromPassword.
-
Field Details
-
AES_KEY_SIZE
public static final int AES_KEY_SIZEConstantAES_KEY_SIZE=256- See Also:
-
AES_KEY_PASSWORD_SALT_LENGTH
public static final int AES_KEY_PASSWORD_SALT_LENGTHConstantAES_KEY_PASSWORD_SALT_LENGTH=16- See Also:
-
GCM_IV_LENGTH
public static final int GCM_IV_LENGTHConstantGCM_IV_LENGTH=12- See Also:
-
GCM_TAG_LENGTH
public static final int GCM_TAG_LENGTHConstantGCM_TAG_LENGTH=128- See Also:
-
-
Constructor Details
-
SimpleGCMByteEncryptor
Constructor for SimpleGCMByteEncryptor.
- Parameters:
config- aSimpleGCMConfigobject
-
-
Method Details
-
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
generateSecretKey.
- Returns:
- a
SecretKeyobject
-
generateBase64EncodedSecretKey
generateBase64EncodedSecretKey.
- Returns:
- a
Stringobject
-
getAESKeyFromPassword
public static SecretKey getAESKeyFromPassword(char[] password, org.jasypt.salt.SaltGenerator saltGenerator, int iterations, String algorithm) getAESKeyFromPassword.
-