Method 1:
#To check supported curves
openssl ecparam -list_curves
#Generate certificate and key
openssl ecparam -out key.pem -name prime256v1 -genkey
#Signing request
openssl req -new -sha256 -key key.pem -out sign.csr
#Self Signing
openssl req -x509 -sha256 -days 365 -key key.pem -in sign.csr -out cert.pem
Method 2:
#Creating CA Private Key
mkdir pki
cd pki
openssl genrsa -aes256 -out ca_priv.key 2048
ENTER PASSWORD
#Creating CA - Certificate Authourity
openssl req -new -x509 -key ca_priv.key -sha256 -days 365 -out ca.pem
#To generate the key
openssl genrsa -out www.site.com.key 2048
#To generate CSR - Certificate signing request
openssl req -new -key ww.site.com.key -out www.site.com.csr
#To sign. For below command we need CA.pem and CA.key. otherinfo.ext is SAN detail (subject alternative name)
openssl x509 -req -in ww.site.com.csr -CA ca.pem -CAkey ca_priv.key -out ww.site.com.crt -days 365 -sha256 -CAcreateserial -extfile otherinfo.ext
Comments
Post a Comment