pub unsafe extern "C" fn mbedtls_rsa_gen_key(
    ctx: *mut mbedtls_rsa_context,
    f_rng: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut c_uchar, arg3: usize) -> c_int>,
    p_rng: *mut c_void,
    nbits: c_uint,
    exponent: c_int
) -> c_int
Expand description

\brief This function generates an RSA keypair.

\note mbedtls_rsa_init() must be called before this function, to set up the RSA context.

\param ctx The initialized RSA context used to hold the key. \param f_rng The RNG function to be used for key generation. This is mandatory and must not be \c NULL. \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL if \p f_rng doesn’t need a context. \param nbits The size of the public key in bits. \param exponent The public exponent to use. For example, \c 65537. This must be odd and greater than \c 1.

\return \c 0 on success. \return An \c MBEDTLS_ERR_RSA_XXX error code on failure.