Loading openssl/src/pkey.rs +5 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ //! //! # Example //! //! Generate a 2048-bit RSA public/private key pair. //! Generate a 2048-bit RSA public/private key pair and print the public key. //! //! ```rust //! Loading @@ -32,10 +32,14 @@ //! //! use openssl::rsa::Rsa; //! use openssl::pkey::PKey; //! use std::str; //! //! fn main() { //! let rsa = Rsa::generate(2048).unwrap(); //! let pkey = PKey::from_rsa(rsa).unwrap(); //! //! let pub_key: Vec<u8> = pkey.public_key_to_pem().unwrap(); //! println!("{:?}", str::from_utf8(pub_key.as_slice()).unwrap()); //! } //! ``` Loading Loading
openssl/src/pkey.rs +5 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ //! //! # Example //! //! Generate a 2048-bit RSA public/private key pair. //! Generate a 2048-bit RSA public/private key pair and print the public key. //! //! ```rust //! Loading @@ -32,10 +32,14 @@ //! //! use openssl::rsa::Rsa; //! use openssl::pkey::PKey; //! use std::str; //! //! fn main() { //! let rsa = Rsa::generate(2048).unwrap(); //! let pkey = PKey::from_rsa(rsa).unwrap(); //! //! let pub_key: Vec<u8> = pkey.public_key_to_pem().unwrap(); //! println!("{:?}", str::from_utf8(pub_key.as_slice()).unwrap()); //! } //! ``` Loading