Skip to main content

Crate affinidi_crypto

Crate affinidi_crypto 

Source
Expand description

Cryptographic primitives and JWK types for Affinidi TDK

This crate provides:

  • JWK (JSON Web Key) types per RFC 7517
  • Key generation for various curves (Ed25519, X25519, P-256, P-384, secp256k1)
  • Key conversion utilities (e.g., Ed25519 → X25519)
  • did:key encode/decode helpers for raw-bytes APIs (HPKE, ECDH) — see did_key
  • Post-quantum signatures (FIPS 204 ML-DSA, FIPS 205 SLH-DSA) behind the post-quantum feature (off by default; also available individually as ml-dsa / slh-dsa)

Re-exports§

pub use ed25519::KeyPair as Ed25519KeyPair;
pub use p256::KeyPair as P256KeyPair;
pub use p384::KeyPair as P384KeyPair;
pub use secp256k1::KeyPair as Secp256k1KeyPair;

Modules§

bls12381
BLS12-381 G2 did:key framing (BBS+ issuer keys). Curve-free, so it needs no feature gate. did:key framing for BLS12-381 G2 public keys (BBS+ issuer verification keys).
did_key
did:key helpers for Ed25519 / X25519 with raw-bytes ergonomics.
ed25519
Ed25519 and X25519 key operations
p256
P-256 (secp256r1/prime256v1) key operations
p384
P-384 (secp384r1) key operations
p521
P-521 (secp521r1) key operations
secp256k1
secp256k1 key operations

Structs§

ECParams
Elliptic Curve parameters (P-256, P-384, secp256k1)
JWK
RFC 7517 JWK Struct
OctectParams
Octet Key Pair parameters (Ed25519, X25519)

Enums§

CryptoError
KeyType
Known cryptographic key types.
Params
JWK Key Types and associated Parameters