function encrypt
source · line 36public
public fun encrypt(algorithm: AeadAlgorithm, key: SecretKey, nonce: List<Byte>, plaintext: List<Byte>, aad: List<Byte> = Array<Byte>(0L) { _ -> 0.toByte() }): AeadCiphertext
Encrypts and authenticates plaintext and associated data with AES-GCM. The caller must use a fresh nonce for each encryption under the same key. Key size and 12-byte nonce length are checked.
parameter key
source · line 36public
key: SecretKey
parameter plaintext
source · line 36public
plaintext: List<Byte>
parameter algorithm
source · line 36public
algorithm: AeadAlgorithm
parameter aad
source · line 36public
aad: List<Byte> = Array<Byte>(0L) { _ -> 0.toByte() }
parameter nonce
source · line 36public
nonce: List<Byte>