Skip to content

Commit

Permalink
Add example for creating a certificate signing request (CSR)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfl0wer committed Mar 4, 2024
1 parent 1916c58 commit 568a52b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/ed25519_csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ use x509_cert::attr::Attributes;
use x509_cert::name::RdnSequence;
use x509_cert::request::CertReq;

/// The following example uses the same setup as in ed25519_basic.rs, but in its main method, it
/// creates a certificate signing request (CSR) and writes it to a file. The CSR is created from a
/// polyproto ID CSR, which is a wrapper around a PKCS #10 CSR.
///
/// If you have openssl installed, you can inspect the CSR by running:
///
/// ```sh
/// openssl req -in cert.csr -verify
/// ```
fn main() {
let mut csprng = rand::rngs::OsRng;
let priv_key = Ed25519PrivateKey::gen_keypair(&mut csprng);
Expand Down

0 comments on commit 568a52b

Please sign in to comment.