<div dir="ltr"><div><div>tx for the support. I will try a solution with the problematic software.<br></div>Best regards<br></div>Michele MAsè<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 1, 2017 at 6:55 PM, Viktor Dukhovni <span dir="ltr"><<a href="mailto:openssl-users@dukhovni.org" target="_blank">openssl-users@dukhovni.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jul 26, 2017 at 09:21:43PM +0200, Michele Mase' wrote:<br>
<br>
> So, what should be the command line to use in order to obtain the same key?<br>
> openssl genrsa ....<br>
<br>
</span>This creates keys in a legacy RSA algorithm-specific format.<br>
<span class=""><br>
> openssl req -nodes -newkey rsa:2048 some_extra_parameters ....<br>
<br>
</span>This creates keys in the preferred standard PKCS#8 format.<br>
<br>
You can use "openssl pkey" to read legacy RSA keys and output<br>
PKCS#8 keys.  Or you can use "openssl genpkey" to generate<br>
PKCS#8 keys directly:<br>
<br>
    # RSA<br>
    (umask 077; openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -out key.pem)<br>
<br>
    # ECDSA P-256<br>
    (umask 077; openssl genpkey -algorithm ec -pkeyopt ec_paramgen_curve:prime256v1 -pkeyopt ec_param_enc:named_curve -out key.pem)<br>
<br>
    # ECDSA P-384<br>
    (umask 077; openssl genpkey -algorithm ec -pkeyopt ec_paramgen_curve:secp384r1 -pkeyopt ec_param_enc:named_curve -out key.pem)<br>
<br>
    # ECDSA P-521<br>
    (umask 077; openssl genpkey -algorithm ec -pkeyopt ec_paramgen_curve:secp521r1 -pkeyopt ec_param_enc:named_curve -out key.pem)<br>
<br>
It is unfortunate that OpenSSL 1.0.2 does not accept curve name<br>
aliases for ec_paramgen_curve.  Thus, for example, only "prime256v1"<br>
is accepted for P-256 and not any of its other names.<br>
<br>
I've not checked whether this is fixed in OpenSSL 1.1.0.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
        Viktor.<br>
--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
</font></span></blockquote></div><br></div>