diff --git a/ed25519-dalek/src/signature.rs b/ed25519-dalek/src/signature.rs index 67359846..af827683 100644 --- a/ed25519-dalek/src/signature.rs +++ b/ed25519-dalek/src/signature.rs @@ -174,4 +174,4 @@ impl From for ed25519::Signature { fn from(sig: InternalSignature) -> ed25519::Signature { ed25519::Signature::from_components(*sig.R.as_bytes(), *sig.s.as_bytes()) } -} \ No newline at end of file +} diff --git a/ed25519-dalek/src/signing.rs b/ed25519-dalek/src/signing.rs index d70371b1..8445c246 100644 --- a/ed25519-dalek/src/signing.rs +++ b/ed25519-dalek/src/signing.rs @@ -667,10 +667,15 @@ impl pkcs8::EncodePrivateKey for SigningKey { #[cfg(feature = "pkcs8")] impl pkcs8::spki::DynSignatureAlgorithmIdentifier for SigningKey { - fn signature_algorithm_identifier(&self) -> pkcs8::spki::Result { + fn signature_algorithm_identifier( + &self, + ) -> pkcs8::spki::Result { // From https://datatracker.ietf.org/doc/html/rfc8410 // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }` - Ok(pkcs8::spki::AlgorithmIdentifier { oid: ed25519::pkcs8::ALGORITHM_OID, parameters: None }) + Ok(pkcs8::spki::AlgorithmIdentifier { + oid: ed25519::pkcs8::ALGORITHM_OID, + parameters: None, + }) } } diff --git a/ed25519-dalek/src/verifying.rs b/ed25519-dalek/src/verifying.rs index 39373fab..986eff07 100644 --- a/ed25519-dalek/src/verifying.rs +++ b/ed25519-dalek/src/verifying.rs @@ -582,10 +582,15 @@ impl pkcs8::EncodePublicKey for VerifyingKey { #[cfg(feature = "pkcs8")] impl pkcs8::spki::DynSignatureAlgorithmIdentifier for VerifyingKey { - fn signature_algorithm_identifier(&self) -> pkcs8::spki::Result { + fn signature_algorithm_identifier( + &self, + ) -> pkcs8::spki::Result { // From https://datatracker.ietf.org/doc/html/rfc8410 // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }` - Ok(ed25519::pkcs8::spki::AlgorithmIdentifierOwned { oid: ed25519::pkcs8::ALGORITHM_OID, parameters: None }) + Ok(ed25519::pkcs8::spki::AlgorithmIdentifierOwned { + oid: ed25519::pkcs8::ALGORITHM_OID, + parameters: None, + }) } } diff --git a/ed25519-dalek/tests/pkcs8.rs b/ed25519-dalek/tests/pkcs8.rs index 49604ec9..9a7362cb 100644 --- a/ed25519-dalek/tests/pkcs8.rs +++ b/ed25519-dalek/tests/pkcs8.rs @@ -4,7 +4,9 @@ //! RFC5958 (PKCS#8) and RFC5280 (SPKI). #![cfg(feature = "pkcs8")] -use ed25519_dalek::pkcs8::{spki::DynSignatureAlgorithmIdentifier, DecodePrivateKey, DecodePublicKey}; +use ed25519_dalek::pkcs8::{ + spki::DynSignatureAlgorithmIdentifier, DecodePrivateKey, DecodePublicKey, +}; use ed25519_dalek::{SigningKey, VerifyingKey}; use hex_literal::hex; @@ -80,4 +82,4 @@ fn get_algo_identifier() { let identifer = signing_key.signature_algorithm_identifier().unwrap(); assert!(identifer.parameters.is_none()); // According to rfc8410 this must be None assert_eq!(identifer.oid, ed25519::pkcs8::ALGORITHM_OID); -} \ No newline at end of file +}