Verifies a PKCS#1 v1.5 signature on the given message digest.
#include "hursa.h"
int hu_RSAPKCS1v15NoHashVerify(sb_Params rsaParams, sb_PublicKey publicKey, int hashAlgId, size_t digestLen, const unsigned char *digest, size_t signatureLen, const unsigned char *signature, int *result, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An RSA parameters object.
An RSA public key object.
The message digest algorithm identifier. The acceptable values are one of the SB_RSA_PKCS1_V15_SIG_* macros.
The length (in bytes) of the message digest.
The message digest.
The length (in bytes) of the signature. This must be equal to the modulus length.
The signature value.
Verification result. This is non-zero if the signature is valid; otherwise this is zero, meaning that the signature is invalid.
A global context.
This function implements the operation known as RSASSA-PKCS1-v1_5-Verify in PKCS#1 v2.1.
This function assumes that the input is a message digest produced by the specified digest algorithm; no digest operation will be performed on the input. If the specified digest algorithm does not match the algorithm encoded in the signature, an error will be returned.
If the signature is valid for the given digest, this function will return SB_SUCCESS and set result to a non-zero value.
If the signature is not valid for the given digest, this function may return SB_SUCCESS but result will be set to zero.
The length of the modulus can be determined by calling hu_RSAKeyGet() and retrieving the nLen argument.
The rsaParams object is NULL.
The tag for the params object is not of the expected type.
The public key object is NULL.
The public key object is invalid.
The message digest algorithm identifier is invalid.
The message digest buffer is NULL.
The length of the message digest is invalid.
The signature buffer is NULL.
The length of the signature buffer is invalid.
The message digest algorithm identifier is invalid.
The signature was not properly padded.
The verification result pointer is NULL.
Memory allocation failure.
Success.