Search code examples
authenticationcertificatepfxp12

Import a PFX certificate without password request each time it is used


I'm working on a project in a development environment and need to authenticate via PFX certificate to access a REST API. Later this authentication will be replaced by OAuth, so it's only temporary for development purposes.

I installed the certificate in windows and are forced during the import to set a password. Unfortunately I need to enter the password each time I access the REST API.

So I'm wondering whether it is possible to import the certificate to my windows development machine in a way, which makes it not necessary to enter the password each time when the certificate is used, because this makes the development process very cumbersome.


Solution

  • I installed the certificate in windows and are forced during the import to set a password.

    If it is forced by your GPO then I don't see a way (you will have to ask your domain admin for help). If it's not then you can do it with this commandline:

    certutil -user -csp "Microsoft Enhanced RSA and AES Cryptographic Provider" -importpfx full_path_to_your.pfx NoChain,AT_KEYEXCHANGE,NoProtect
    

    Or if you want to place it to LOCALMACHINE\My store then user the command withoud -user parameter:

    certutil -csp "Microsoft Enhanced RSA and AES Cryptographic Provider" -importpfx full_path_to_your.pfx NoChain,AT_KEYEXCHANGE,NoProtect