HmacSigner class final

Signs a COSE_Mac0 with a shared secret of at least 32 random bytes.

The secret lives in this process's memory: for service credentials and tests, never for an end user's device. The object keeps its copy (secret) for as long as it is reachable, and Dart cannot wipe memory, so drop the signer once the ClientEnvelope is built. The Rust side wipes its own copy when the envelope is dropped. secret is public only because the backends, in other libraries, read it.

Throws ArgumentError if alg is not an HMAC algorithm.

Inheritance

Constructors

HmacSigner(CoseAlg alg, Uint8List secret)
alg must be CoseAlg.hmac256x64 or CoseAlg.hmac256x256.

Properties

alg → CoseAlg
The HMAC algorithm.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secret → Uint8List
The shared secret (a copy).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited