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 @@ -672,20 +672,6 @@ impl pkcs8::EncodePrivateKey for SigningKey {
672
672
}
673
673
}
674
674
675
- #[ cfg( all( feature = "alloc" , feature = "pkcs8" ) ) ]
676
- impl pkcs8:: spki:: DynSignatureAlgorithmIdentifier for SigningKey {
677
- fn signature_algorithm_identifier (
678
- & self ,
679
- ) -> pkcs8:: spki:: Result < pkcs8:: spki:: AlgorithmIdentifierOwned > {
680
- // From https://datatracker.ietf.org/doc/html/rfc8410
681
- // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }`
682
- Ok ( pkcs8:: spki:: AlgorithmIdentifier {
683
- oid : ed25519:: pkcs8:: ALGORITHM_OID ,
684
- parameters : None ,
685
- } )
686
- }
687
- }
688
-
689
675
#[ cfg( feature = "pkcs8" ) ]
690
676
impl TryFrom < pkcs8:: KeypairBytes > for SigningKey {
691
677
type Error = pkcs8:: Error ;
@@ -716,6 +702,14 @@ impl TryFrom<&pkcs8::KeypairBytes> for SigningKey {
716
702
}
717
703
}
718
704
705
+ #[ cfg( feature = "pkcs8" ) ]
706
+ impl pkcs8:: spki:: SignatureAlgorithmIdentifier for SigningKey {
707
+ type Params = pkcs8:: spki:: der:: AnyRef < ' static > ;
708
+
709
+ const SIGNATURE_ALGORITHM_IDENTIFIER : pkcs8:: spki:: AlgorithmIdentifier < Self :: Params > =
710
+ <Signature as pkcs8:: spki:: AssociatedAlgorithmIdentifier >:: ALGORITHM_IDENTIFIER ;
711
+ }
712
+
719
713
#[ cfg( feature = "pkcs8" ) ]
720
714
impl From < SigningKey > for pkcs8:: KeypairBytes {
721
715
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