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
Success | P6R::eOk | |
Failure | eNotInitialized | A successful call to initialize was not made before this call. |
eFormatError | A DSA private key has not been loaded via loadDSAKeyPair. |
eInvalidArg | One of the parameters is NULL or |
eNotFound | File data source does not exist. |
eEndOfFile | |
eIoError | Write to file data sink failed. |
eTooSmall | The buffer data sink is too small to contain the generated value. |
eTooBig | Internal error |
eFail | The verify calculation failed. |
eMissingKey | setKey must be called before this function. |
eWrongKeyClass | Public or symetric keys only can sign data. |
eInvalidHMAC | A DSA key is being used for verification, but the HMAC specified was not SH_SHA1. |
eSignatureMismatch | Either data or signature HAS been modified. |