LinuxCommandLibrary

pkcs12.1s

TLDR

Create PKCS#12 file

$ openssl pkcs12 -export -out [cert.p12] -inkey [key.pem] -in [cert.pem]
copy
Extract certificate
$ openssl pkcs12 -in [cert.p12] -clcerts -nokeys -out [cert.pem]
copy
Extract private key
$ openssl pkcs12 -in [cert.p12] -nocerts -out [key.pem]
copy
View PKCS#12 info
$ openssl pkcs12 -in [cert.p12] -info -noout
copy

SYNOPSIS

openssl pkcs12 [options]

DESCRIPTION

openssl pkcs12 manages PKCS#12 files. Certificate bundle format.
The tool creates and extracts .p12/.pfx files. Certificate with key.
openssl pkcs12 handles bundles.

PARAMETERS

-export

Create PKCS#12 file.
-in FILE
Input file.
-out FILE
Output file.
-inkey FILE
Private key.
-clcerts
Output client certs only.
-nocerts
No certificates.
-nokeys
No private keys.

CAVEATS

Part of OpenSSL. Password protected. Cross-platform format.

HISTORY

PKCS#12 support in OpenSSL enables certificate bundle operations.

SEE ALSO

Copied to clipboard