pub enum Error {
Show 28 variants
InvalidFormat,
UnsupportedVersion(u8),
UnsupportedAlgorithm(u8),
UnsupportedPreset(u8),
TruncatedPayload {
expected: usize,
actual: usize,
},
AuthenticationFailed,
EncryptionFailed(String),
DecryptionFailed(String),
DecompressionFailed(String),
CompressionFailed(String),
InvalidUtf8(String),
InvalidBase64(String),
InvalidHex(String),
SizeMismatch {
expected: usize,
actual: usize,
},
MissingField(String),
InvalidKeyFormat(String),
InvalidKeyLength {
expected: usize,
actual: usize,
},
InvalidNonceLength {
expected: usize,
actual: usize,
},
InvalidConfiguration(String),
SigningFailed(String),
SignatureVerificationFailed,
KeyGenerationFailed(String),
KeyDerivationFailed(String),
HashFailed(String),
PayloadTooLarge {
size: usize,
limit: usize,
},
RandomFailed(String),
SerializationError(String),
DeserializationError(String),
}Expand description
Errors that can occur during cryptographic operations
Variants§
InvalidFormat
Invalid format - magic bytes mismatch
UnsupportedVersion(u8)
Unsupported version number
UnsupportedAlgorithm(u8)
Unsupported algorithm identifier
UnsupportedPreset(u8)
Unsupported fused preset identifier
TruncatedPayload
Data shorter than expected
AuthenticationFailed
Authentication tag verification failed
EncryptionFailed(String)
Encryption operation failed
DecryptionFailed(String)
Decryption operation failed
DecompressionFailed(String)
Decompression failed
CompressionFailed(String)
Compression failed
InvalidUtf8(String)
Invalid UTF-8 sequence
InvalidBase64(String)
Invalid Base64 encoding
InvalidHex(String)
Invalid hex encoding
SizeMismatch
Size mismatch after decompression
MissingField(String)
Required field missing in JSON
InvalidKeyFormat(String)
Invalid key format
InvalidKeyLength
Invalid key length
InvalidNonceLength
Invalid nonce length
InvalidConfiguration(String)
Invalid runtime configuration
SigningFailed(String)
Signing operation failed
SignatureVerificationFailed
Signature verification failed
KeyGenerationFailed(String)
Key generation failed
KeyDerivationFailed(String)
Key derivation failed
HashFailed(String)
Hash operation failed
PayloadTooLarge
Payload too large
RandomFailed(String)
Random number generation failed
SerializationError(String)
Serialization error
DeserializationError(String)
Deserialization error
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
use the Display impl or to_string()