Skip to main content

Crate rite_sdk

Crate rite_sdk 

Source
Expand description

Rite SDK: backend abstractions for cryptographic ceremony execution.

rite-sdk is the stable interface layer between the ceremony runtime and backend implementations. It defines the trait hierarchy, data types, and error taxonomy that all backends must implement.

§Implementing a backend

Implement Backend and any combination of capability traits matching your hardware or software capabilities. Use the backend_capabilities! macro to reduce boilerplate for the upcasting methods.

§Trait composition

Backends implement only the traits matching their capabilities:

Backend typeTypical capabilities
SoftwareKeyStore + Sign + KeyTransport
YubiKey PIVKeyStore + Sign + Piv + Yubikey
PKCS#11 HSMKeyStore + Sign + KeyTransport + Pkcs11
TPM 2.0KeyStore + Sign + Tpm
Mock (testing)All traits

Macros§

backend_capabilities
Implement the as_*_mut upcasting helpers on a backend struct.

Structs§

Attestation
Structured attestation evidence with a discriminant kind.
BackendConfig
Backend configuration entry from a ceremony file.
CertificateDer
An X.509 certificate in DER form.
DeviceInfo
Device information for platform attestation.
KeyId
Opaque key identifier (backend-specific).
KeyMetadata
Metadata returned after key generation or import.
KeyPolicy
Security and usage policy for a generated or imported key.
KeySecurityAttributes
PKCS#11 key security attributes read from an HSM after key generation.
KeySpec
Full specification for key generation or import.
KeyUsages
Key usage flags. Maps to PKCS#11 CKA_SIGN, CKA_VERIFY, etc.
ParseError
Error returned when parsing an SDK algorithm identifier from a string fails.
PcrValue
PCR (Platform Configuration Register) value.
PivDeviceInfo
Device identity information for a PIV-compatible smart card.
PivSlotInfo
Metadata about a populated PIV slot.
Pkcs11Mechanism
Opaque PKCS#11 mechanism identifier.
Pkcs11TokenFlags
PKCS#11 token capability flags. Maps to the CKF_* constants in the PKCS#11 standard.
Pkcs11TokenInfo
PKCS#11 token information.
PublicKeyDer
A public key in SubjectPublicKeyInfo (SPKI) DER form.
TpmInfo
TPM (Trusted Platform Module) information.
WrappedKey
A wrapped (encrypted) key with its algorithm and metadata.
YubikeySlotMetadata
YubiKey-specific slot metadata (vendor extension, not NIST PIV).

Enums§

AttestationKind
The kind of attestation evidence a backend can produce.
BackendError
Backend-specific errors.
CertRef
Unified certificate addressing across backend types.
KeyAlgorithm
Key algorithm.
PivKeyOrigin
Origin of a key in a PIV slot.
PivPinPolicy
PIN access policy for PIV private key operations.
PivSlot
PIV key slot identifiers.
PivTouchPolicy
Physical touch policy for private key operations.
Retriability
Whether an error may be re-executed by retrying the step.
SignAlgorithm
Signature algorithm.
WrapAlgorithm
Wrapping algorithm. Determines both the cryptographic method and the output format.
WrappedKeyFormat
Output format family, derived from WrapAlgorithm.

Traits§

AttestationBackend
Hardware attestation operations.
Backend
Core trait that all backends must implement.
CertStoreBackend
Certificate storage operations.
KeyStoreBackend
Key generation and storage operations.
KeyTransportBackend
Key transport (wrapping) operations.
PivBackend
Personal Identity Verification (PIV) smart card operations.
Pkcs11AdminBackend
PKCS#11 Security Officer (SO) role operations.
Pkcs11Backend
PKCS#11 token operations.
RandomBackend
Hardware or software random number generation.
SignBackend
Signing operations.
TpmBackend
TPM 2.0 operations.
VerifyBackend
Signature verification operations.
YubikeyBackend
YubiKey-specific extensions to the PIV interface.