Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

29
openssl-dgst Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`