[#EVP_PKEY_CTX_set_dh_paramgen_generator]
= EVP&lowbar;PKEY&lowbar;CTX&lowbar;set&lowbar;dh&lowbar;paramgen&lowbar;generator
:mrdocs:

Set the DH parameter&hyphen;generation generator (g) on `ctx&period;`

== Synopsis

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

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

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Keygen&sol;paramgen context for a DH key type&period;
| *gen*
| Generator value (commonly 2 or 5)&period;
|===


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