#[non_exhaustive]pub enum SmimeError {
Show 13 variants
Der(Error),
UnsupportedAlgorithm(String),
NoMatchingRecipient,
SignatureVerification,
CertChain(CertChainError),
MalformedInput(String),
NoRecipients,
RngFailure(String),
DecryptionFailed(String),
Other(String),
AllSignersFailed(Vec<SignerResult>),
WrongContentType(String),
BoundaryCollision,
}Expand description
Error type for S/MIME operations.
§Serde round-trip
SmimeError implements Serialize and Deserialize. The Der variant
contains a der::Error which has no serde support, so it round-trips
through a string representation: serialized as {"Der":"<message>"},
deserialized back as SmimeError::Der with a der::Error carrying
the message (the original error kind is not preserved across
serialization boundaries).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Der(Error)
DER encoding/decoding failure.
UnsupportedAlgorithm(String)
The algorithm identified by the given OID is not supported.
NoMatchingRecipient
No decryption key matches any RecipientInfo in the EnvelopedData.
SignatureVerification
Signature verification failed.
CertChain(CertChainError)
Certificate chain validation failed.
MalformedInput(String)
Input is structurally malformed (e.g. missing required CMS fields).
NoRecipients
encrypt() was called with an empty recipients slice.
RngFailure(String)
OS random number generator failed during a crypto operation. This indicates a catastrophic system-level failure.
DecryptionFailed(String)
Decryption failed (e.g. bad padding, wrong CEK, or corrupted ciphertext).
Other(String)
Catch-all for operation errors not covered by a more specific variant.
AllSignersFailed(Vec<SignerResult>)
All signers in the CMS SignedData failed verification.
The signers vec contains per-signer error details.
WrongContentType(String)
The ContentInfo content type is not what this operation expects.
For example, passing a SignedData blob to decrypt().
BoundaryCollision
The content contains a MIME boundary that matches the generated separator even after 8 random retries. This is extraordinarily unlikely in practice.
Trait Implementations§
Source§impl Clone for SmimeError
impl Clone for SmimeError
Source§fn clone(&self) -> SmimeError
fn clone(&self) -> SmimeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SmimeError
impl Debug for SmimeError
Source§impl<'de> Deserialize<'de> for SmimeError
impl<'de> Deserialize<'de> for SmimeError
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for SmimeError
impl Display for SmimeError
impl Eq for SmimeError
Source§impl Error for SmimeError
impl Error for SmimeError
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()
Source§impl From<Error> for SmimeError
impl From<Error> for SmimeError
Source§impl PartialEq for SmimeError
impl PartialEq for SmimeError
Source§fn eq(&self, other: &SmimeError) -> bool
fn eq(&self, other: &SmimeError) -> bool
self and other values to be equal, and is used by ==.