recreate a certificate with the same credentials with makecert

198 Views Asked by At

I have a question, I have created my own certificate with this command :

1) makecert -r -pe -n "CN=MyTest" -sky exchange -sv MyTest.pvk MyTest.cer

2) pvk2pfx -pvk MyTest.pvk -spc MyTest.cer -pfx MyTest.pfx

So I have created a simple console application for crypt an decrypt text with this certificate, all work fine... example:

1) Crypt from text "1" I get "RLSym/wwReReo3GMM27ueIcMFRWHAB1AELnFVERnYuMbjBJi0QrW+oV2ADdJQ8VoZlShun0=" 2) Decrypt from "RLSym/wwReReo3GMM27ueIcMFRWHAB1AELnFVERnYuMbjBJi0QrW+oV2ADdJQ8VoZlShun0=" I get "1".

Now I ricreate the certificate with the same command and password and use new one, when I try to Decrypt text create with The first certificate I receive an error, why? It is not possible to ricreate the certificate with the same credential and option if I lose the first one certificate? all my data saved on database is lost?

Thx.

0

There are 0 best solutions below