Repair certificates missing private key
Every now and then I receive a renewed certificate without ever creating a certificate signing request for it. In this case the previous certificate signing request was used. This means the renewed certificate belongs to the private key of the earlier request. When you try to complete the certificate and make a key pair you’re most likely missing the private key on your computer. By the time you’re aware of this you import the older key pair to make sure you have the private key for the new certificate. Unfortunately Windows doesn’t bind the private key automatically to the already existing certificate.
In order to fix this you need to “repair” the certificate by finding the private key and binding it to the certificate. This process involves looking up the thumbprint and running the certutil command with this thumbprint. I created a powershell script to make this a little bit easier for myself.