8 bit DH parameters using a generator:</p>

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

<p>Generate EC parameters:</p>

<pre><code>openssl genpkey -genparam -algorithm EC -out ecp.pem \
       -pkeyopt ec_paramgen_curve:secp384r1 \
       -pkeyopt ec_param_enc:named_curve</code></pre>

<p>Generate EC key from parameters:</p>

<pre><code>openssl genpkey -paramfile ecp.pem -out eckey.pem</code></pre>