[][src]Enum simple_secrets::SimpleSecretsError

pub enum SimpleSecretsError {
    TextDecodingError {
        role: &'static str,
        cause: DecodeError,
    },
    CorruptPacket(CorruptPacketKind),
    DeserializingError(Error),
    InvalidKeyLength(usize),
    RandomSourceUnavailable(Error),
    SerializingError(Error),
    UnknownKey {
        expected_id: String,
        actual_id: String,
    },
}

All the ways the secrets may not work.

Variants

TextDecodingError

There was a problem decoding text data into bytes. Examples include the hex master key or the websafe packet values.

Fields of TextDecodingError

role: &'static str

The purpose of the item we were decoding

cause: DecodeError

The underlying error

CorruptPacket(CorruptPacketKind)

The data is has been corrupted to the point where it is unrecoverable. The kind contains more detail.

DeserializingError(Error)

The data was verified and decrypted, but could not be deserialized into a Rust data type. Contains the underlying error.

InvalidKeyLength(usize)

The master key data must contain exactly 32 bytes, but it did not. Contains the actual number of bytes found.

RandomSourceUnavailable(Error)

The system's source of secure randomness is not available for use. Contains the underlying error.

SerializingError(Error)

The Rust data type could not be prepared for encryption by serializing it into bytes. Contains the underlying error.

UnknownKey

The packet was encrypted with a another key.

Fields of UnknownKey

expected_id: String

The key id mentioned in the packet header. 6 bytes (12 hex chars).

actual_id: String

The key id provided by the application. 6 bytes (12 hex chars).

Trait Implementations

impl From<SymmetricCipherError> for SimpleSecretsError
[src]

fn from(_err: SymmetricCipherError) -> Self
[src]

Occurs only when the encrypted data has been damaged. This should probably not be seen in practice since both the key and the data integrity are checked before decryption.

impl From<Error> for SimpleSecretsError
[src]

impl From<Error> for SimpleSecretsError
[src]

impl From<Error> for SimpleSecretsError
[src]

impl Debug for SimpleSecretsError
[src]

impl Display for SimpleSecretsError
[src]

impl Fail for SimpleSecretsError
[src]

fn context<D>(self, context: D) -> Context<D> where
    D: Display + Send + Sync + 'static, 
[src]

Provides context for this failure. Read more

fn compat(self) -> Compat<Self>
[src]

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsFail for T where
    T: Fail
[src]

impl<E> Fail for E where
    E: 'static + Error + Send + Sync
[src]

fn name(&self) -> Option<&str>
[src]

Returns the "name" of the error. Read more

fn cause(&self) -> Option<&(dyn Fail + 'static)>
[src]

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more

fn backtrace(&self) -> Option<&Backtrace>
[src]

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more

fn context<D>(self, context: D) -> Context<D> where
    D: Display + Send + Sync + 'static, 
[src]

Provides context for this failure. Read more

fn compat(self) -> Compat<Self>
[src]

Wraps this failure in a compatibility wrapper that implements std::error::Error. Read more