pub enum Error {
Pem(Error),
UnexpectedPemTag(String),
UnexpectedAlgorithm,
MalformedKey(String),
TrailingData,
InvalidSignature,
}xdsa only.Expand description
Failures of the xDSA 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 composite
ML-DSA-65-Ed25519-SHA512, see OID. Raised by SecretKey::from_der
and PublicKey::from_der, and through them by the PEM parsers.
MalformedKey(String)
The key encoding cannot be parsed or its contents are unusable, such as invalid component keys or sizes, unexpected algorithm parameters, trailing DER bytes, or an unsupported PKCS#8 version. The message names the problem. Raised by the fallible key constructors.
TrailingData
A parsed DER key re-encodes to a different length than the input.
This is a fallback consistency check in the DER constructors. The DER
parser rejects appended bytes first and reports Error::MalformedKey
instead, including when called through the PEM constructors.
InvalidSignature
The signature does not verify under the key for this message. Either
half failing produces this, the halves are not told apart. Raised by
PublicKey::verify.
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()