1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-06 12:06:00 +02:00

openssl-dgst, openssl-genpkey: add page (#4879)

This commit is contained in:
Mat 2020-10-28 15:54:16 +01:00 committed by GitHub
parent dc1f53f8dd
commit 8b07793aa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,24 @@
# openssl dgst
> OpenSSL command to generate digest values and perform signature operations.
> More information: <https://www.openssl.org/docs/manmaster/man1/openssl-dgst.html>.
- Calculate the SHA256 digest for a file, saving the result to a specific file:
`openssl dgst -sha256 -binary -out {{output_file}} {{input_file}}`
- Sign a file using an RSA key, saving the result to a specific file:
`openssl dgst -sign {{private_key_file}} -sha256 -sigopt rsa_padding_mode:pss -out {{output_file}} {{input_file}}`
- Verify an RSA signature:
`openssl dgst -verify {{public_key_file}} -signature {{signature_file}} -sigopt rsa_padding_mode:pss {{signature_message_file}}`
- Sign a file using and ECDSA key:
`openssl dgst -sign {{private_key_file}} -sha256 -out {{output_file}} {{input_file}}`
- Verify an ECDSA signature:
`openssl dgst -verify {{public_key_file}} -signature {{signature_file}} {{signature_message_file}}`

View file

@ -0,0 +1,16 @@
# openssl genpkey
> OpenSSL command to generate asymmetric key pairs.
> More information: <https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html>.
- Generate an RSA private key of 2048 bits, saving it to a specific file:
`openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:{{2048}} -out {{filename.key}}`
- Generate an elliptic curve private key using the curve `prime256v1`, saving it to a specific file:
`openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:{{prime256v1}} -out {{filename.key}}`
- Generate an `ED25519` elliptic curve private key, saving it to a specific file:
`openssl genpkey -algorithm {{ED25519}} -out {{filename.key}}`