#[non_exhaustive]pub enum Error {
EmptyPassword,
EmptyValue,
InvalidEncFormat,
InvalidJasyptData,
DecryptionFailed,
Base64(DecodeError),
Io(Error),
Json(Error),
KeyDecrypt {
key: String,
source: Box<Error>,
},
InvalidParameter(String),
}Expand description
All errors produced by rustcrypt_jasypt.
The enum is #[non_exhaustive]: new variants may be added in minor
releases, so always keep a wildcard arm when matching on it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyPassword
The password passed to a constructor was empty.
EmptyValue
The plaintext or ciphertext passed to encrypt/decrypt was empty.
InvalidEncFormat
A value was expected to look like ENC(...) but did not.
InvalidJasyptData
The decoded Jasypt payload is too short or not block-aligned.
DecryptionFailed
Authentication or padding check failed (wrong password or tampered data).
Details are intentionally not exposed so that callers cannot use this library as a padding/authentication oracle.
Base64(DecodeError)
The value was not valid standard (padded) base64.
Io(Error)
I/O error while reading or writing a configuration file.
Json(Error)
JSON parse or conversion error (feature config).
KeyDecrypt
A specific key in a map or config file could not be decrypted.
Fields
InvalidParameter(String)
A builder parameter was out of range (for example a key size that is not 16, 24 or 32 bytes).
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()