Simple standalone utility for importing PKCS12
(.pfx
) certificates into the certificate store and (optionally) overwriting any existing certificate from the same issuer.
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.
importpfx.exe -f FILENAME.PFX -p PASSWORD -t USER|MACHINE -s CERTSTORE [-r "Subject OU to remove" | -all]
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 |
-
importpfx.exe -f x509.p12 -p "password" -t USER -s MY
-
IMPORT a PFX/PKCS12 file into the local machine Testing store and delete any stored certificates with a Subject containing
OU="Self-Signed CA"
:importpfx.exe -f x509.p12 -p "" -t MACHINE -s Testing -r "Self-Signed CA"
-
importpfx.exe -t USER -s MY -r -all