Update cheatsheets

This commit is contained in:
ivuorinen
2026-02-21 00:26:53 +00:00
parent d1fa360568
commit fac4aab4b1
15 changed files with 93 additions and 24 deletions

View File

@@ -9,29 +9,29 @@ source: https://github.com/tldr-pages/tldr.git
> Some subcommands such as `req` have their own usage documentation.
> More information: <https://docs.openssl.org/master/man1/openssl/>.
- Generate a private key and encrypt the output file using AES256:
- Generate a private key and encrypt the output file using AES-256:
`openssl genpkey -algorithm {{rsa|ec}} -out {{private.key}} -aes256`
`openssl genpkey -algorithm {{rsa|ec}} -out {{path/to/private.key}} -aes256`
- Generate the corresponding public key from private key `private.key` using `rsa`:
- Generate the corresponding public key from the private key `private.key` using `rsa`:
`openssl rsa -in {{private.key}} -pubout -out {{public.key}}`
`openssl rsa -in {{path/to/private.key}} -pubout -out {{path/to/public.key}}`
- Generate a self-signed certificate valid for a specified number of days (`365`):
- Generate a self-signed certificate valid for a specified number of days (365):
`openssl req -new -x509 -key {{private.key}} -out {{certificate.crt}} -days {{365}}`
`openssl req -new -x509 -key {{path/to/private.key}} -out {{path/to/certificate.crt}} -days 365`
- Convert certificate to `pem` or `der` format:
- Convert a certificate to `.pem` or `.der` format:
`openssl x509 -in {{certificate.crt}} -out {{certificate.pem|certificate.der}} -outform {{pem|der}}`
`openssl x509 -in {{path/to/certificate.crt}} -out {{path/to/certificate.pem|path/to/certificate.der}} -outform {{pem|der}}`
- Check certificate details:
`openssl x509 -in {{certificate.crt}} -text -noout`
`openssl x509 -in {{path/to/certificate.crt}} -text -noout`
- Generate a certificate signing request (CSR):
`openssl req -new -key {{private.key}} -out {{request.csr}}`
`openssl req -new -key {{path/to/private.key}} -out {{path/to/request.csr}}`
- Display help: