I'm creating CSRs for new certificates using OpenSSL. For modern compatibility, I've gone with EC (secp521r1
) certificates. While googling around, I found two different ways of creating the CSR.
I can create a private key explicitly
openssl ecparam -name secp521r1 -genkey -param_enc explicit -out private.key
openssl req -new -sha256 -nodes -key private.key -out sslcert.csr -config san.cnf
or I can create a private key with the request
openssl ecparam -name secp521r1 > ec.file
openssl req -new -sha256 -nodes -newkey ec:ec.file -keyout private.key -out sslcert.csr -config san.cnf
Both of these methods seem to create valid CSR files (I have tested them here).
My question is whether one of the methods above is better/safer? I noticed that the private key file generated by the first method is larger, and so is the CSR file.
For example, when I inspect the CSR using openssl req -noout -text -in sslcert.csr
, the CSR generated by the first method contains much more detailed information about the key, with a section for pub
, Prime
, A
, B
, Generator
, Order
, Cofactor
, Seed
, but there is no mention of secp521r1
.
However, the CSR generated by the second method contains only pub
and a ASN1 OID: secp521r1
. Are these differences important if I'm creating certificates for HTTPS use?
Many thanks!