square / certstrap

Tools to bootstrap CAs, certificate requests, and signed certificates.
Apache License 2.0
2.31k stars 207 forks source link

add export-pfx command #215

Open wangtiga opened 1 year ago

wangtiga commented 1 year ago

add export-pfx command, reference by https://github.com/square/certstrap/pull/54

PKCS Format:

If you'd like to convert your certificate and key to PKCS12 format,

$ ./certstrap export-pfx Alice --chain "CertAuth"
Created out/Alice.pfx from out/Alice.crt and out/Alice.key with chain [out/CertAuth.crt]

Alice.key and Alice.crt make up the leaf private key and certificate pair of your choosing (generated by a sign command), with CertAuth.crt being the certificate authority certificate that was used to sign it. The output PKCS12 file is Alice.pfx

or simply run openssl:

$ openssl pkcs12 -export -out out/Alice.pfx -inkey out/Alice.key -in out/Alice.crt -certfile out/CertAuth.crt
CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.