unwrapKey method
- required KeyAlgorithm algorithm,
- Uint8List? tag,
- required Uint8List ciphertext,
- Uint8List? nonce,
Unwraps a key.
Throws an AskarKeyException if unwrapping fails.
Implementation
Key unwrapKey({
required KeyAlgorithm algorithm,
Uint8List? tag,
required Uint8List ciphertext,
Uint8List? nonce,
}) {
try {
return Key(
askarKeyUnwrapKey(
localKeyHandle,
algorithm,
ciphertext,
nonce: nonce,
tag: tag,
).getValueOrException(),
);
} catch (e) {
throw AskarKeyException('Failed to unwrap key: $e');
}
}