signDetached function

Uint8List signDetached({
  1. required Object? msgToAuth,
  2. required SecretKey signer,
  3. required Uint8List domain,
})

Creates a COSE_Sign1 digital signature without an embedded payload (i.e. payload is empty).

Uses the current system time as the signature timestamp.

  • msgToAuth: The message to sign (not embedded in COSE_Sign1)
  • signer: The xDSA secret key to sign with
  • domain: Application domain for replay protection

Returns the serialized COSE_Sign1 structure.

Implementation

Uint8List signDetached({
  required Object? msgToAuth,
  required xdsa.SecretKey signer,
  required Uint8List domain,
}) => ffi.coseSignDetached(
  msgToAuth: _encode(msgToAuth),
  signer: signer.inner,
  domain: domain,
);