|
Generate CA Private Key
|
|
openssl genrsa -out ca.key 4096
|
|
Self Sign CA (5 years)
|
|
openssl req -new -x509 -sha256 -days 1826 -key ca.key -out ca.crt
|
|
Create a Private Key
|
|
openssl genrsa -out user.key 4096
|
|
Create a certificate request
|
|
openssl req -new -key user.key -out user.csr
|
|
Process the request and get it signed by the CA
|
|
openssl x509 -req -days 730 -sha256 -in user.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out user.crt
|
|
Sign using v3 extension file
|
|
openssl x509 -req -days 730 -sha256 -in user.csr -extfile v3.txt -CA ca.crt -CAkey ca.key -set_serial 01 -out user.crt
|
|
Dump the Certificate
|
|
openssl x509 -in user.crt -text -noout
|
|
Check Purpose
|
|
openssl x509 -purpose -in user.crt -inform PEM
|
|
Inspect Certificate Request
|
|
openssl req -text -noout -verify -in user.csr
|
|
Export as PKCS12 (PFX)
|
|
openssl pkcs12 -export -out user.pfx -inkey user.key -in user.crt
|
|
Export as PKCS12 with including CA public key
|
|
openssl pkcs12 -export -out user.pfx -inkey user.key -in user.crt -certfile ca.crt
|
|
Export as PKCS7 (P7B)
|
|
openssl crl2pkcs7 -nocrl -certfile user.crt -out certificate.p7b
|
|
Convert PFX to PEM
|
|
openssl pkcs12 -in user.pfx -out user.crt -nodes
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.