Skip to main content

KernelError

Enum KernelError 

Source
#[non_exhaustive]
pub enum KernelError {
Show 23 variants HkdfExpandFailed, SigningFailed, SignatureInvalid, KeyDecodingFailed, SignatureDecodingFailed, NotBeforeViolation, NotAfterViolation, MalformedCaveatBuffer, ScopeEscalation, ScopeEmpty, ScopeTooLarge, CaveatsTooLarge, EmptyChain, ChainTooDeep, ParentKeyMismatch, LeafCannotDelegate, DepthMismatch, InvalidRoleByte, WireVersionMismatch, WireTruncated, WireInvalid, ResourceTooLong, VerbTooLong,
}
Expand description

Errors returned by QHermes kernel operations.

This enum is marked #[non_exhaustive]. Match arms must include a wildcard to remain compatible with variants added in minor releases.

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

HkdfExpandFailed

HKDF key expansion returned an error.

§

SigningFailed

The ML-DSA-65 signing operation failed.

§

SignatureInvalid

The signature does not match the payload under the given public key.

§

KeyDecodingFailed

The public key bytes are not a valid ML-DSA-65 verifying key.

§

SignatureDecodingFailed

The signature bytes are not a valid ML-DSA-65 signature.

§

NotBeforeViolation

A not_before caveat was evaluated with a timestamp earlier than the caveat value.

§

NotAfterViolation

A not_after caveat was evaluated with a timestamp later than the caveat value.

§

MalformedCaveatBuffer

The caveat buffer contains an unrecognized tag byte or has an invalid layout.

§

ScopeEscalation

A child credential claims a permission not covered by the parent scope.

§

ScopeEmpty

The scope was constructed from an empty slice. Every credential must grant at least one permission.

§

ScopeTooLarge

The scope contains more than MAX_SCOPE_PERMS permissions.

§

CaveatsTooLarge

The caveat buffer exceeds CAVEAT_SIZE * MAX_CAVEATS bytes.

§

EmptyChain

An operation was attempted on an empty credential chain.

§

ChainTooDeep

The chain depth exceeds MAX_DEPTH.

§

ParentKeyMismatch

The issuer public key in a link does not match the child public key of the previous link.

§

LeafCannotDelegate

A credential with role Leaf attempted to issue a further delegation.

§

DepthMismatch

The depth field of the payload does not equal the expected sequential position in the chain.

§

InvalidRoleByte

The role byte in the payload is neither 0 (Leaf) nor 1 (Node).

§

WireVersionMismatch

The first byte of the wire buffer does not match WIRE_VERSION.

§

WireTruncated

The wire buffer or a sub-slice ends before the expected bytes.

§

WireInvalid

The wire buffer is structurally inconsistent: a length field, role byte, or trailing-bytes check failed.

§

ResourceTooLong

The resource argument to perm_tlv exceeds RESOURCE_LEN bytes.

§

VerbTooLong

The verb argument to perm_tlv exceeds VERB_LEN bytes.

Trait Implementations§

Source§

impl Debug for KernelError

Source§

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

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

impl PartialEq for KernelError

Source§

fn eq(&self, other: &KernelError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for KernelError

Source§

impl StructuralPartialEq for KernelError

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