Skip to main content

VerifierError

Enum VerifierError 

Source
#[non_exhaustive]
pub enum VerifierError { InvalidSubstrateHeaderLength { actual: usize, }, InvalidSubstrateHeaderHex(String), InvalidReceiptHeaderLength { actual: usize, }, InvalidReceiptHeaderHex(String), UnsupportedReceiptVersion { actual: u8, expected: u8, }, InvalidReceiptSize { actual: usize, expected: usize, }, UnknownAlgorithmBits { flags: u8, }, PublicKeysParse(String), PublicKeysBase64 { field: &'static str, detail: String, }, UnknownAlgorithm(String), }
Expand description

Every way verification can fail to run.

A successful verify_structural call still returns a VerificationResult which itself may report failed checks — those are NOT VerifierErrors. This type is reserved for inputs that are malformed to the point where no verdict can be produced.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidSubstrateHeaderLength

The X-H33-Substrate header was not 64 hex characters.

Fields

§actual: usize

Number of characters actually present in the header value.

§

InvalidSubstrateHeaderHex(String)

The X-H33-Substrate header contained invalid hex.

§

InvalidReceiptHeaderLength

The X-H33-Receipt header was not 84 hex characters.

Fields

§actual: usize

Number of characters actually present in the header value.

§

InvalidReceiptHeaderHex(String)

The X-H33-Receipt header contained invalid hex.

§

UnsupportedReceiptVersion

The decoded receipt bytes had an unexpected version byte.

The expected version for this verifier build is RECEIPT_VERSION.

Fields

§actual: u8

The version byte the receipt actually carried.

§expected: u8

The version byte this verifier build understands.

§

InvalidReceiptSize

The decoded receipt bytes were not exactly 42 bytes.

Fields

§actual: usize

Byte length the parser read.

§expected: usize

Byte length the spec requires.

§

UnknownAlgorithmBits

The receipt’s algorithm flags byte had bits set that the verifier does not recognize. This can happen when a newer server adds a fourth signature family before the verifier crate catches up. Not fatal — the recognized families still verify — but the caller should know that the full algorithm set was not inspected.

Fields

§flags: u8

The raw algorithm flags byte.

§

PublicKeysParse(String)

The public-keys JSON document could not be parsed.

§

PublicKeysBase64

A base64 value in the public-keys JSON could not be decoded.

Fields

§field: &'static str

The JSON field the bad base64 was in.

§detail: String

Human-readable decoder detail.

§

UnknownAlgorithm(String)

An unknown algorithm string appeared in X-H33-Algorithms. The verifier recognizes exactly these identifiers:

  • ML-DSA-65 (Dilithium, NIST FIPS 204)
  • FALCON-512
  • SPHINCS+-SHA2-128f (SLH-DSA, NIST FIPS 205)

Trait Implementations§

Source§

impl Debug for VerifierError

Source§

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

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

impl Display for VerifierError

Source§

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

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

impl Error for VerifierError

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

impl From<VerifierError> for Error

Available on crate feature std only.
Source§

fn from(e: VerifierError) -> Self

Converts to this type from the input type.

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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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