Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ISign::verify ( P6CRYPTODATASOURCE pInData,
P6CRYPTODATASOURCE pSignature,
P6BOOL  base64Encoded,
P6SIGNHMAC  hmac 
)
pure virtual

Verify that the data pointed to by pInData has not been modified.

That is the signature pointed to by pSignature has been generated on the data pInData with the proper key. If either an RSA, EC, or DSA key has been used then setKey() must be called before this function is called passing the public key. If SYM is used then the shared symetric key must be passed to setKey().

When verifying a signature, the specified HMAC must match the one specified when the signature was created. Additionally, when verifying signatures using DSA keys, the hmac specified MUST be SH_SHA1.

Parameters
pInData[ in ] Same data used to create the signature in sign()
pSignature[ in ] Value generated by sign()
base64Encoded[ in ] Is the signature in base64?
hmac[ in ] the hash algorithm to use for the message digest. See P6R::P6SIGNHMAC.
Returns
SuccessP6R::eOk 
FailureeNotInitializedA successful call to initialize was not made before this call.
eFormatErrorA DSA private key has not been loaded via loadDSAKeyPair.
eInvalidArgOne of the parameters is NULL or
eNotFoundFile data source does not exist.
eEndOfFile
eIoErrorWrite to file data sink failed.
eTooSmallThe buffer data sink is too small to contain the generated value.
eTooBigInternal error
eFailThe verify calculation failed.
eMissingKeysetKey must be called before this function.
eWrongKeyClassPublic or symetric keys only can sign data.
eInvalidHMACA DSA key is being used for verification, but the HMAC specified was not SH_SHA1.
eSignatureMismatchEither data or signature HAS been modified.