From 568a52b5f76e092fc556a8e081981e598d192c07 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Mon, 4 Mar 2024 16:38:39 +0100 Subject: [PATCH] Add example for creating a certificate signing request (CSR) --- examples/ed25519_csr.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/ed25519_csr.rs b/examples/ed25519_csr.rs index d0fb5f2..0d709d7 100644 --- a/examples/ed25519_csr.rs +++ b/examples/ed25519_csr.rs @@ -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);