Enum devolutions_crypto::Error
source · pub enum Error {
Show 16 variants
InvalidLength,
InvalidKeyLength,
InvalidOutputLength,
InvalidSignature,
InvalidMac,
InvalidDataType,
UnknownType,
UnknownSubtype,
UnknownVersion,
InvalidData,
NullPointer,
CryptoError,
RandomError,
IoError(Error),
NotEnoughShares,
InconsistentVersion,
}
Expand description
This crate’s error type.
Variants§
InvalidLength
The provided data has an invalid length. Error code: -1
InvalidKeyLength
The key length is invalid. Error code: -2
InvalidOutputLength
The length of the FFI output buffer is invalid. Error code: -3
InvalidSignature
The signature of the data blob does not match 0x0d0c. Error code: -11
InvalidMac
The MAC is invalid. Error code: -12
InvalidDataType
The operation cannot be done with this type. Error code: -13
UnknownType
The data type is unknown. Error code: -21
UnknownSubtype
The data subtype is unknown. Error code: -22
UnknownVersion
The data type version is unknown. Error code: -23
InvalidData
The data is invalid. Error code: -24
NullPointer
A null pointer has been passed to the FFI interface. Error code: -31
CryptoError
A cryptographic error occurred. Error code: -32
RandomError
An error with the Random Number Generator occurred. Error code: -33
IoError(Error)
A generic IO error has occurred. Error code: -34
There is not enough shares to regenerate a secret: -41
InconsistentVersion
The version of the multiple data is inconsistent: -42
Implementations§
source§impl Error
impl Error
sourcepub fn error_code(&self) -> i64
pub fn error_code(&self) -> i64
Returns the error code associated with the error. This is useful for passing the exception type across a language boundary.
sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Returns a description of the error