Skip to content

Commit

Permalink
ed25519: correct command description and import
Browse files Browse the repository at this point in the history
  • Loading branch information
ashWhiteHat committed Jul 2, 2023
1 parent 9de96dc commit 03b77aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions ed25519/src/pkcs8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
//! Please lock to a specific minor version of the `ed25519` crate to avoid
//! breaking changes when using this module.

pub use pkcs8::{spki, DecodePrivateKey, DecodePublicKey, Error, PrivateKeyInfo, Result};
pub use pkcs8::{
spki, DecodePrivateKey, DecodePublicKey, Error, ObjectIdentifier, PrivateKeyInfo, Result,
};

#[cfg(feature = "alloc")]
pub use pkcs8::{spki::EncodePublicKey, EncodePrivateKey};
Expand All @@ -23,7 +25,6 @@ pub use pkcs8::{spki::EncodePublicKey, EncodePrivateKey};
pub use pkcs8::der::{asn1::BitStringRef, Document, SecretDocument};

use core::fmt;
use pkcs8::ObjectIdentifier;

#[cfg(feature = "pem")]
use {
Expand Down
6 changes: 3 additions & 3 deletions ed25519/tests/pkcs8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn decode_pkcs8_v1() {
let keypair = KeypairBytes::from_pkcs8_der(PKCS8_V1_DER).unwrap();

// Extracted with:
// $ openssl asn1parse -inform der -in tests/examples/p256-priv.der
// $ openssl asn1parse -inform der -in tests/examples/pkcs8-v1.der
assert_eq!(
keypair.secret_key,
&hex!("D4EE72DBF913584AD5B6D8F1F769F8AD3AFE7C28CBF1D4FBE097A88F44755842")[..]
Expand All @@ -36,7 +36,7 @@ fn decode_pkcs8_v2() {
let keypair = KeypairBytes::from_pkcs8_der(PKCS8_V2_DER).unwrap();

// Extracted with:
// $ openssl asn1parse -inform der -in tests/examples/p256-priv.der
// $ openssl asn1parse -inform der -in tests/examples/pkcs8-v2.der
assert_eq!(
keypair.secret_key,
&hex!("D4EE72DBF913584AD5B6D8F1F769F8AD3AFE7C28CBF1D4FBE097A88F44755842")[..]
Expand All @@ -53,7 +53,7 @@ fn decode_public_key() {
let public_key = PublicKeyBytes::from_public_key_der(PUBLIC_KEY_DER).unwrap();

// Extracted with:
// $ openssl pkey -inform der -in pkcs8-v1.der -pubout -text
// $ openssl pkey -inform der -in tests/examples/pkcs8-v1.der -pubout -text
assert_eq!(
public_key.as_ref(),
&hex!("19BF44096984CDFE8541BAC167DC3B96C85086AA30B6B6CB0C5C38AD703166E1")
Expand Down

0 comments on commit 03b77aa

Please sign in to comment.