seal function
Signs a message then encrypts it to a recipient.
Uses the current system time as the signature timestamp.
msgToSeal: The message to sign and encryptmsgToAuth: Additional authenticated data (signed and bound to encryption, but not embedded)signer: The xDSA secret key to sign withrecipient: The xHPKE public key to encrypt todomain: Application domain for HPKE key derivation
Returns the serialized COSE_Encrypt0 structure containing the encrypted COSE_Sign1.
Implementation
Uint8List seal({
required Object? msgToSeal,
required Object? msgToAuth,
required xdsa.SecretKey signer,
required xhpke.PublicKey recipient,
required Uint8List domain,
}) => ffi.coseSeal(
msgToSeal: _encode(msgToSeal),
msgToAuth: _encode(msgToAuth),
signer: signer.inner,
recipient: recipient.inner,
domain: domain,
);