EVP Signing and Verifying
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.