me group ffdhe4096:</p>

<pre><code>openssl genpkey -algorithm DH -out dhkey.pem -pkeyopt group:ffdhe4096</code></pre>

<p>Generate 2048 bit X9.42 DH key with 256 bit subgroup using RFC5114 group3:</p>

<pre><code>openssl genpkey -algorithm DHX -out dhkey.pem -pkeyopt dh_rfc5114:3</code></pre>

<p>Generate a DH key using a DH parameters file:</p>

<pre><code>openssl genpkey -paramfile dhp.pem -out dhkey.pem</code></pre>

<p>Output DH parameters for safe prime group ffdhe2048:</p>

<pre><code>openssl genpkey