(Additionally)
(MAC is not related to PKI (?))
X.509
v3 certificates.ASN.1
and usually serialized as PEM-encoded DER.PKCS#8
objects, also serialized as PEM-encoded DER.PKCS#7
and PKCS#12
envelope formats.PKCS#1
PKCS#7
PKCS#8
PKCS#8
private key may be encrypted with a passphrase using the PKCS#5
PKCS#12
.p12
.pfx
X.509
ASN.1
BER
(Basic Encoding Rules)DER
(Distinguished Encoding Rules)
DER
JER
(JSON Encoding Rules)XER
(XML Encoding Rules)(encodings, also used as extensions)
.der
.crt
or .cer
.pem
(common extensions)
.crt
.cer
.key
PKCS#8
keys.-Djavax.net.ssl.keyStore
-Djavax.net.ssl.trustStore
openssl x509 -in certificate.pem -text
openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:4096
or
openssl genrsa -out key.pem 4096
openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:4096 -aes128
openssl genpkey -algorithm RSA -out key.pem -pkeyopt rsa_keygen_bits:4096 -aes192
openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -out certificate.pem
-nodes
: apply no encryption to the private keyopenssl req -key key.pem -x509 -days 365 -out certificate.pem
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
openssl x509 -in cert.crt -outform der -out cert.der
openssl x509 -in cert.crt -inform der -outform pem -out cert.pem