diff options
author | Leonard Kugis <leonard@kug.is> | 2020-10-03 20:00:52 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2020-10-03 20:00:52 +0200 |
commit | cff6c67d38ec96cc8d11264011be905420b1bee4 (patch) | |
tree | 59e0375636324b127078bb811b0db0a4e6229854 /openssl_ca.md |
Added cheatsheet for OpenSSL with CA
Diffstat (limited to 'openssl_ca.md')
-rw-r--r-- | openssl_ca.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/openssl_ca.md b/openssl_ca.md new file mode 100644 index 0000000..7cd92f9 --- /dev/null +++ b/openssl_ca.md @@ -0,0 +1,37 @@ +# OpenSSL with CA + +1. Generate private key for CA. +2. Generate CA certificate with CA private key. +3. Generate private key for the application. +4. Create certificate signing request (CSR) for the application. +5. Sign the CSR with the CA certificate and CA private key. + +## Generate private key for CA + +``` +openssl genrsa -out ca.key 4096 +``` + +## Generate CA certificate + +``` +openssl req -new -x509 -key ca.key -out ca.crt +``` + +## Generate app private key + +``` +openssl genrsa -out app.key 4096 +``` + +## Generate CSR + +``` +openssl req -new -key app.key -out app.csr +``` + +## Sign CSR + +``` +openssl x509 -req -in app.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out app.crt +``` |