[#DH_generate_key]
= DH&lowbar;generate&lowbar;key
:mrdocs:

Generate a Diffie&hyphen;Hellman private&sol;public key pair on `dh` (deprecated)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
DH&lowbar;generate&lowbar;key(xref:DH.adoc[DH]* dh);
----

[WARNING]
====
https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged.
====
== Description

Prefer EVP&lowbar;PKEY&lowbar;keygen &sol; EVP&lowbar;PKEY&lowbar;derive for new code&period;

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dh*
| DH object that already holds domain parameters&semi; receives the new key pair&period;
|===


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