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);
- 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).