File tree Expand file tree Collapse file tree 3 files changed +1
-41
lines changed Expand file tree Collapse file tree 3 files changed +1
-41
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ vendored = ["openssl/vendored"]
1212
1313[dependencies ]
1414lazy_static = " 1.0"
15- rustc-serialize = " 0.3"
1615
1716[target .'cfg(any(target_os = "macos", target_os = "ios"))' .dependencies ]
1817security-framework = " 0.3.1"
Original file line number Diff line number Diff line change 2727//! * TLS/SSL client communication
2828//! * TLS/SSL server communication
2929//! * PKCS#12 encoded identities
30- //! * PKCS#8 encoded identities
30+ //! * X.509/ PKCS#8 encoded identities
3131//! * Secure-by-default for client and server
3232//! * Includes hostname verification for clients
3333//! * Supports asynchronous I/O for both the server and the client
9797#![ doc( html_root_url = "https://docs.rs/native-tls/0.2" ) ]
9898#![ warn( missing_docs) ]
9999
100- #[ macro_use]
101- extern crate lazy_static;
102-
103100#[ cfg( test) ]
104101extern crate hex;
105102
106- extern crate rustc_serialize;
107103mod pem;
108104
109105use std:: any:: Any ;
Original file line number Diff line number Diff line change 11#![ allow( unused) ]
2- use rustc_serialize:: base64:: { self , FromBase64 , ToBase64 } ;
3-
4- /// Type of the various `PEM_*` constants supplied to `pem_to_der` / `der_to_pem`.
5- pub struct PemGuard {
6- begin : & ' static str ,
7- end : & ' static str ,
8- }
9-
10- macro_rules! pem_guard {
11- ( $n: expr) => {
12- & PemGuard {
13- begin: concat!( "-----BEGIN " , $n, "-----" ) ,
14- end: concat!( "-----END " , $n, "-----" ) ,
15- }
16- }
17- }
18-
19- // Ref. RFC7468, although these are not universally respected.
20- pub const PEM_CERTIFICATE : & ' static PemGuard = pem_guard ! ( "CERTIFICATE" ) ;
21- pub const PEM_CERTIFICATE_REQUEST : & ' static PemGuard = pem_guard ! ( "CERTIFICATE REQUEST" ) ;
22- pub const PEM_ENCRYPTED_PRIVATE_KEY : & ' static PemGuard = pem_guard ! ( "ENCRYPTED PRIVATE KEY" ) ;
23- pub const PEM_PRIVATE_KEY : & ' static PemGuard = pem_guard ! ( "PRIVATE KEY" ) ;
24- pub const PEM_PUBLIC_KEY : & ' static PemGuard = pem_guard ! ( "PUBLIC KEY" ) ;
25- pub const PEM_CMS : & ' static PemGuard = pem_guard ! ( "CMS" ) ;
26-
27- const BASE64_PEM_WRAP : usize = 64 ;
28-
29- lazy_static ! {
30- static ref BASE64_PEM : base64:: Config = base64:: Config {
31- char_set: base64:: CharacterSet :: Standard ,
32- newline: base64:: Newline :: LF ,
33- pad: true ,
34- line_length: Some ( BASE64_PEM_WRAP ) ,
35- } ;
36- }
372
383/// Split data by PEM guard lines
394pub struct PemBlock < ' a > {
You can’t perform that action at this time.
0 commit comments