openssl req
The OpenSSL command that creates certificate signing requests, and with the -x509 option creates a self-signed certificate instead.
In more detail
You give it a private key (or let it generate one), a subject name and extensions such as subject alternative names, and it writes a request signed with that key. With -x509 it signs the result with the same key to produce a self-signed certificate, which is how a root certificate authority or a quick test certificate is made. It can also print and verify existing requests.
Examples
openssl req -new -key www.key -out www.csr -subj "/CN=www.example.com" -addext "subjectAltName=DNS:www.example.com,DNS:example.com"openssl req -x509 -key ca.key -out ca.pem -set_serial 1 -subj "/O=Example Corp/CN=Example Corp Root CA"Related terms
- certificate signing request — A file containing a public key and the name it should be certified for, which an authority signs to produce a certificate.
- self-signed certificate — A certificate signed by its own key rather than by a separate authority, trusted only if you choose to trust it directly.
- OpenSSL — A widely used toolkit and library for cryptography and TLS, including the openssl command-line tool.
- openssl x509 — The OpenSSL command for displaying, converting and signing X.509 certificates.
Taught in
- Security Capstone Review & Certification — Cybersecurity Fundamentals, GRC & Cryptography