Re: Cannot find the certificate and private key for decryption at Microsoft.Web.Services.Security.X509.X509Certificate.get_Key()

yes i did export the private key, i have opened the Certificate and saw it
also show that it has the private key.
it works fine on Application not on Web Site Same machine.
thank you

"Pablo Cibraro [MVP]" <pcibraro@xxxxxxxxxxx> wrote in message

Did you also export the private key ? (Some certificates are installed
without the "private key - export" support, so there is no way to move
them between different machines if you do not have the original pfx file).

Pablo Cibraro.

"bhu" <bhuvaneshwar@xxxxxxxxxxx> wrote in message
I am getting this Error, we have a application which is there in the
Server with Certificates,
and it is working fine done by some one else.
I am taking care of that app now, and i don;t have any info on how they
installed etc.
i am trying to put it in my machine for support etc, but cannot make it
to work.
So i have created a sample web app with the same code, but i get this
System.ComponentModel.Win32Exception: Cannot find the certificate and
private key for decryption at

The same code created on winform and it works fine.
i have done all these : permmision given to ASPNet, NetworkServices to
this dir C:\Documents and Settings\All Users\Application
To install the Certificates i used mmc Certificates and import the .pfx
Here is the snippet of the code.
X509CertificateStore certStore


X509CertificateCollection certs

X509Certificate oCert =((X509Certificate) certs[0]);


{if (!oCert.SupportsDigitalSignature || (oCert.Key == null))

{Response.Write(" fail");}




catch(Exception ee)

any ideas please post it.


Relevant Pages

  • Re: Bi-directional certificate authentication [vs. passwords]
    ... when you use your private key in a ... TLS with client certificate ensures ... The PKI model, which certificates support, is not appropriate for ... Note that SSH keys are PKI-less. ...
  • Re: Bi-directional certificate authentication [vs. passwords]
    ... "the client is using the same ... To login I'd need my PRIVATE key which means I need ... There is no real PKI in my scenario since the certificates are SELF- ... the SSH user is maintaining his own much-reduced PKI ...
  • Re: EFS multiple certificates associated with single user
    ... CertA/CertB because those keys are encrypted with previous passwords. ... > three certificates in the personal store, CertA, CertB and CertC. ... > certificates> tasks> export private key. ...
  • Re: I have installed my digital certificate,but where is my public key?
    ... If I anyone stole my private key, is the backup of private key useful? ... > I posted to you once how to secure your privacy, ... Personally I have certificates for such purposes (on-line ... stored on smart card. ...
  • Re: CertEnumCertificatesInStore() and IE
    ... Removing the certificate without the corresponding private key is NOT a ... Persons may wish to delete certificates without deleting the corresponding ... it makes sense to allow to remove a certificate without removing the private ... >> checkbox in "Export File Format" ...