aeadDecrypt method

Uint8List aeadDecrypt({
  1. required Uint8List ciphertext,
  2. required Uint8List nonce,
  3. Uint8List? tag,
  4. Uint8List? aad,
})

Decrypts a message using AEAD.

Throws an AskarKeyException if decryption fails.

Implementation

Uint8List aeadDecrypt({
  required Uint8List ciphertext,
  required Uint8List nonce,
  Uint8List? tag,
  Uint8List? aad,
}) {
  try {
    return askarKeyAeadDecrypt(
      localKeyHandle,
      ciphertext,
      nonce,
      tag: tag,
      aad: aad,
    ).getValueOrException();
  } catch (e) {
    throw AskarKeyException('Error on AEAD Decryption: $e');
  }
}