https://github.com/pa-0/importpfx
PKCS12 (PFX) Certificate Import Utility -- written by Joe Klemencic
https://github.com/pa-0/importpfx
certificates cryptography import pfx pkcs12 portable standalone win32
Last synced: over 1 year ago
JSON representation
PKCS12 (PFX) Certificate Import Utility -- written by Joe Klemencic
- Host: GitHub
- URL: https://github.com/pa-0/importpfx
- Owner: pa-0
- License: mit
- Created: 2024-10-15T23:36:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-16T00:35:51.000Z (over 1 year ago)
- Last Synced: 2025-02-02T18:52:46.265Z (over 1 year ago)
- Topics: certificates, cryptography, import, pfx, pkcs12, portable, standalone, win32
- Language: C++
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `IMPORTPFX` v1.0 by Joe Klemencic
Simple standalone utility for importing `PKCS12` (`.pfx`) certificates into the certificate store and (optionally) overwriting any existing certificate from the same issuer.
### OVERVIEW
This utility will import a `PKCS12` certificate file (with a **`.p12`** or **`.pfx`** extension) into the certificate store specified by the `-s` parameter.
The default behavior is to overwrite a like certificates (if present in the same store). The `-r "Subject OU"` will remove all certificates in the target store matching the Subject CN
in the `PKCS12` file and the Subject OU set to the `-r` parameter.
### USAGE:
```bat
importpfx.exe -f FILENAME.PFX -p PASSWORD -t USER|MACHINE -s CERTSTORE [-r "Subject OU to remove" | -all]
```
### PARAMETERS:
flag | description
--|--
`-f` | PKCS12 filename
`-p` | Password to secure the private key with
`-t` | Store type (USER or MACHINE)
`-s` | The certificate store to import into (MY is a common param)
`-r "Subject OU Text"` | Deletes all certs with _Subject OU_ matching `"Subject OU Text"` & _Subject CN_ matching `PKCS12` Subject CN
`-r -all` | Delete ALL user certificates in the
### EXAMPLES:
1. #### IMPORT a PFX/PKCS12 file into the MY store, overwriting if allowed:
```bat
importpfx.exe -f x509.p12 -p "password" -t USER -s MY
```
2. #### IMPORT a PFX/PKCS12 file into the local machine Testing store and delete any stored certificates with a Subject containing `OU="Self-Signed CA"`:
```bat
importpfx.exe -f x509.p12 -p "" -t MACHINE -s Testing -r "Self-Signed CA"
```
3. #### Delete ALL certificates in the USER MY store:
```bat
importpfx.exe -t USER -s MY -r -all
```