SoftwareEs256Signer class

An in-memory Es256Signer for tests and examples — a real P-256 key that produces real, verifiable ES256 signatures, with no hardware involved.

Signatures are deterministic (RFC 6979) and normalised to low-S, so the same input always yields the same output and third-party verifiers that reject high-S signatures still accept them.

Implemented types

Constructors

SoftwareEs256Signer.generate({Random? random, KeyAttestation? attestor(String nonce)?})
Generates a fresh key. Pass a seeded random for reproducible keys, and attestor to exercise the optional attest path.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

attest(String nonce) Future<KeyAttestation?>
Optional key attestation bound to nonce. Returns null when the implementation cannot attest, in which case the library simply omits it.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publicJwk() Future<Map<String, dynamic>>
Public JWK of the holder key (kty:EC, crv:P-256, x, y). Goes into the credential's cnf claim and into proof / KB-JWT headers.
override
publicJwkSync() Map<String, dynamic>
Synchronous accessor for the public JWK — handy when acting as a test issuer (e.g. serving a jwt-vc-issuer JWK set).
signBytes(List<int> message) Uint8List
Signs raw message bytes with ES256 (low-S), returning the 64-byte R‖S. Useful when acting as a test issuer signing non-JOSE bytes — e.g. an X.509 TBSCertificate when building a chain fixture. signEs256 is the JOSE-string variant most callers want.
signEs256(String signingInput) Future<String>
Signs a JOSE signing input (base64url(header).base64url(payload)) and returns the signature as raw R‖S (64 bytes), base64url — the ES256 wire format. A hardware implementation triggers the biometric/PIN gate here when the key is auth-required.
override
toString() String
A string representation of this object.
inherited

Operators

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