notes:openssl
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| notes:openssl [2023/10/10 23:51] – david | notes:openssl [2024/06/01 21:18] (current) – [openssl s_client] david | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Create a ECC private key using the prime256v1 algorithm ((https:// | Create a ECC private key using the prime256v1 algorithm ((https:// | ||
| < | < | ||
| - | < | + | using secp384r1 |
| - | -out example.com.csr \ | + | < |
| - | -subj "/ | + | |
| - | -addext " | + | Create CSR from key |
| + | < | ||
| + | -subj "/ | ||
| + | -addext " | ||
| + | |||
| + | |||
| + | One-liner for ECC key | ||
| + | < | ||
| + | -keyout $(hostname -f).key -out $(hostname -f).csr \ | ||
| + | -subj "/ | ||
| + | -addext " | ||
| + | </ | ||
| ==== Create a RSA key ==== | ==== Create a RSA key ==== | ||
| < | < | ||
| + | |||
| + | Create rsa key and csr | ||
| < | < | ||
| -keyout example.com.key \ | -keyout example.com.key \ | ||
| -subj "/ | -subj "/ | ||
| -addext " | -addext " | ||
| + | |||
| + | one liner for RSA key and csr using system FQDN | ||
| + | < | ||
| + | -addext " | ||
| + | </ | ||
| + | |||
| ===== get cert modulus and compare to private key ===== | ===== get cert modulus and compare to private key ===== | ||
| Line 68: | Line 88: | ||
| With certificate verification | With certificate verification | ||
| openssl s_client -connect example.com: | openssl s_client -connect example.com: | ||
| + | |||
| + | Retrieve just the RSA public key if the site has both ECDSA & RSA | ||
| + | openssl s_client -sigalgs " | ||
| + | to retrieve the EC cert use " | ||
| + | |||
| + | For more examples of using signature algorithms see https:// | ||
| + | |||
| + | |||
| wget and openssl s_client | wget and openssl s_client | ||
| Line 76: | Line 104: | ||
| ===== Encrypting using openssl ===== | ===== Encrypting using openssl ===== | ||
| openssl enc -e -k 1234 -aes256 -in text.txt -out text.txt.enc | openssl enc -e -k 1234 -aes256 -in text.txt -out text.txt.enc | ||
| + | |||
| + | |||
| + | openssl enc -e -k 1234 -aes256 -pbkdf2 -in text.txt -out text.txt.enc | ||
| + | |||
| + | openssl enc -d -k 1234 -aes256 -pbkdf2 -in text.txt -out text.txt.enc | ||
| #Signing files | #Signing files | ||
| Line 138: | Line 171: | ||
| https:// | https:// | ||
| + | |||
| + | https:// | ||
| + | |||
| + | https:// | ||
| + | |||
| + | https:// | ||
notes/openssl.1696996315.txt.gz · Last modified: by david
