#[non_exhaustive]pub enum CryptoError {
InvalidKeyLength,
InvalidBlockSize,
BadPadding,
SessionKeyBase64(DecodeError),
}Expand description
Cryptographic failure modes encountered when encrypting requests or decrypting responses.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidKeyLength
3DES key was not 24 bytes long. Indicates a programming bug — the crate’s internals always produce 24-byte keys.
InvalidBlockSize
Ciphertext length was not a multiple of the 3DES block size (8 bytes).
BadPadding
PKCS7 padding verification failed during decryption. Usually means the session key is stale or the ciphertext was tampered with mid-flight.
SessionKeyBase64(DecodeError)
Session key returned by the server did not Base64-decode cleanly.
Trait Implementations§
Source§impl Debug for CryptoError
impl Debug for CryptoError
Source§impl Display for CryptoError
impl Display for CryptoError
impl Eq for CryptoError
Source§impl Error for CryptoError
impl Error for CryptoError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CryptoError> for Error
impl From<CryptoError> for Error
Source§fn from(source: CryptoError) -> Self
fn from(source: CryptoError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for CryptoError
impl From<DecodeError> for CryptoError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CryptoError
impl PartialEq for CryptoError
Source§fn eq(&self, other: &CryptoError) -> bool
fn eq(&self, other: &CryptoError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CryptoError
Auto Trait Implementations§
impl Freeze for CryptoError
impl RefUnwindSafe for CryptoError
impl Send for CryptoError
impl Sync for CryptoError
impl Unpin for CryptoError
impl UnsafeUnpin for CryptoError
impl UnwindSafe for CryptoError
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
Mutably borrows from an owned value. Read more