sign function
Creates a COSE_Sign1 digital signature with an embedded payload.
Uses the current system time as the signature timestamp.
msgToEmbed: The message to sign (embedded in COSE_Sign1)msgToAuth: Additional authenticated data (not embedded, but signed)signer: The xDSA secret key to sign withdomain: Application domain for replay protection
Returns the serialized COSE_Sign1 structure.
Implementation
Uint8List sign({
required Object? msgToEmbed,
required Object? msgToAuth,
required xdsa.SecretKey signer,
required Uint8List domain,
}) => ffi.coseSign(
msgToEmbed: _encode(msgToEmbed),
msgToAuth: _encode(msgToAuth),
signer: signer.inner,
domain: domain,
);