@@ -95,6 +95,7 @@ mod server_name;
95
95
#[ cfg( feature = "alloc" ) ]
96
96
pub mod pem;
97
97
98
+ pub use alg_id:: AlgorithmIdentifier ;
98
99
pub use server_name:: {
99
100
AddrParseError , DnsName , InvalidDnsNameError , IpAddr , Ipv4Addr , Ipv6Addr , ServerName ,
100
101
} ;
@@ -900,65 +901,6 @@ pub trait SignatureVerificationAlgorithm: Send + Sync + fmt::Debug {
900
901
#[ derive( Debug , Copy , Clone ) ]
901
902
pub struct InvalidSignature ;
902
903
903
- /// A DER encoding of the PKIX AlgorithmIdentifier type:
904
- ///
905
- /// ```ASN.1
906
- /// AlgorithmIdentifier ::= SEQUENCE {
907
- /// algorithm OBJECT IDENTIFIER,
908
- /// parameters ANY DEFINED BY algorithm OPTIONAL }
909
- /// -- contains a value of the type
910
- /// -- registered for use with the
911
- /// -- algorithm object identifier value
912
- /// ```
913
- /// (from <https://www.rfc-editor.org/rfc/rfc5280#section-4.1.1.2>)
914
- ///
915
- /// The outer sequence encoding is *not included*, so this is the DER encoding
916
- /// of an OID for `algorithm` plus the `parameters` value.
917
- ///
918
- /// For example, this is the `rsaEncryption` algorithm:
919
- ///
920
- /// ```
921
- /// let rsa_encryption = rustls_pki_types::AlgorithmIdentifier::from_slice(
922
- /// &[
923
- /// // algorithm: 1.2.840.113549.1.1.1
924
- /// 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01,
925
- /// // parameters: NULL
926
- /// 0x05, 0x00
927
- /// ]
928
- /// );
929
- /// ```
930
- #[ derive( Clone , Copy , PartialEq , Eq ) ]
931
- pub struct AlgorithmIdentifier ( & ' static [ u8 ] ) ;
932
-
933
- impl AlgorithmIdentifier {
934
- /// Makes a new `AlgorithmIdentifier` from a static octet slice.
935
- ///
936
- /// This does not validate the contents of the slice.
937
- pub const fn from_slice ( bytes : & ' static [ u8 ] ) -> Self {
938
- Self ( bytes)
939
- }
940
- }
941
-
942
- impl AsRef < [ u8 ] > for AlgorithmIdentifier {
943
- fn as_ref ( & self ) -> & [ u8 ] {
944
- self . 0
945
- }
946
- }
947
-
948
- impl fmt:: Debug for AlgorithmIdentifier {
949
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
950
- hex ( f, self . 0 )
951
- }
952
- }
953
-
954
- impl Deref for AlgorithmIdentifier {
955
- type Target = [ u8 ] ;
956
-
957
- fn deref ( & self ) -> & Self :: Target {
958
- self . as_ref ( )
959
- }
960
- }
961
-
962
904
/// A timestamp, tracking the number of non-leap seconds since the Unix epoch.
963
905
///
964
906
/// The Unix epoch is defined January 1, 1970 00:00:00 UTC.
0 commit comments