[#EVP_PKEY_CTX_set_rsa_keygen_bits]
= EVP&lowbar;PKEY&lowbar;CTX&lowbar;set&lowbar;rsa&lowbar;keygen&lowbar;bits
:mrdocs:

Set the RSA modulus size in bits for key generation on an EVP&lowbar;PKEY&lowbar;CTX&period;

== Synopsis

Declared in `&lt;openssl&sol;rsa&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;PKEY&lowbar;CTX&lowbar;set&lowbar;rsa&lowbar;keygen&lowbar;bits(
    xref:EVP_PKEY_CTX.adoc[EVP&lowbar;PKEY&lowbar;CTX]* ctx,
    int bits);
----

== Return Value

1 on success, or a non&hyphen;positive value on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Keygen context for an RSA algorithm&period;
| *bits*
| Desired modulus length in bits (for example 2048 or 3072)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
