OpenSSL
File format
PEM (Privacy-Enhanced Mail)
Use to store
- X509 certificate (
.crt
.pem
) - Public / private key (
.key
.pem
) - Certificate signing request (
.csr
.pem
)
PKCS #12 (.p12
)
Bundle X509 full chain certificate, private key
Convert .pem
to .p12
openssl pkcs12 -export
-in <cert.{crt|pem}>
[-certfile <ca.crt>]
-inkey <private-key.pem>
-out <file.p12>
[-passout "pass:<password>"]
[-name "<name>"]
Certificate signature
Certificate content
- Owner DN
- Owner public key
- CA DN
- Certificate extensions
- CA signature (Append after signed)
// Pseudo code
// Content exclude signature
CASignature = encrypt(hash(Content), CAPrivateKey)
Verify signature
// Pseudo code
// Content exclude signature
decrypt(CASignature, CAPublicKey) == hash(Content)
Option
Option | Description |
---|---|
-noout | Prevents output encoded data |
-text | Print the data in text form |
-modulus | Print the modulus of public key |
Version
openssl version
Env
OPENSSL_CONF=<openssl.cnf>
Same as
openssl ... -config <openssl.cnf>
Show version
openssl version