Re: Password for certificate
- From: "Joe Kaplan" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 1 Oct 2009 21:17:32 -0500
Do you have a p12 or pfx file that contains the certificate and private key instead?
What I'm guessing is happening is that you supply the .cer file and .NET uses that to locate the matching certificate installed in the local store and then tries to access the private key in the local store to do the client auth but it does not use the password you supplied to access the key because that particular constructor is designed to use a stand alone p12 file and use the password to open it.
Just a guess...
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
"kejster" <kejster@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:329232C8-3E99-4FF7-B607-A5E9B9536118@xxxxxxxxxxxxxxxx
I'm trying to talk to a webservice that requires a certificate. I have
generated a .CER file using certmgr.
My code looks like this:
ServicePointManager.ServerCertificateValidationCallback = New
RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)
certFile = ConfigurationManager.AppSettings.Get("CertificateFile")
password = ConfigurationManager.AppSettings.Get("CertPassword")
certificate = New X509Certificate2(certFile, password)
service.ClientCertificates.Add(certificate)
resultString = service.DoSomething()
However, when my code reaches the line where I actually call the webservice,
I am prompted with a dialog that asks me to enter my password (same as if I'd
used the certificate to log into homebanking etc.).
I would like my application to run in the background, without requiring the
user to enter the password every time the webservice is called.
Any suggestions?
.
- Follow-Ups:
- Re: Password for certificate
- From: kejster
- Re: Password for certificate
- From: kejster
- Re: Password for certificate
- References:
- Password for certificate
- From: kejster
- Password for certificate
- Prev by Date: Password for certificate
- Next by Date: Re: Password for certificate
- Previous by thread: Password for certificate
- Next by thread: Re: Password for certificate
- Index(es):
Relevant Pages
|