Package org.symbol.sdk
Class CipherTypes.AesGcmCipher
java.lang.Object
org.symbol.sdk.CipherTypes.AesGcmCipher
- All Implemented Interfaces:
CipherTypes.SymmetricCipher
- Enclosing class:
CipherTypes
public static final class CipherTypes.AesGcmCipher
extends Object
implements CipherTypes.SymmetricCipher
- AesGcmCipher
- Performs AES GCM encryption and decryption with a given key.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAesGcmCipher(CryptoTypes.SharedKey256 aesKey) Creates a cipher around an AES shared key. -
Method Summary
-
Field Details
-
TAG_SIZE
public static final int TAG_SIZEByte size of GCM tag.- See Also:
-
-
Constructor Details
-
Method Details
-
encrypt
public byte[] encrypt(byte[] clearText, byte[] iv) - AesGcmCipher.encrypt
- Encrypts clear text and appends the authentication tag to the encrypted payload.
- Specified by:
encryptin interfaceCipherTypes.SymmetricCipher- Parameters:
clearText- Clear text to encrypt.iv- IV bytes.- Returns:
- Cipher text with appended tag.
-
decrypt
public byte[] decrypt(byte[] cipherText, byte[] iv) - AesGcmCipher.decrypt
- Decrypts cipher text with appended tag.
- Specified by:
decryptin interfaceCipherTypes.SymmetricCipher- Parameters:
cipherText- Cipher text with appended tag to decrypt.iv- IV bytes.- Returns:
- Clear text.
-