RSA_generate_key(3) | LibreSSL | RSA_generate_key(3) |
NAME
RSA_generate_key_ex, RSA_generate_key - generate RSA key pairSYNOPSIS
#include <openssl/rsa.h>
int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
RSA *RSA_generate_key(int num, unsigned long e,
void (*callback)(int,int,void *), void *cb_arg);
DESCRIPTION
RSA_generate_key_ex() generates a key pair and stores it in the RSA structure provided in rsa.- •
- While a random prime number is generated, it is called as described in BN_generate_prime(3).
- •
- When the n-th randomly generated prime is rejected as not suitable for the key, BN_GENCB_call(cb, 2, n) is called.
- •
- When a random p has been found with p-1 relatively prime to e, it is called as BN_GENCB_call(cb, 3, 0).
RETURN VALUE
If key generation fails, RSA_generate_key() returns NULL.BUGS
BN_GENCB_call(cb, 2, x) is used with two different meanings.SEE ALSO
ERR_get_error(3), rand(3), rsa(3), RSA_free(3), BN_generate_prime(3)HISTORY
The cb_arg argument was added in SSLeay 0.9.0.2015-10-26 | LibreSSL |