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

Modules§

cms
Read a CMS artifact back into a description of the wrap that produced it.
oid
Well-known OIDs the wrapping paths produce or check.

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.
DataKey
A content-encryption key in the two forms envelope encryption needs.
DeviceInfo
Device information for platform attestation.
EncryptedData
Encrypted content.
IncoherentContainer
A container was labelled with a scheme its own description contradicts.
KeyCheckValue
What a symmetric key answers to, in place of a public key.
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.
Oid
An ASN.1 object identifier in dotted-decimal form.
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.
WrapDescription
What a wrap actually did.
WrappedKey
A key wrapped for transport.
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.
KeyProtection
How a data key was protected, in terms a container can record.
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.
RecipientInfoKind
How a CMS structure conveys the content-encryption key to its recipient.
Retriability
Whether an error may be re-executed by retrying the step.
SignAlgorithm
Signature algorithm.
WrapScheme
The wrapping scheme a step requests, or a backend reports.

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.