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 @@ -665,20 +665,6 @@ impl pkcs8::EncodePrivateKey for SigningKey {
665
665
}
666
666
}
667
667
668
- #[ cfg( all( feature = "alloc" , feature = "pkcs8" ) ) ]
669
- impl pkcs8:: spki:: DynSignatureAlgorithmIdentifier for SigningKey {
670
- fn signature_algorithm_identifier (
671
- & self ,
672
- ) -> pkcs8:: spki:: Result < pkcs8:: spki:: AlgorithmIdentifierOwned > {
673
- // From https://datatracker.ietf.org/doc/html/rfc8410
674
- // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }`
675
- Ok ( pkcs8:: spki:: AlgorithmIdentifier {
676
- oid : ed25519:: pkcs8:: ALGORITHM_OID ,
677
- parameters : None ,
678
- } )
679
- }
680
- }
681
-
682
668
#[ cfg( feature = "pkcs8" ) ]
683
669
impl TryFrom < pkcs8:: KeypairBytes > for SigningKey {
684
670
type Error = pkcs8:: Error ;
@@ -709,6 +695,14 @@ impl TryFrom<&pkcs8::KeypairBytes> for SigningKey {
709
695
}
710
696
}
711
697
698
+ #[ cfg( feature = "pkcs8" ) ]
699
+ impl pkcs8:: spki:: SignatureAlgorithmIdentifier for SigningKey {
700
+ type Params = pkcs8:: spki:: der:: AnyRef < ' static > ;
701
+
702
+ const SIGNATURE_ALGORITHM_IDENTIFIER : pkcs8:: spki:: AlgorithmIdentifier < Self :: Params > =
703
+ <Signature as pkcs8:: spki:: AssociatedAlgorithmIdentifier >:: ALGORITHM_IDENTIFIER ;
704
+ }
705
+
712
706
#[ cfg( feature = "pkcs8" ) ]
713
707
impl From < SigningKey > for pkcs8:: KeypairBytes {
714
708
fn from ( signing_key : SigningKey ) -> pkcs8:: KeypairBytes {
Original file line number Diff line number Diff line change @@ -567,6 +567,14 @@ impl TryFrom<&[u8]> for VerifyingKey {
567
567
}
568
568
}
569
569
570
+ #[ cfg( feature = "pkcs8" ) ]
571
+ impl pkcs8:: spki:: SignatureAlgorithmIdentifier for VerifyingKey {
572
+ type Params = pkcs8:: spki:: der:: AnyRef < ' static > ;
573
+
574
+ const SIGNATURE_ALGORITHM_IDENTIFIER : pkcs8:: spki:: AlgorithmIdentifier < Self :: Params > =
575
+ <ed25519:: Signature as pkcs8:: spki:: AssociatedAlgorithmIdentifier >:: ALGORITHM_IDENTIFIER ;
576
+ }
577
+
570
578
impl From < VerifyingKey > for EdwardsPoint {
571
579
fn from ( vk : VerifyingKey ) -> EdwardsPoint {
572
580
vk. point
@@ -580,20 +588,6 @@ impl pkcs8::EncodePublicKey for VerifyingKey {
580
588
}
581
589
}
582
590
583
- #[ cfg( all( feature = "alloc" , feature = "pkcs8" ) ) ]
584
- impl pkcs8:: spki:: DynSignatureAlgorithmIdentifier for VerifyingKey {
585
- fn signature_algorithm_identifier (
586
- & self ,
587
- ) -> pkcs8:: spki:: Result < pkcs8:: spki:: AlgorithmIdentifierOwned > {
588
- // From https://datatracker.ietf.org/doc/html/rfc8410
589
- // `id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 }`
590
- Ok ( ed25519:: pkcs8:: spki:: AlgorithmIdentifierOwned {
591
- oid : ed25519:: pkcs8:: ALGORITHM_OID ,
592
- parameters : None ,
593
- } )
594
- }
595
- }
596
-
597
591
#[ cfg( feature = "pkcs8" ) ]
598
592
impl TryFrom < pkcs8:: PublicKeyBytes > for VerifyingKey {
599
593
type Error = pkcs8:: spki:: Error ;
You can’t perform that action at this time.
0 commit comments