pub enum Error {
Pem(Error),
UnexpectedPemTag(String),
UnexpectedAlgorithm,
MalformedKey(String),
TrailingData,
InvalidSignature,
}eddsa only.Expand description
Failures of the EdDSA 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 Ed25519, 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 a seed or point of the wrong size, 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. 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()