Generates a signature on the given message digest by applying the PKCS#1 v1.5 signature scheme.
#include "hursa.h"
int hu_RSAPKCS1v15NoHashSign(sb_Params rsaParams, sb_PrivateKey privateKey, int hashAlgId, size_t digestLen, const unsigned char *digest, size_t *signatureLen, unsigned char *signature, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An RSA parameters object.
An RSA private 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 at least the modulus length.
The signature value.
A global context.
This function implements the operation known as RSASSA-PKCS1-v1_5-Sign 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 length of the signature is known, a pointer to a buffer large enough to hold the signature should be passed in signature and its length in signatureLen. This function will copy the signature into signature and set the actual length of the signature in signatureLen.
If signature is NULL, or signature is not NULL but signatureLen is too small, this function will set the maximum length of the signature in signatureLen.
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 private key object is NULL.
The private 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 length of the signature buffer is NULL.
The signature buffer is invalid.
Memory allocation failure.
Success.