Forrest logo
back to the openssl tool

openssl-dgst:tldr:b9f99

openssl-dgst: Verify an RSA signature.
$ openssl dgst -verify ${public_key_file} -signature ${signature_file} -sigopt rsa_padding_mode:pss ${signature_message_file}
try on your machine

This command uses the OpenSSL tool with the dgst command to verify the authenticity and integrity of a digital signature.

The components of the command are as follows:

  • openssl: This invokes the OpenSSL tool, which is a widely-used library for secure communications and cryptographic operations.

  • dgst: This is a sub-command of OpenSSL used for message digest operations.

  • -verify ${public_key_file}: This option specifies the public key file to be used for verifying the digital signature. The ${public_key_file} variable should be replaced with the actual path to the public key file.

  • -signature ${signature_file}: This option specifies the file containing the digital signature to be verified. The ${signature_file} variable should be replaced with the actual path to the signature file.

  • -sigopt rsa_padding_mode:pss: This option specifies the signature option to use. In this case, it sets the RSA padding mode to PSS (Probabilistic Signature Scheme), which is a modern and more secure padding scheme compared to older schemes like PKCS#1 v1.5 padding.

  • ${signature_message_file}: This is the file that contains the message corresponding to the digital signature. The ${signature_message_file} variable should be replaced with the actual path to the signature message file.

Putting it all together, this command verifies the digital signature in ${signature_file} using the public key in ${public_key_file} and the message in ${signature_message_file}. It uses the RSA-PSS padding scheme for the verification process.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the openssl tool