Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions pkcs8/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@ impl fmt::Display for Error {
}
}

#[cfg(feature = "std")]
impl std::error::Error for Error {}
impl core::error::Error for Error {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match self {
Error::Asn1(err) => Some(err),
#[cfg(feature = "pkcs5")]
Error::EncryptedPrivateKey(err) => Some(err),
Error::PublicKey(err) => Some(err),
_ => None,
}
}
}

impl From<der::Error> for Error {
fn from(err: der::Error) -> Error {
Expand Down