← 返回命令列表

Linux command

pkcs12.1s 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create PKCS#12 file

openssl pkcs12 -export -out [cert.p12] -inkey [key.pem] -in [cert.pem]

Extract certificate

openssl pkcs12 -in [cert.p12] -clcerts -nokeys -out [cert.pem]

Extract private key

openssl pkcs12 -in [cert.p12] -nocerts -out [key.pem]

View PKCS#12 info

openssl pkcs12 -in [cert.p12] -info -noout

说明

openssl pkcs12 creates and parses PKCS#12 (.p12/.pfx) files, which bundle a private key with its corresponding certificate and optional CA chain into a single password-protected file. This format is widely used for transporting credentials between systems. In export mode (-export), it combines a PEM key and certificate into a PKCS#12 archive. In parse mode (default), it extracts certificates and keys from an existing archive. Filters like -clcerts, -cacerts, -nocerts, and -nokeys control which components are extracted.

参数

-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.

FAQ

What is the pkcs12.1s command used for?

openssl pkcs12 creates and parses PKCS#12 (.p12/.pfx) files, which bundle a private key with its corresponding certificate and optional CA chain into a single password-protected file. This format is widely used for transporting credentials between systems. In export mode (-export), it combines a PEM key and certificate into a PKCS#12 archive. In parse mode (default), it extracts certificates and keys from an existing archive. Filters like -clcerts, -cacerts, -nocerts, and -nokeys control which components are extracted.

How do I run a basic pkcs12.1s example?

Run `openssl pkcs12 -export -out [cert.p12] -inkey [key.pem] -in [cert.pem]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -export do in pkcs12.1s?

Create PKCS#12 file.