File tree Expand file tree Collapse file tree 2 files changed +16
-28
lines changed Expand file tree Collapse file tree 2 files changed +16
-28
lines changed Original file line number Diff line number Diff line change @@ -676,20 +676,6 @@ impl pkcs8::EncodePrivateKey for SigningKey {
676
676
}
677
677
}
678
678
679
- #[ cfg( all( feature = "alloc" , feature = "pkcs8" ) ) ]
680
- impl pkcs8:: spki:: DynSignatureAlgorithmIdentifier for SigningKey {
681
- fn signature_algorithm_identifier (
682
- & self ,
683
- ) -> pkcs8:: spki:: Result < pkcs8:: spki:: AlgorithmIdentifierOwned > {
684
- // From https://datatracker.ietf.org/doc/html/rfc8410
685
- // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }`
686
- Ok ( pkcs8:: spki:: AlgorithmIdentifier {
687
- oid : ed25519:: pkcs8:: ALGORITHM_OID ,
688
- parameters : None ,
689
- } )
690
- }
691
- }
692
-
693
679
#[ cfg( feature = "pkcs8" ) ]
694
680
impl TryFrom < pkcs8:: KeypairBytes > for SigningKey {
695
681
type Error = pkcs8:: Error ;
@@ -720,6 +706,14 @@ impl TryFrom<&pkcs8::KeypairBytes> for SigningKey {
720
706
}
721
707
}
722
708
709
+ #[ cfg( feature = "pkcs8" ) ]
710
+ impl pkcs8:: spki:: SignatureAlgorithmIdentifier for SigningKey {
711
+ type Params = pkcs8:: spki:: der:: AnyRef < ' static > ;
712
+
713
+ const SIGNATURE_ALGORITHM_IDENTIFIER : pkcs8:: spki:: AlgorithmIdentifier < Self :: Params > =
714
+ <Signature as pkcs8:: spki:: AssociatedAlgorithmIdentifier >:: ALGORITHM_IDENTIFIER ;
715
+ }
716
+
723
717
#[ cfg( feature = "pkcs8" ) ]
724
718
impl From < SigningKey > for pkcs8:: KeypairBytes {
725
719
fn from ( signing_key : SigningKey ) -> pkcs8:: KeypairBytes {
Original file line number Diff line number Diff line change @@ -610,6 +610,14 @@ impl TryFrom<&[u8]> for VerifyingKey {
610
610
}
611
611
}
612
612
613
+ #[ cfg( feature = "pkcs8" ) ]
614
+ impl pkcs8:: spki:: SignatureAlgorithmIdentifier for VerifyingKey {
615
+ type Params = pkcs8:: spki:: der:: AnyRef < ' static > ;
616
+
617
+ const SIGNATURE_ALGORITHM_IDENTIFIER : pkcs8:: spki:: AlgorithmIdentifier < Self :: Params > =
618
+ <ed25519:: Signature as pkcs8:: spki:: AssociatedAlgorithmIdentifier >:: ALGORITHM_IDENTIFIER ;
619
+ }
620
+
613
621
impl From < VerifyingKey > for EdwardsPoint {
614
622
fn from ( vk : VerifyingKey ) -> EdwardsPoint {
615
623
vk. point
@@ -623,20 +631,6 @@ impl pkcs8::EncodePublicKey for VerifyingKey {
623
631
}
624
632
}
625
633
626
- #[ cfg( all( feature = "alloc" , feature = "pkcs8" ) ) ]
627
- impl pkcs8:: spki:: DynSignatureAlgorithmIdentifier for VerifyingKey {
628
- fn signature_algorithm_identifier (
629
- & self ,
630
- ) -> pkcs8:: spki:: Result < pkcs8:: spki:: AlgorithmIdentifierOwned > {
631
- // From https://datatracker.ietf.org/doc/html/rfc8410
632
- // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }`
633
- Ok ( ed25519:: pkcs8:: spki:: AlgorithmIdentifierOwned {
634
- oid : ed25519:: pkcs8:: ALGORITHM_OID ,
635
- parameters : None ,
636
- } )
637
- }
638
- }
639
-
640
634
#[ cfg( feature = "pkcs8" ) ]
641
635
impl TryFrom < pkcs8:: PublicKeyBytes > for VerifyingKey {
642
636
type Error = pkcs8:: spki:: Error ;
You can’t perform that action at this time.
0 commit comments