Last post Jan 11, 2006 03:39 PM by ubelt
Jan 11, 2006 03:39 PM|ubelt|LINK
I have the following .Net code:
Microsoft.Web.Services.Security.X509.X509Certificate certificate1 =
RSAParameters parameters1 = certificate1.Key.ExportParameters(true);
On the last line above, I get the error "Cannot find the certificate
and private key for decryption ". I'm creating the Certificate from a
file (using CreateCertFromFile) instead of using a Store. We are trying
to avoid registry changes so we are staying away from a Store.
It looks like the Private Key is not accessible when using
CreateCertFromFile. Is there anyway for me to associate the private key
to my certificate?
I saw the code below but it only works with
System.Crytography.X509Certificates and not the
Certificate c = Certificate.CreateFromCerFile(filename);
c.AssociateWithPrivateKey(pvkFileName, password, true);