dex:1 -pkeyopt dh_paramgen_type:2</code></pre>

<p>Output 1024 bit X9.42 DH parameters with 160 bit subgroup using FIP186-2 keygen:</p>

<pre><code>openssl genpkey -genparam -algorithm DHX -out dhp.pem -text \
    -pkeyopt pbits:1024 -pkeyopt qbits:160 -pkeyopt digest:SHA1 \
    -pkeyopt gindex:1 -pkeyopt dh_paramgen_type:1</code></pre>

<p>Output 2048 bit DH parameters:</p>

<pre><code>openssl genpkey -genparam -algorithm DH -out dhp.pem \
    -pkeyopt dh_paramgen_prime_len:2048</code></pre>

<p>Output 204