Drake Amara
Drake Amara

Reputation: 3312

Creating a sha256 signature using openssl

I need to create a SHA256 signature using OpenSSL ?

I tried:

  openssl sha256 -sha256 -binary -sign (providing my priv key & contents)

But, I get the following error : openssl:Error: 'sha256' is an invalid command.

sha1 works fine, but I thought sha256 was supported as well.

Upvotes: 3

Views: 4664

Answers (1)

Omri Barel
Omri Barel

Reputation: 9480

OpenSSL uses the command 'dgst' to calculate various digests (including SHA-256). The command also allows you to sign a digest (using a private key) and verify a signature (using a public key).

Upvotes: 4

Related Questions