Produces a plaintext block by applying the basic RSA primitive using a public key on a ciphertext block that was PKCS#1 v1.5 signature padded.
#include "hursa.h"
int hu_RSAPKCS1v15VerPadExponent(sb_Params rsaParams, sb_PublicKey publicKey, size_t sigtextLen, const unsigned char *sigtext, size_t *messageLen, unsigned char *message, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An RSA parameters object.
An RSA public key object.
The length (in bytes) of the ciphertext buffer. This must be equal to the modulus length.
The ciphertext buffer.
The length (in bytes) of the plaintext buffer. This must be at most the modulus length minus 11.
The plaintext buffer.
A global context.
This function implements a modified version of the operation known as RSASSA-PKCS1-v1_5-Verify in PKCS#1 v2.1. The encoding of a message digest into an ASN.1 DigestInfo structure with DER is replaced by the plaintext message unchanged.
In other words, the operation consists of applying the basic RSA primitive on the ciphertext using a public key, ensuring that the decrypted block uses the block formatting of EMSA-PKCS1-v1_5-Encode, and returning the unpadded plaintext.
If the length of the plaintext is known, a pointer to a buffer large enough to hold the plaintext should be passed in message and its length in messageLen. This function will copy the plaintext into message and set the actual length of the plaintext in messageLen.
If message is NULL, or message is not NULL but messageLen is too small, this function will set the maximum length of the plaintext in messageLen.
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 ciphertext buffer is NULL.
The ciphertext buffer length is invalid.
The plaintext buffer length is NULL.
The plaintext buffer length is invalid.
Memory allocation failure.
Success.