signDetachedAt function

Uint8List signDetachedAt({
  1. required Object? msgToAuth,
  2. required SecretKey signer,
  3. required Uint8List domain,
  4. required int timestamp,
})

Creates a COSE_Sign1 digital signature without an embedded payload, stamped with a timestamp from the caller.

Uses the same external_aad convention as signDetached.

  • msgToAuth: The message to sign (not embedded in COSE_Sign1)
  • signer: The xDSA secret key to sign with
  • domain: Application domain for separating protocol purposes
  • timestamp: Unix timestamp in seconds to embed in the protected header

Returns the serialized COSE_Sign1 structure. Throws if msgToAuth does not encode into the supported CBOR subset.

Implementation

Uint8List signDetachedAt({
  required Object? msgToAuth,
  required xdsa.SecretKey signer,
  required Uint8List domain,
  required int timestamp,
}) => ffi.coseSignDetachedAt(
  msgToAuth: _encode(msgToAuth),
  signer: signer.inner,
  domain: domain,
  timestamp: timestamp,
);