PFX Tool is a command line tool that does stuff with and around PFX certificates.
PFX Tool is a .NET Core Global Tool that is built to run against the .NET Core 2.2 runtime. To install:
dotnet tool install pfxtool -g
The basic usage is as follows:
pfxtool <command> <options>
The following commands are currently supported:
- import: Import certificates and keys from a PFX file to a certificate store.
- export: Export certificates and keys from a certificate store to a PFX file.
- remove: Remove an existing certificate and keys from a certificate store.
- list: List all certificates in a certificate store or in a PFX file.
- show: Show details of a certificate in a certificate store or in a PFX file.
The following commands are not currently supported but are planned:
- create: Create a PFX out of given certificate and key files (a-la openssl).
- explode: Explode a PFX into its constituent certificate and key files.
For details, run
pfxtool without any options to get usage instructions.
Import test.pfx (protected with password Test123) into the current user's personal store.
pfxtool import --file test.pfx --password Test123 --scope user --store my
Export certificate and key with thumbprint ABCDEF from the machine's root certificate store into a file test.pfx, protecting the private key with password Test123.
pfxtool export --file test.pfx --password Test123 --scope machine --store root
To submit any issues, use the Issues section in this repository.
Feel free to fork and send PRs - this is pretty small and I haven't had a chance to set up guidelines.