File tree Expand file tree Collapse file tree 3 files changed +3
-41
lines changed Expand file tree Collapse file tree 3 files changed +3
-41
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,10 @@ readme = "README.md"
1010[features ]
1111vendored = [" openssl/vendored" ]
1212
13- [dependencies ]
14- lazy_static = " 1.0"
15- rustc-serialize = " 0.3"
16-
1713[target .'cfg(any(target_os = "macos", target_os = "ios"))' .dependencies ]
1814security-framework = " 0.3.1"
1915security-framework-sys = " 0.3.1"
16+ lazy_static = " 1.0"
2017libc = " 0.2"
2118tempfile = " 3.0"
2219
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
9898#![ warn( missing_docs) ]
9999
100100#[ macro_use]
101+ #[ cfg( any( target_os = "macos" , target_os = "ios" ) ) ]
101102extern crate lazy_static;
102103
103104#[ cfg( test) ]
104105extern crate hex;
105106
106- extern crate rustc_serialize;
107107mod pem;
108108
109109use 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