-
Create self signed certificate
ca.certopenssl req -newkey rsa:2048 -nodes -keyout ca.key -x509 -days 365 -out ca.cert
-
View the certificate
openssl x509 -noout -text -in ca.cert | less
-
Create a password for user batman stored in
batman.keyopenssl genrsa -out batman.key 2048
-
Create sign request (CSR)
batman.csruser (CN) batman in groups (O) Heros, JusticeLeagueopenssl req -new -key batman.key -out batman.csr -subj "/CN=batman/O=Heros/O=JusticeLeague" # view openssl req -noout -text -verify -in batman.csr | less
-
As authority sign the request
batman.csrfor batman which createsbatman.certvalid for 100 days, using the certificate authorityopenssl x509 -req -in batman.csr -CA ca.cert -CAkey ca.key -CAcreateserial -out batman.cert -days 100
-
Verify that certificate
batman.certwas signed by a CAca.certopenssl verify -verbose -CAfile ca.cert batman.cert