wrapKey method

EncryptedBuffer wrapKey({
  1. required Key other,
  2. Uint8List? nonce,
})

Wraps a key.

Throws an AskarKeyException if wrapping fails.

Implementation

EncryptedBuffer wrapKey({required Key other, Uint8List? nonce}) {
  try {
    return askarKeyWrapKey(
      localKeyHandle,
      other.handle,
      nonce: nonce,
    ).getValueOrException();
  } catch (e) {
    throw AskarKeyException('Failed to wrap key: $e');
  }
}