From f645165ee2b41f9c15d9a7d8f3eec56000b7e445 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 5 Mar 2018 19:25:01 -0800 Subject: [PATCH] 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 --- openssl/src/x509/mod.rs | 33 --------------------------------- 1 file changed, 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;