diff options
| author | Steven Fackler <[email protected]> | 2018-03-05 19:25:01 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2018-03-05 19:25:01 -0800 |
| commit | f645165ee2b41f9c15d9a7d8f3eec56000b7e445 (patch) | |
| tree | fa73a4f56ab43023b8819703d02d98531a87988b /openssl/src | |
| parent | Merge pull request #857 from Ralith/middlebox-compat (diff) | |
| download | rust-openssl-f645165ee2b41f9c15d9a7d8f3eec56000b7e445.tar.xz rust-openssl-f645165ee2b41f9c15d9a7d8f3eec56000b7e445.zip | |
Remove the x509 module-level example
The example generated a bogus certificate that was missing a serial
number, a validity range, etc.
Generating a correct x509 certificate is complex enough that doing it
correctly is too long to be a reasonable doc example. There's already
a more complete example in the examples directory that handles things
more correctly.
Closes #859
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/x509/mod.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index a4bbb5f0..9638e6a3 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -6,39 +6,6 @@ //! data with the included public key. `X509` certificates are used in many //! Internet protocols, including SSL/TLS, which is the basis for HTTPS, //! the secure protocol for browsing the web. -//! -//! # Example -//! -//! Build an `X509` certificate and use a generated RSA key to sign it. -//! -//! ```rust -//! -//! extern crate openssl; -//! -//! use openssl::x509::{X509, X509Name}; -//! use openssl::pkey::PKey; -//! use openssl::hash::MessageDigest; -//! use openssl::rsa::Rsa; -//! use openssl::nid::Nid; -//! -//! fn main() { -//! let rsa = Rsa::generate(2048).unwrap(); -//! let pkey = PKey::from_rsa(rsa).unwrap(); -//! -//! let mut name = X509Name::builder().unwrap(); -//! name.append_entry_by_nid(Nid::COMMONNAME, "foobar.com").unwrap(); -//! let name = name.build(); -//! -//! let mut builder = X509::builder().unwrap(); -//! builder.set_version(2).unwrap(); -//! builder.set_subject_name(&name).unwrap(); -//! builder.set_issuer_name(&name).unwrap(); -//! builder.set_pubkey(&pkey).unwrap(); -//! builder.sign(&pkey, MessageDigest::sha256()).unwrap(); -//! -//! let certificate: X509 = builder.build(); -//! } -//! ``` use libc::{c_int, c_long}; use ffi; |