RSA_generate_key

Generate an RSA key pair (very old API; deprecated — prefer RSA_generate_key_ex).

Synopsis

Declared in <openssl/rsa.h>

[[deprecated]]
RSA*
RSA_generate_key(
    int bits,
    unsigned long e,
    void(* callback)(int, int, void*),
    void* cb_arg);

WARNING

Deprecated. Use of this entity is allowed but discouraged.

Return Value

New RSA key pair, or NULL on error.

Parameters

NameDescription
bitsModulus size in bits.
ePublic exponent (for example 65537).
callbackOptional progress callback, or NULL.
cb_argOpaque argument passed to callback.