senderWrapKey method
Wraps a key for the sender using the derived key.
Returns an EncryptedBuffer containing the wrapped key.
Implementation
EncryptedBuffer senderWrapKey({
required KeyAlgorithm keyWrappingAlgorithm,
required Key ephemeralKey,
required Key recipientKey,
required Key senderKey,
required Key cek,
required Uint8List ccTag,
}) {
final derived = deriveKey(
encryptionAlgorithm: keyWrappingAlgorithm,
ephemeralKey: ephemeralKey,
recipientKey: recipientKey,
senderKey: senderKey,
receive: false,
ccTag: ccTag,
);
final encryptedBuffer = derived.wrapKey(other: cek);
derived.handle.free();
return encryptedBuffer;
}