Fix tests

This commit is contained in:
Steven Fackler 2016-10-22 16:01:26 -07:00
parent 787cad3c82
commit d39a2cedad
4 changed files with 16 additions and 16 deletions

View File

@ -77,7 +77,7 @@ use self::State::*;
/// Calculate a hash in one go. /// Calculate a hash in one go.
/// ///
/// ``` /// ```
/// use openssl::crypto::hash::{hash, MessageDigest}; /// use openssl::hash::{hash, MessageDigest};
/// ///
/// let data = b"\x42\xF4\x97\xE0"; /// let data = b"\x42\xF4\x97\xE0";
/// let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2"; /// let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2";
@ -88,7 +88,7 @@ use self::State::*;
/// Use the `Write` trait to supply the input in chunks. /// Use the `Write` trait to supply the input in chunks.
/// ///
/// ``` /// ```
/// use openssl::crypto::hash::{Hasher, MessageDigest}; /// use openssl::hash::{Hasher, MessageDigest};
/// ///
/// let data = [b"\x42\xF4", b"\x97\xE0"]; /// let data = [b"\x42\xF4", b"\x97\xE0"];
/// let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2"; /// let spec = b"\x7c\x43\x0f\x17\x8a\xef\xdf\x14\x87\xfe\xe7\x14\x4e\x96\x41\xe2";

View File

@ -10,13 +10,13 @@
//! Sign and verify data given an RSA keypair: //! Sign and verify data given an RSA keypair:
//! //!
//! ```rust //! ```rust
//! use openssl::crypto::sign::{Signer, Verifier}; //! use openssl::sign::{Signer, Verifier};
//! use openssl::crypto::rsa::RSA; //! use openssl::rsa::Rsa;
//! use openssl::crypto::pkey::PKey; //! use openssl::pkey::PKey;
//! use openssl::crypto::hash::MessageDigest; //! use openssl::hash::MessageDigest;
//! //!
//! // Generate a keypair //! // Generate a keypair
//! let keypair = RSA::generate(2048).unwrap(); //! let keypair = Rsa::generate(2048).unwrap();
//! let keypair = PKey::from_rsa(keypair).unwrap(); //! let keypair = PKey::from_rsa(keypair).unwrap();
//! //!
//! let data = b"hello, world!"; //! let data = b"hello, world!";
@ -38,9 +38,9 @@
//! Compute an HMAC (note that `Verifier` cannot be used with HMACs): //! Compute an HMAC (note that `Verifier` cannot be used with HMACs):
//! //!
//! ```rust //! ```rust
//! use openssl::crypto::sign::Signer; //! use openssl::sign::Signer;
//! use openssl::crypto::pkey::PKey; //! use openssl::pkey::PKey;
//! use openssl::crypto::hash::MessageDigest; //! use openssl::hash::MessageDigest;
//! //!
//! // Create a PKey //! // Create a PKey
//! let key = PKey::hmac(b"my secret").unwrap(); //! let key = PKey::hmac(b"my secret").unwrap();

View File

@ -36,10 +36,10 @@ pub enum Extension {
/// ///
/// ``` /// ```
/// use openssl::x509::extension::Extension::*; /// use openssl::x509::extension::Extension::*;
/// use openssl::nid::Nid; /// use openssl::nid;
/// ///
/// # let generator = openssl::x509::X509Generator::new(); /// # let generator = openssl::x509::X509Generator::new();
/// generator.add_extension(OtherNid(Nid::BasicConstraints,"critical,CA:TRUE".to_owned())); /// generator.add_extension(OtherNid(nid::BASIC_CONSTRAINTS,"critical,CA:TRUE".to_owned()));
/// ``` /// ```
OtherNid(Nid, String), OtherNid(Nid, String),
/// Arbitrary extensions by OID string. See `man ASN1_generate_nconf` for value syntax. /// Arbitrary extensions by OID string. See `man ASN1_generate_nconf` for value syntax.

View File

@ -130,13 +130,13 @@ impl X509StoreContextRef {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use openssl::crypto::hash::MessageDigest; /// use openssl::hash::MessageDigest;
/// use openssl::crypto::pkey::PKey; /// use openssl::pkey::PKey;
/// use openssl::crypto::rsa::RSA; /// use openssl::rsa::Rsa;
/// use openssl::x509::X509Generator; /// use openssl::x509::X509Generator;
/// use openssl::x509::extension::{Extension, KeyUsageOption}; /// use openssl::x509::extension::{Extension, KeyUsageOption};
/// ///
/// let rsa = RSA::generate(2048).unwrap(); /// let rsa = Rsa::generate(2048).unwrap();
/// let pkey = PKey::from_rsa(rsa).unwrap(); /// let pkey = PKey::from_rsa(rsa).unwrap();
/// ///
/// let gen = X509Generator::new() /// let gen = X509Generator::new()