Difference between revisions of "EVP Signing and Verifying"

From OpenSSLWiki
Jump to navigationJump to search
Line 138: Line 138:
 
==Downloads==
 
==Downloads==
  
[[Media:t-hmac.c.tar.gz|t-hmac.c.tar.gz]] - sample program to sign and verify a string using an HMAC with the EVP_DigestSign* and EVP_DigestVerify* functions.
+
[[Media:t-hmac.c.tar.gz|t-hmac.c.tar.gz]] - sample program to sign and verify a string using an HMAC with the <tt>EVP_DigestSign*</tt> and <tt>EVP_DigestVerify*</tt> functions.
  
[[Media:t-rsa.c.tar.gz|t-rsa.c.tar.gz]] - sample program to sign and verify a string using RSA with the EVP_DigestSign* and EVP_DigestVerify* functions.
+
[[Media:t-rsa.c.tar.gz|t-rsa.c.tar.gz]] - sample program to sign and verify a string using RSA with the <tt>EVP_DigestSign*</tt> and <tt>EVP_DigestVerify*</tt> functions.
  
 
==See also==
 
==See also==

Revision as of 01:03, 8 February 2015

There are two APIs available to perform sign and verify operations. The first are the older EVP_Sign* and EVP_Verify* functions; and the second are the newer and more flexible EVP_DigestSign* and EVP_DigestVerify* functions. Though the APIs are similar, new applications should use the EVP_DigestSign* and EVP_DigestVerify* functions.

The examples below use the new EVP_DigestSign* and EVP_DigestVerify* functions to demonstarte signing and verification. The first example uses an HMAC, and the second example uses RSA key pairs. Additionally, the code for the example is available for download.


Refer to Manual:EVP_DigestVerifyInit(3) and Manual:EVP_VerifyInit(3) for further information on the verify functions.


Downloads

t-hmac.c.tar.gz - sample program to sign and verify a string using an HMAC with the EVP_DigestSign* and EVP_DigestVerify* functions.

t-rsa.c.tar.gz - sample program to sign and verify a string using RSA with the EVP_DigestSign* and EVP_DigestVerify* functions.

See also