Expand description
ecdsa-verify / ecdsa-sign key creation.
Enums§
- Ecdsa
Variant - The served curve/digest pairings. Every variant still binds its hash at mint — a key can never be used with a digest its minter did not choose — but the cross pairings of the served curves and SHA-2 digests are representable, as WebCrypto’s per-operation hash makes them on the platform.
Functions§
- generate_
key - Generate a fresh random signing key of the declared variant, returning both halves.
- import_
signing_ key_ jwk - Import a signing key as an EC private JWK (
kty: "EC", withcrv,d, and the mandatory public coordinatesx/y; as JSON text).crvandalgare validated as inimport_verifying_key_jwk. - 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::InvalidKey); an embedded public key, when present, is validated against the scalar and never trusted on its own. Returns only the signing key; the public half is imported separately (there is no derive from a private import — see the WITecdsa-signinterface doc). - import_
verifying_ key_ jwk - Import a public key as an EC public JWK (
kty: "EC", withcrv,x, andy; as JSON text). The JWK’scrvmust match the declared variant’s curve, and analgmember, when present, must be the curve’s JOSE signature alg ("ES256"for P-256,"ES384"for P-384). See the WITmac-key.export-key-jwkdoc for the package-wide JWK contract. - import_
verifying_ key_ raw - Import a public key as an uncompressed SEC1 point.
- import_
verifying_ key_ spki - Import a public key as an X.509 SubjectPublicKeyInfo (DER). The curve
must be named by OID and match the declared variant’s, or the import
fails
Error::InvalidKey; whether a compressed point encoding is accepted is implementation-defined — do not rely on either behavior (see the WITimport-verifying-key-spkidoc). - 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 (see the WITREADME.md, “JWK contract”). Consumes theUnwrapInput; seeunwrap_signing_key_pkcs8for the options model. - unwrap_
signing_ key_ pkcs8 - Mint a signing key from unwrapped key material read as a PKCS#8
PrivateKeyInfo, subject to
import_signing_key_pkcs8’s contract. Consumes theUnwrapInput; the minted key’s usages and extractability come fromoptionsalone.