Class AESEncryptionBackend

java.lang.Object
com.atlassian.secrets.service.aes.AESEncryptionBackend
All Implemented Interfaces:
SecretServiceBackend

public class AESEncryptionBackend extends Object implements SecretServiceBackend
This class, AESInPlaceEncryptionService, implements the SecretService interface and provides methods for sealing (encrypting) and unsealing (decrypting) secrets using the AES/GCM/NoPadding algorithm.
It uses a SecretKey for encryption and decryption, and a Cipher for the actual encrypting and decrypting operations. The class also uses a AESEncryptionBackend.GeneratedIv functional interface to generate an initialization vector (IV) for the AES algorithm.
The seal method takes an identifier and a plaintext string, encrypts the plaintext using the AES algorithm and a generated IV, and returns the encrypted text as a Base64-encoded string.
The unseal method takes a secured value (an encrypted, Base64-encoded string), decodes the IV and the string from base64 encoding, decrypts it using the AES algorithm and the IV that was used for encryption, and returns the original plaintext string.
The class also provides a static method for generating a default key, which can be used for testing purposes.
Since:
5.0.0
See Also: