Expand description
ECDSA signing-key minting (FIPS 186-5).
Security:
- ECDSA signing handles a per-signature secret nonce whose timing
leakage is key-recovering. Providers in attacker-observable timing
domains do not export this interface, and compositions requiring it
then fail at composition time (see
README.md, “Timing-channel policy”). Host-backed providers serve it.
Signing keys import as PKCS#8 or an EC private JWK — the platform
pass-through formats — and never as bare scalars (no platform door;
see README.md, “Design notes”, the format-admission rule). Imports
return only the signing key: the public half is never derived from a
private import (the w3c/webcrypto#356 gap), so importers needing it
supply it separately via ecdsa-verify.
Note the signature is not deterministic across implementations: RFC 6979 (deterministic) and randomized-k implementations both verify, but produce different bytes for the same input.
Functions§
- generate_
key - Generate a fresh random signing key of the declared variant, returning both halves — the only point at which every provider is guaranteed to have the public key on hand.
- import_
signing_ key_ jwk - Import a signing key as an EC private JWK (
kty: "EC", withcrv,d, and the mandatory public coordinatesx/y, which implementations MAY validate againstdand MUST NOT trust).crvandalgare validated as inimport-verifying-key-jwk. Seemac-key.export-key-jwkfor the package-wide JWK contract. - import_
signing_ key_ pkcs8 - Import a signing key as a PKCS#8 PrivateKeyInfo (DER, the SEC1
private-key body). The encoded curve must match the declared
variant’s (
error.invalid-key); an embedded public key, when present, is validated against the scalar and never trusted on its own. Returns only the signing key (see the interface doc). - unwrap_
signing_ key_ jwk - Mint a signing key from unwrapped key material read as an EC
private JWK, subject to
import-signing-key-jwk’s contract plus the unwrap-pathuse/key_opschecks (seeREADME.md, “JWK contract”).inputis consumed; seeunwrap-signing-key-pkcs8for the options model. - unwrap_
signing_ key_ pkcs8 - Mint a signing key from unwrapped key material (see the
wrappinginterface):input’s bytes are read as a PKCS#8 PrivateKeyInfo, subject toimport-signing-key-pkcs8’s contract.inputis consumed.