RSA Security 5.2.2 Projection Television User Manual


 
Performing DSA Operations
248 RSA BSAFE Crypto-C Developers Guide
data and you know its length, your call is the following:
Step 5: Final
B_VerifyUpdate digested the data. Check the signature with B_VerifyFinal. The
Reference Manual Chapter 2 entry on
AI_DSAWithSHA1 states:
This function does not return immediately, so use a surrender context:
The return value will be zero if the signature verifies, nonzero if it does not. Of course,
a nonzero return value may indicate some other error, so check any error return
against the Crypto-C Error Types, Appendix A of the Reference Manual.
Step 6: Destroy
When you are done with all objects, remember to destroy them:
if ((status = B_VerifyUpdate
(dsaVerifier, inputData, inputDataLen,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
You must pass a random algorithm in B_SignFinal, but may pass
(B_ALGORITHM_OBJ)NULL_PTR for all other
randomAlgorithm
arguments.
/* generalFlag is for the surrender function. */
generalFlag = 0;
if ((status = B_VerifyFinal
(dsaVerifier, signature, signatureLen,
(B_ALGORITHM_OBJ)NULL_PTR,
&generalSurrenderContext)) != 0)
break;
B_DestroyAlgorithmObject (&dsaVerifier);
B_DestroyKeyObject (&dsaPublicKey);