pub enum TrustError {
Show 17 variants
CertificateGeneration {
reason: String,
},
CertificateParsing {
reason: String,
},
CertificateVerification {
reason: String,
},
CertificateRevocation {
reason: String,
},
MerkleTree {
reason: String,
},
Seal {
reason: String,
},
UnsealFailed,
AttestationFailed,
KeyManagement {
reason: String,
},
Signing {
reason: String,
},
InvalidSignature,
CheckpointEncoding {
reason: String,
},
CheckpointParsing {
reason: String,
},
VerifierKey {
reason: String,
},
NoteVerification,
LogArtifactEncoding {
reason: String,
},
LogArtifactVerification,
}Expand description
Errors returned from the trust primitives.
Variants are grouped by operation: certificate lifecycle (generation, parsing, verification, revocation), the Merkle transparency log, sealed payload transport (seal/unseal), key management, signing, and the dedicated signature-verification failure.
Variants§
CertificateGeneration
Generating a certificate failed.
CertificateParsing
Parsing a certificate or extracting one of its fields failed.
CertificateVerification
Verifying a certificate chain failed.
CertificateRevocation
A certificate revocation operation failed.
Reserved for consumer-side operations: revocation tracking is
explicitly a consumer concern (a design non-goal for this crate), so
this crate never constructs the variant itself. It exists so
consumers implementing revocation stores can surface failures through
the shared TrustError type.
MerkleTree
A Merkle transparency-log operation failed.
Seal
Sealing a payload for a recipient failed.
UnsealFailed
Unsealing failed — deliberately omits the cause so callers cannot distinguish wrong-key from tampered-ciphertext (non-oracle).
AttestationFailed
Attestation verification failed — the sender’s public key did not match, or the signature over the sealed payload was invalid.
KeyManagement
A key-management operation failed: file I/O, environment loading, base64 decoding, or key-material length validation.
Signing
Producing a signature failed.
Reserved for consumer-side signing pipelines. This crate’s own Ed25519 signing is infallible (dalek 2 deterministic signing), so the crate never constructs the variant itself; consumers whose signing paths can fail (HSMs, remote signers, key lookups) surface those failures through it.
InvalidSignature
A signature failed verification, or the supplied signature or public key bytes were structurally invalid.
This is also the attestation artifact class’s single non-oracle failure: a malformed or non-canonical COSE attestation artifact, a payload-hash mismatch, and an invalid signature all collapse to this one value, so callers cannot distinguish which check rejected the artifact.
CheckpointEncoding
Building or encoding a checkpoint or signed note failed (invalid origin or key name, malformed body).
CheckpointParsing
Parsing a checkpoint body failed. Used on already-verified body text and operator-supplied text; artifact verification collapses it (non-oracle).
VerifierKey
A note verifier key string was malformed or internally inconsistent. Trusted operator input — carries an actionable reason.
NoteVerification
A signed note failed verification — deliberately omits the cause so callers cannot distinguish malformed envelope, unknown key, or bad signature (non-oracle).
LogArtifactEncoding
Building a log proof artifact failed (tree too large for JSON-safe integers, size/index invariant violations at build time).
LogArtifactVerification
A log proof artifact failed verification — deliberately omits the cause (non-oracle): bad checkpoint signature, size mismatch, root mismatch, malformed hashes, and kind confusion are indistinguishable.
Trait Implementations§
Source§impl Debug for TrustError
impl Debug for TrustError
Source§impl Display for TrustError
impl Display for TrustError
Source§impl Error for TrustError
impl Error for TrustError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()