Here are the steps of installing an X509 certificate in windows:
Installation Steps for DEVAssumptions:
- The Microsoft Windows SDK exists on the machine
- The certificate name is SomeName
- Go to Start > All Programs > Microsoft Windows SDK > CMD Shell
- Execute the following command: makecert -r -pe -n “CN=SomeName” -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr LocalMachine -sky exchange -sp “Microsoft RSA SChannel Cryptographic Provider” -sy 12
- Copy the executable findprivatekey.exe to an arbitrary folder
- Go to Start > Run type cmd
- Browse to the folder where the findprivatekey.exe was copied
- Execute the following command: findprivatekey.exe My LocalMachine -n “CN=SomeName” -a
- Copy the output of that command in Notepad
- Remove all line breaks if you see any
- Replace the {output from above} by the text from step 8 and execute the following command: cacls “{output from above}” /E /P NETWORKSERVICE:R Example: cacls “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys\9e7f481ca4127144bc75102dabb32ad0_c18e0de9-0e80-4436-920c-4ab1cae7939a” /E /P NETWORKSERVICE:R
- You’re done!
Installation Steps for QA/ProdAssumptions:
- The Microsoft Windows SDK exists on the machine
- The certificate name is SomeName and is present in the local machine maybe with a different file name
- Go to Start > Run
- Type mmc
- Click on File > Add/Remove Snap-in…
- Click the Add
- Click on Certificates
- Select Computer Account
- Click Finish
- Click Close to finish adding the Snap-in
- Click Ok
- Under Console Root, expand Certificates (Local Computer)
- Expand Personal
- Click Certificates
- Right click and click on All Tasks > Import
- Click Next
- Click Browse, locate the exported certificate (use *.*) and then double click on it
- Click Next
- Type the password and then click Next
- Select Place all certificates in the following store
- If Personal isn’t showing in the box under, then click Browse, select Personal and click OK
- Click Next
- Click Finish
- Click OK
- Copy the executable findprivatekey.exe to c:\
- Go to Start > Run type cmd
- Go to the C:\ prompt
- Execute the following command: findprivatekey.exe My LocalMachine -n “CN=SomeName” -a
- Copy the output of that command in Notepad
- Remove all line breaks if you see any
- Replace the {output from above} by the text from step 29 and execute the following command: cacls “{output from above}” /E /P NETWORKSERVICE:R Example: cacls “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys\9e7f481ca4127144bc75102dabb32ad0_c18e0de9-0e80-4436-920c-4ab1cae7939a” /E /P NETWORKSERVICE:R
- You’re done!
The findprivatekey.exe is available here (rename .gif to .exe)
Posted in Windows | No Comments »