decrypt function
Decrypts a sealed message without verifying the signature.
This allows inspecting the signer before verification. Use signer to extract the signer's fingerprint, then verify to verify.
msgToOpen: The serialized COSE_Encrypt0 structuremsgToAuth: The same additional authenticated data used during sealingrecipient: The xHPKE secret key to decrypt withdomain: Application domain for HPKE key derivation
Returns the decrypted COSE_Sign1 structure (not yet verified). Throws if
the envelope is malformed, was encrypted to another key, or does not
decrypt under recipient, msgToAuth and domain. Strips trailing zeros
after the signed envelope and throws if any padding byte is nonzero.
Implementation
Uint8List decrypt({
required Uint8List msgToOpen,
required Object? msgToAuth,
required xhpke.SecretKey recipient,
required Uint8List domain,
}) => ffi.coseDecrypt(
msgToOpen: msgToOpen,
msgToAuth: _encode(msgToAuth),
recipient: recipient.inner,
domain: domain,
);