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
bhu

"Pablo Cibraro [MVP]" <pcibraro@xxxxxxxxxxx> wrote in message
news:esljDv6vGHA.4140@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

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).

Regards,
Pablo Cibraro.

"bhu" <bhuvaneshwar@xxxxxxxxxxx> wrote in message
news:eEnHDlwvGHA.1372@xxxxxxxxxxxxxxxxxxxxxxx
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
error,
System.ComponentModel.Win32Exception: Cannot find the certificate and
private key for decryption at
Microsoft.Web.Services.Security.X509.X509Certificate.get_Key()

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
Data\Microsoft\Crypto\RSA\MachineKeys.
To install the Certificates i used mmc Certificates and import the .pfx
file,
Here is the snippet of the code.
X509CertificateStore certStore
=X509CertificateStore.LocalMachineStore(X509CertificateStore.RootStore);


certStore.OpenRead();

X509CertificateCollection certs
=certStore.FindCertificateBySubjectString("NSet.net");




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

try

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

{Response.Write(" fail");}

else

{Response.Write(oCert.Key.ToString());

Response.Write(oCert.ToString());}}

catch(Exception ee)

any ideas please post it.
thanks
bhu






.



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. ...
    (sci.crypt)
  • 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 ...
    (sci.crypt)
  • 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. ...
    (microsoft.public.windowsxp.security_admin)
  • 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. ...
    (microsoft.public.security)
  • 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" ...
    (microsoft.public.platformsdk.security)