Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate PKCS#8 private key with openssl [closed]

Is it possible to use openssl to generate a PKCS#8 private key directly, or do I have to first generate a PKCS#1 key with genrsa and then convert it?

like image 468
Benjy Wiener Avatar asked Jun 27 '18 06:06

Benjy Wiener


People also ask

What is a PKCS 12 certificate?

PKCS#12 (also known as PKCS12 or PFX) is a binary format for storing a certificate chain and private key in a single, encryptable file. PKCS#12 files are commonly used to import and export certificates and private keys on Windows and macOS computers, and usually have the filename extensions .


1 Answers

You can do this directly:

$ openssl genpkey -out rsakey.pem -algorithm RSA -pkeyopt rsa_keygen_bits:2048

See the man page here:

https://www.openssl.org/docs/man1.1.1/man1/openssl-genpkey.html

like image 59
Matt Caswell Avatar answered Oct 01 '22 04:10

Matt Caswell