h 256 bits in CBC mode and <b>hmacWithSHA512</b> PRF:</p>

<pre><code>openssl pkcs8 -in key.pem -topk8 -v2 aes-256-cbc -v2prf hmacWithSHA512 -out enckey.pem</code></pre>

<p>Convert a private key to PKCS#8 using a PKCS#5 1.5 compatible algorithm (DES):</p>

<pre><code>openssl pkcs8 -in key.pem -topk8 -v1 PBE-MD5-DES -out enckey.pem</code></pre>

<p>Convert a private key to PKCS#8 using a PKCS#12 compatible algorithm (3DES):</p>

<pre><code>openssl pkcs8 -in key.pem -topk8 -out enckey.pem -v1 PBE-SHA1-3DES</