I am trying to automate the install of a certificate with the following two lines:
makecert -pe -n "CN=vc" -ss my -sr LocalMachine -a sha1 -sky -r "vc.cer"
makecert -pe -n "CN=localhost" -ss my -sr LocalMachine -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -in "vc" -is my -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 "vc.cer"
This works great and I wish I could to this by "code". The problem is that I can't be sure in my install, if the certificate is there or not. When running these lines twice only the first line is being run with success (which makes existing certificate unusable) and the second line return this:
Error: There are more than one matching certificate in the issuer's my cert store
I would like to overwrite existing certificate. Or find a way to delete the old. My knowledge on this subject is very limited. Please help me
makecert -pe -n "CN=vc" -ss my -sr LocalMachine -a sha1 -sky -r "vc.cer"
makecert -pe -n "CN=localhost" -ss my -sr LocalMachine -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -in "vc" -is my -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 "vc.cer"
This works great and I wish I could to this by "code". The problem is that I can't be sure in my install, if the certificate is there or not. When running these lines twice only the first line is being run with success (which makes existing certificate unusable) and the second line return this:
Error: There are more than one matching certificate in the issuer's my cert store
I would like to overwrite existing certificate. Or find a way to delete the old. My knowledge on this subject is very limited. Please help me