Page History
...
To check a signature with OpenSSL we use the public key related to the private key the file was signed with. We extract the public key to the pubkey.pem
file from the given certificate.pem
X.509 certificate file.
Code Block | ||
---|---|---|
| ||
openssl x509 -in certificate.pem -noout -pubkey > pubkey.pem |
...
In this step a file test.txt
is signed with the privkey.pem
private key file, the binary signature is stored to the test.txt.sig
file.
Code Block | language | bash
---|
openssl dgst -sign privkey.pem -keyform pem -sha256 -out test.txt.sig -binary test.txt |
...
In this step the pubkey.pem
public key file is used to check if the test.txt.sig
signature file matches the test.txt
file.
Code Block | language | bash
---|
openssl dgst -verify pubkey.pem -keyform pem -sha256 -signature test.txt.sig -binary test.txt |
...
Overview
Content Tools