pub enum Error {
Pem(Error),
UnexpectedPemTag(String),
UnexpectedAlgorithm,
MalformedKey(String),
InvalidSignature,
}rsa only.Expand description
Failures of the RSA operations.
Variants§
Pem(Error)
The PEM wrapper is malformed. The inner error names the rule it broke.
Raised by SecretKey::from_pem and PublicKey::from_pem.
UnexpectedPemTag(String)
The PEM block type is not the expected one, PRIVATE KEY for
SecretKey::from_pem and PUBLIC KEY for PublicKey::from_pem.
Carries the type found.
UnexpectedAlgorithm
The DER key names an algorithm other than RSA, see OID.
Raised by SecretKey::from_der
and PublicKey::from_der, and through them by the PEM parsers.
MalformedKey(String)
The key parsed but its contents are unusable, a modulus that is not 2048 bits, an exponent other than 65537, primes that are not both 1024 bits, a private exponent not below the modulus, primes without a CRT coefficient, a non-canonical encoding or an unsupported PKCS#8 version. The message names the problem. Raised by every key constructor.
InvalidSignature
The signature does not verify under the key for this message or hash,
or it is not a well formed RSA-2048 signature at all. Raised by
PublicKey::verify and PublicKey::verify_hash.
Trait Implementations§
impl Eq for Error
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()