Re: Accessing certificate store from ASP.NET web project
- From: Dominick Baier <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 May 2007 20:42:27 +0000 (UTC)
I wrote a little tool - this lets you choose the right cert (in you case the cert must be in the local computer/personal) store - it will then open the security dialog for the corresponding private key.
Have a look at the source code to open the right cert store...
http://www.leastprivilege.com/HowToGetToThePrivateKeyFileFromACertificate.aspx
If this does not work you have to provide us a little more info (exception etc..)
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
Hello,
I've ran into a sticky situation. I currently have a ASP.NET
web project, this project uses webservices to receive XML from various
locations. One of the locations requires a x509 certificate in order
for it to work properly. All was good until they sent us a new
certificate two weeks ago. Now using the export *.cer method I can no
longer hit there webservice. They tell me that anything thats going
wrong is on my end. After much playing around with it, I decided to
try the CryptoAPI way instead, which would be just to hit the actual
certificate store and gather all the certs in a collection and pull
the one that i need directly from it and apply it to the
httpwebrequest object. I wrote up a small C# console app, this app is
very basic its just going to the store gathering the certs then
applying the cert to a webrequest object then hitting the URL. As a
console app this works just fine. I adjusted my console app to become
a compiled DLL. I then add a reference to my VB project of that DLL.
But now I cannot grab any certificates from any store. I believe this
has to do with the fact that the console app is running under a
different user context than my vb.net web project. My question would
be how can get my ASP.NET web project to actually have access to the
certificate store? I've followed along on
http://msdn2.microsoft.com/en-us/library/aa302408.aspx
this page numerous times giving permission to the ASPNET/
NetworkService/Administrator users to that particular certificate.
but nothing will access it. Its currently residing on both my
certificates of my local user as well as the certificates of my local
computer. Is there anyway to get this to work properly? The code
that is being based off of is from the microsoft page that explains
the two ways to access the certificate. The *.cer way and the
CryptoAPI way. Any information would be greatly appreciated.
.
- Follow-Ups:
- References:
- Prev by Date: Accessing certificate store from ASP.NET web project
- Next by Date: Re: Accessing certificate store from ASP.NET web project
- Previous by thread: Accessing certificate store from ASP.NET web project
- Next by thread: Re: Accessing certificate store from ASP.NET web project
- Index(es):
Relevant Pages
|