pub enum DecodeError {
Prefix([u8; 2], [u8; 2]),
Parity(u8, u8),
Base58(Error),
Base64(Base64DecodeError),
KeyLength(usize, usize),
Mac(MacError),
MacLength(usize, usize),
IvLength(usize, usize),
UnsupportedAlgorithm(String),
KdfIterationCount(UInt),
}
Expand description
Error type for the decoding of a SecretStorageKey
.
The SecretStorageKey
can be restored from a Base58 encoded string or
from a string containing a passphrase.
This error type is used to report errors when trying to restore from either of those strings.
Variants§
Prefix([u8; 2], [u8; 2])
The decoded secret storage key has an invalid prefix.
Parity(u8, u8)
The parity byte of the secret storage key didn’t match.
Base58(Error)
The secret storage key isn’t valid Base58.
Base64(Base64DecodeError)
The secret storage key isn’t valid Base64.
KeyLength(usize, usize)
The secret storage key is too short, we couldn’t read enough data.
Mac(MacError)
The typed in secret storage was incorrect, the MAC check failed.
MacLength(usize, usize)
The MAC of the secret storage key for the MAC check has an incorrect length.
IvLength(usize, usize)
The IV of the secret storage key for the MAC check has an incorrect length.
UnsupportedAlgorithm(String)
The secret storage key is using an unsupported secret encryption
algorithm. Currently only the m.secret_storage.v1.aes-hmac-sha2
algorithm is supported.
KdfIterationCount(UInt)
The passphrase-based secret storage key has an excessively high KDF iteration count.
Trait Implementations§
source§impl Debug for DecodeError
impl Debug for DecodeError
source§impl Display for DecodeError
impl Display for DecodeError
source§impl Error for DecodeError
impl Error for DecodeError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<DecodeError> for DecodeError
impl From<DecodeError> for DecodeError
source§fn from(source: Base64DecodeError) -> Self
fn from(source: Base64DecodeError) -> Self
source§impl From<Error> for DecodeError
impl From<Error> for DecodeError
Auto Trait Implementations§
impl Freeze for DecodeError
impl RefUnwindSafe for DecodeError
impl Send for DecodeError
impl Sync for DecodeError
impl Unpin for DecodeError
impl UnwindSafe for DecodeError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more