pub enum DecryptionError {
InvalidAccess,
Operation,
Generic(Error),
}
Expand description
Errors that can occur during decryption operations.
These errors map to the exceptions defined in the Web Crypto API specification for decryption operations.
Variants§
InvalidAccess
Indicates that the requested operation is not valid for the provided key. This typically occurs when:
- The key doesn’t support the decryption operation
- The key’s algorithm doesn’t match the specified algorithm
- The key’s usages don’t include “decrypt”
Operation
Indicates that the operation failed for an algorithm-specific reason. This can occur when:
- The ciphertext is corrupted or malformed
- The authentication tag is invalid (for authenticated encryption)
- The algorithm parameters (like nonce) don’t match those used for encryption
Generic(Error)
A wrapper for other types of errors that may occur during decryption
Trait Implementations§
Source§impl Clone for DecryptionError
impl Clone for DecryptionError
Source§fn clone(&self) -> DecryptionError
fn clone(&self) -> DecryptionError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DecryptionError
impl Debug for DecryptionError
Source§impl Display for DecryptionError
impl Display for DecryptionError
Source§impl Error for DecryptionError
impl Error for DecryptionError
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<Error> for DecryptionError
impl From<Error> for DecryptionError
Auto Trait Implementations§
impl Freeze for DecryptionError
impl RefUnwindSafe for DecryptionError
impl Send for DecryptionError
impl Sync for DecryptionError
impl Unpin for DecryptionError
impl UnwindSafe for DecryptionError
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