Skip to main content

CryptoError

Enum CryptoError 

Source
pub enum CryptoError {
Show 20 variants MemoryAllocationFailure = 1, Internal = 2, BufferStateIndeterminate = 3, RngFailure = 4, InsufficientSeedLength = 5, RandomSamplingRetriesExceeded = 6, RequestTooBig = 7, NoKey = 8, KeySize = 9, KeyBinding = 10, SignatureVerificationFailure = 11, UnsupportedSecurityStrength = 12, UnsupportedParams = 13, UnspecifiedFailure = 14, InvalidParams = 15, InvalidIV = 16, InvalidMessageLength = 17, InvalidPadding = 18, InvalidPoint = 19, InvalidResult = 20,
}
Expand description

Common error returned by cryptographic primitives.

Variants§

§

MemoryAllocationFailure = 1

Memory allocation failure.

§

Internal = 2

Internal logic error.

§

BufferStateIndeterminate = 3

A source or destination buffer was found in indeterminate state.

To be returned from operand IO slice iterators when encountering a buffer in indeterminate state. Indicates an internal logic error.

§

RngFailure = 4

Unspecified random number generator failure condition.

§

InsufficientSeedLength = 5

Attempt to seed a random number generator with a seed of insufficient length.

§

RandomSamplingRetriesExceeded = 6

Some probabilistic sampling algorithm exceeded the maximum number of retries.

§

RequestTooBig = 7

Request size is not supported.

§

NoKey = 8

Private key required for some operation is missing.

§

KeySize = 9

Key size is not supported by an algorithm.

§

KeyBinding = 10

Inconsistency between parts of a key.

This most commonly indicates a mismatch between the public and private parts of an asymmetric key pair, but could also get returned for impossible private keys not in the expected domain.

§

SignatureVerificationFailure = 11

Signature verification failure.

§

UnsupportedSecurityStrength = 12

Requested security strength is not supported.

§

UnsupportedParams = 13

Request parameters not supported.

§

UnspecifiedFailure = 14

Some unspecified failure.

§

InvalidParams = 15

Invalid parameters.

§

InvalidIV = 16

Invalid block cipher mode IV length.

§

InvalidMessageLength = 17

Invalid message length.

§

InvalidPadding = 18

Invalid padding in message.

§

InvalidPoint = 19

A point is not in the expected domain.

§

InvalidResult = 20

A computation resulted in an invalid result.

Implementations§

Source§

impl CryptoError

Source

pub fn anonymize_any_sensitive(self, anonymized_value: Self) -> Self

Source

pub fn map(self, from_code: Self, to_code: Self) -> Self

Trait Implementations§

Source§

impl Clone for CryptoError

Source§

fn clone(&self) -> CryptoError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CryptoError

Source§

impl Debug for CryptoError

Source§

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

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

impl Eq for CryptoError

Source§

impl From<CryptoError> for RngGenerateError

Source§

fn from(value: CryptoError) -> Self

Converts to this type from the input type.
Source§

impl From<CryptoError> for RngReseedError

Source§

fn from(value: CryptoError) -> Self

Converts to this type from the input type.
Source§

impl From<FixedVecMemoryAllocationFailure> for CryptoError

Source§

fn from(_value: FixedVecMemoryAllocationFailure) -> Self

Converts to this type from the input type.
Source§

impl From<FixedVecNewFromFnError<CryptoError>> for CryptoError

Source§

fn from(value: FixedVecNewFromFnError<CryptoError>) -> Self

Converts to this type from the input type.
Source§

impl From<FixedVecNewFromFnError<Infallible>> for CryptoError

Source§

fn from(value: FixedVecNewFromFnError<Infallible>) -> Self

Converts to this type from the input type.
Source§

impl From<Infallible> for CryptoError

Source§

fn from(value: Infallible) -> Self

Converts to this type from the input type.
Source§

impl<BackendIteratorError> From<IoSlicesIterError<BackendIteratorError>> for CryptoError
where CryptoError: From<BackendIteratorError>,

Source§

fn from(value: IoSlicesIterError<BackendIteratorError>) -> Self

Converts to this type from the input type.
Source§

impl From<RngGenerateError> for CryptoError

Source§

fn from(value: RngGenerateError) -> Self

Converts to this type from the input type.
Source§

impl From<TryNewError> for CryptoError

Source§

fn from(value: TryNewError) -> Self

Converts to this type from the input type.
Source§

impl From<TryNewWithError<CryptoError>> for CryptoError

Source§

fn from(value: TryNewWithError<CryptoError>) -> Self

Converts to this type from the input type.
Source§

impl From<TryNewWithError<Infallible>> for CryptoError

Source§

fn from(value: TryNewWithError<Infallible>) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CryptoError

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for CryptoError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.