Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed25519-dalek: bring signature identifiers #728

Open
wants to merge 1 commit into
base: rustcrypto-new-releases
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions ed25519-dalek/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,14 @@ impl TryFrom<&pkcs8::KeypairBytes> for SigningKey {
}
}

#[cfg(feature = "pkcs8")]
impl pkcs8::spki::SignatureAlgorithmIdentifier for SigningKey {
type Params = pkcs8::spki::der::AnyRef<'static>;

const SIGNATURE_ALGORITHM_IDENTIFIER: pkcs8::spki::AlgorithmIdentifier<Self::Params> =
<Signature as pkcs8::spki::AssociatedAlgorithmIdentifier>::ALGORITHM_IDENTIFIER;
}

#[cfg(feature = "pkcs8")]
impl From<SigningKey> for pkcs8::KeypairBytes {
fn from(signing_key: SigningKey) -> pkcs8::KeypairBytes {
Expand Down
9 changes: 9 additions & 0 deletions ed25519-dalek/src/verifying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,15 @@ impl TryFrom<&[u8]> for VerifyingKey {
}
}

#[cfg(feature = "pkcs8")]
impl pkcs8::spki::SignatureAlgorithmIdentifier for VerifyingKey {
type Params = pkcs8::spki::der::AnyRef<'static>;

const SIGNATURE_ALGORITHM_IDENTIFIER: pkcs8::spki::AlgorithmIdentifier<Self::Params> =
<ed25519::Signature as pkcs8::spki::AssociatedAlgorithmIdentifier>::ALGORITHM_IDENTIFIER;
}


impl From<VerifyingKey> for EdwardsPoint {
fn from(vk: VerifyingKey) -> EdwardsPoint {
vk.point
Expand Down
Loading