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.