Generates a signature on the given message digest by applying the PKCS#1 v2.1 signature scheme.
#include "hursapss.h"
int hu_RSAPSSNoHashSign(sb_Params rsaParams, sb_PrivateKey privateKey, int hashAlgId, size_t digestLen, const unsigned char *digest, size_t saltLen, 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_PSS_* macros.
The length in bytes of the message digest.
The message digest.
The length of the salt. The recommended value is digestLen.
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-PSS-Sign in PKCS#1 v2.1.
This function uses the EMSA-PSS encoding method, with the MGF1 Mask Generation function as described 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. The specified message digest algorithm will be used in the EMSA-PSS encoding method as well.
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 return an error.
The value of saltLen determines the length of the salt that will be used in the signature operation. It is recommended in PKCS#1 v2.1 that this value be the same as digestLen. The salt length used for the verification operation must match the salt length used for
the signature operation. The recommended salt length should always be used unless the salt length is clearly specified and known by both the signer and the verifier.
The modulus being used must be large enough for the data being signed. Thus, the minimum size of the modulus depends on both the saltLen and digestLen. This minimum is roughly equal to the sum of saltLen and digestLen. The exact relation that must be preserved is: ((# of bits in the modulus) - 1) >= 8*digestLen + 8*saltLen + 9
The RSA parameter object must have been created with an RNG context if saltLen is not zero.
The rsaParams object is NULL.
The rsaParams object is invalid.
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.