Creates an RSA private and/or public key object from the given key value(s).
#include "hursa.h"
int hu_RSAKeySet(sb_Params rsaParams, size_t eLen, const unsigned char *e, size_t nLen, const unsigned char *n, size_t dLen, const unsigned char *d, size_t pLen, const unsigned char *p, size_t qLen, const unsigned char *q, size_t dModPLen, const unsigned char *dModPm1, size_t dModQLen, const unsigned char *dModQm1, size_t qInvLen, const unsigned char *qInvModP, sb_PrivateKey *privateKey, sb_PublicKey *publicKey, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
An RSA parameters object.
The length (in bytes) of the public exponent. Must be less than or equal to nLen.
The public exponent.
The length (in bytes) of the modulus.
The modulus.
The length (in bytes) of the private exponent. Must be less than or equal to nLen.
The private exponent.
The length (in bytes) of the first prime p. Must be less than or equal to nLen.
First large prime factor of the modulus.
The length (in bytes) of the second prime p. Must be less than or equal to nLen.
Second large prime factor of the modulus.
The length (in bytes) of the d mod p-1 CRT coefficient. Must be equal to pLen.
d mod p-1 CRT coefficient.
The length (in bytes) of the d mod q-1 CRT coefficient. Must be equal to qLen.
d mod q-1 CRT coefficient.
The length (in bytes) of q inverse mod p CRT coefficient.
q inverse mod p CRT coefficient.
The private key object pointer.
The public key object pointer.
A global context.
A private key object can be created by supplying one of the following combinations of key data:
Private key objects contains the key data in the CRT format. The following rules apply:
Private key object always
A public key object can be created by supplying n and, optionally, e. If e is not supplied, this function will assume a default value of 65537 (0x10001) as the public exponent.
The rsaParams object is NULL.
The tag for the params object is not of the expected type.
Both the private and public key object pointers are NULL.
Not enough key data supplied to create a key.
The length of the public exponent is invalid.
Memory allocation failure.
Success.