Skip to main content

TrustError

Enum TrustError 

Source
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.

Fields

§reason: String

Human-readable cause of the generation failure.

§

CertificateParsing

Parsing a certificate or extracting one of its fields failed.

Fields

§reason: String

Human-readable cause of the parsing failure.

§

CertificateVerification

Verifying a certificate chain failed.

Fields

§reason: String

Human-readable cause of the verification failure.

§

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.

Fields

§reason: String

Human-readable cause of the revocation failure.

§

MerkleTree

A Merkle transparency-log operation failed.

Fields

§reason: String

Human-readable cause of the Merkle operation failure.

§

Seal

Sealing a payload for a recipient failed.

Fields

§reason: String

Human-readable cause of the seal failure.

§

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.

Fields

§reason: String

Human-readable cause of the key-management failure.

§

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.

Fields

§reason: String

Human-readable cause of the signing failure.

§

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).

Fields

§reason: String

Human-readable cause of the encoding failure.

§

CheckpointParsing

Parsing a checkpoint body failed. Used on already-verified body text and operator-supplied text; artifact verification collapses it (non-oracle).

Fields

§reason: String

Human-readable cause of the parsing failure.

§

VerifierKey

A note verifier key string was malformed or internally inconsistent. Trusted operator input — carries an actionable reason.

Fields

§reason: String

Human-readable cause of the verifier-key failure.

§

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).

Fields

§reason: String

Human-readable cause of the encoding failure.

§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TrustError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for TrustError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more