Skip to main content

Module ed25519

Module ed25519 

Source
Expand description

ed25519-verify / ed25519-sign key creation.

Functions§

generate_key
Generate a fresh random signing key, returning both halves.
import_signing_key_jwk
Import a signing key as an RFC 8037 OKP private JWK (kty: "OKP", crv: "Ed25519", with x and d both required; as JSON text). An alg member, when present, must be "Ed25519" or "EdDSA".
import_signing_key_pkcs8
Import a signing key as a PKCS#8 PrivateKeyInfo (DER, RFC 8410: the 32-byte seed in a CurvePrivateKey). Returns only the signing key; the public half is imported separately (there is no derive from a private import — see the WIT ed25519-sign interface doc).
import_verifying_key_jwk
Import a public key as an RFC 8037 OKP public JWK (kty: "OKP", crv: "Ed25519", x; as JSON text). An alg member, when present, must be "Ed25519" or "EdDSA". The same strict point criterion as import_verifying_key_raw applies; see the WIT mac-key.export-key-jwk doc for the package-wide JWK contract.
import_verifying_key_raw
Import a 32-byte raw public key (RFC 8032 encoding). Material of any other length fails Error::InvalidKey; a non-canonical or small-order encoding is rejected here or at verification, per the WIT interface’s verification criterion.
import_verifying_key_spki
Import a public key as an X.509 SubjectPublicKeyInfo (DER, RFC 8410). The embedded point is subject to the same strict criterion as import_verifying_key_raw.
unwrap_signing_key_jwk
Mint a signing key from unwrapped key material read as an OKP private JWK, subject to import_signing_key_jwk’s contract plus the unwrap-path use/key_ops checks (see the WIT README.md, “JWK contract”). Consumes the UnwrapInput; see unwrap_signing_key_pkcs8 for 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 the UnwrapInput; the minted key’s usages and extractability come from options alone.