#[repr(i32)]pub enum ErrorCode {
ERROR_CODE_UNSPECIFIED = 0,
ERROR_CODE_INVALID_REQUEST = 1,
ERROR_CODE_UNSUPPORTED_ALGORITHM = 2,
ERROR_CODE_UNSUPPORTED_KEY_FORM = 3,
ERROR_CODE_KEY_NOT_FOUND = 4,
ERROR_CODE_USER_DECLINED = 5,
ERROR_CODE_AUTHENTICATION_REQUIRED = 6,
ERROR_CODE_HARDWARE_ERROR = 7,
ERROR_CODE_TIMEOUT = 8,
ERROR_CODE_INTERNAL = 99,
}Expand description
Errors. Every protocol response that can fail has an Error field;
callers MUST check code before using any other field.
Variants§
ERROR_CODE_UNSPECIFIED = 0
ERROR_CODE_INVALID_REQUEST = 1
The request was structurally invalid (missing required fields, unknown algorithm number, payload too large for this transport).
ERROR_CODE_UNSUPPORTED_ALGORITHM = 2
The signer does not support the requested algorithm.
ERROR_CODE_UNSUPPORTED_KEY_FORM = 3
The signer does not support the requested key form.
ERROR_CODE_KEY_NOT_FOUND = 4
The named key (by key_id or path) was not present.
ERROR_CODE_USER_DECLINED = 5
The user explicitly declined (touched the cancel button on a FIDO2 key, refused the TPM auth prompt, etc.).
ERROR_CODE_AUTHENTICATION_REQUIRED = 6
Authentication required (PIN, biometric, presence) and the signer is asking the caller to satisfy it via a follow-up request.
ERROR_CODE_HARDWARE_ERROR = 7
The hardware did not respond, returned a vendor-specific error,
or is in an unrecoverable state. Error.message carries detail.
ERROR_CODE_TIMEOUT = 8
The operation timed out before the user satisfied a presence check or PIN prompt.
ERROR_CODE_INTERNAL = 99
Something went wrong inside the signer that we cannot map to a
more specific code. Should be rare. Error.message MUST be set.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const Unspecified: Self = Self::ERROR_CODE_UNSPECIFIED
pub const Unspecified: Self = Self::ERROR_CODE_UNSPECIFIED
Idiomatic alias for Self::ERROR_CODE_UNSPECIFIED; Debug prints the variant name.
Sourcepub const InvalidRequest: Self = Self::ERROR_CODE_INVALID_REQUEST
pub const InvalidRequest: Self = Self::ERROR_CODE_INVALID_REQUEST
Idiomatic alias for Self::ERROR_CODE_INVALID_REQUEST; Debug prints the variant name.
Sourcepub const UnsupportedAlgorithm: Self = Self::ERROR_CODE_UNSUPPORTED_ALGORITHM
pub const UnsupportedAlgorithm: Self = Self::ERROR_CODE_UNSUPPORTED_ALGORITHM
Idiomatic alias for Self::ERROR_CODE_UNSUPPORTED_ALGORITHM; Debug prints the variant name.
Sourcepub const UnsupportedKeyForm: Self = Self::ERROR_CODE_UNSUPPORTED_KEY_FORM
pub const UnsupportedKeyForm: Self = Self::ERROR_CODE_UNSUPPORTED_KEY_FORM
Idiomatic alias for Self::ERROR_CODE_UNSUPPORTED_KEY_FORM; Debug prints the variant name.
Sourcepub const KeyNotFound: Self = Self::ERROR_CODE_KEY_NOT_FOUND
pub const KeyNotFound: Self = Self::ERROR_CODE_KEY_NOT_FOUND
Idiomatic alias for Self::ERROR_CODE_KEY_NOT_FOUND; Debug prints the variant name.
Sourcepub const UserDeclined: Self = Self::ERROR_CODE_USER_DECLINED
pub const UserDeclined: Self = Self::ERROR_CODE_USER_DECLINED
Idiomatic alias for Self::ERROR_CODE_USER_DECLINED; Debug prints the variant name.
Sourcepub const AuthenticationRequired: Self = Self::ERROR_CODE_AUTHENTICATION_REQUIRED
pub const AuthenticationRequired: Self = Self::ERROR_CODE_AUTHENTICATION_REQUIRED
Idiomatic alias for Self::ERROR_CODE_AUTHENTICATION_REQUIRED; Debug prints the variant name.
Sourcepub const HardwareError: Self = Self::ERROR_CODE_HARDWARE_ERROR
pub const HardwareError: Self = Self::ERROR_CODE_HARDWARE_ERROR
Idiomatic alias for Self::ERROR_CODE_HARDWARE_ERROR; Debug prints the variant name.
Sourcepub const Timeout: Self = Self::ERROR_CODE_TIMEOUT
pub const Timeout: Self = Self::ERROR_CODE_TIMEOUT
Idiomatic alias for Self::ERROR_CODE_TIMEOUT; Debug prints the variant name.
Sourcepub const Internal: Self = Self::ERROR_CODE_INTERNAL
pub const Internal: Self = Self::ERROR_CODE_INTERNAL
Idiomatic alias for Self::ERROR_CODE_INTERNAL; Debug prints the variant name.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for ErrorCode
Available on crate feature arbitrary only.
impl<'arbitrary> Arbitrary<'arbitrary> for ErrorCode
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreimpl Copy for ErrorCode
Source§impl Enumeration for ErrorCode
impl Enumeration for ErrorCode
Source§fn proto_name(&self) -> &'static str
fn proto_name(&self) -> &'static str
.proto file.