verify<T> function
T
verify<T>({})
Validates a COSE_Sign1 digital signature and returns the embedded payload.
Uses the current system time for drift checking.
msgToCheck: The serialized COSE_Sign1 structuremsgToAuth: The same additional authenticated data used during signingverifier: The xDSA public key to verify againstdomain: Application domain for replay protectionmaxDriftSecs: Signatures more in the past or future are rejected
Returns the CBOR-decoded embedded payload if verification succeeds.
Implementation
T verify<T>({
required Uint8List msgToCheck,
required Object? msgToAuth,
required xdsa.PublicKey verifier,
required Uint8List domain,
int? maxDriftSecs,
}) =>
_decode(
ffi.coseVerify(
msgToCheck: msgToCheck,
msgToAuth: _encode(msgToAuth),
verifier: verifier.inner,
domain: domain,
maxDriftSecs: maxDriftSecs != null
? BigInt.from(maxDriftSecs)
: null,
),
)
as T;