1
Vote

Issue with X509Store

description

I installed DinnerNow but could not build by Build DinnerNow.bat file. Hence started manually building the application as a ASP.Net application. I encountered some problems but finally compiled and it is displaying all controls now. I did registration by provinding details manual. After that I wanted to play with CardSpace, hence this time I tried registering the other way and hit a major road block.
Control flows smoothly till TockenProcessor::FindCertificate() method line number 599. But after that when the code tries the following
X509Store store = new X509Store(storeName, storeLocation);
            store.Open(OpenFlags.ReadOnly);
 
it seems to be working but actually not which I realized after going to the point TockenProcessor::decryptToken() line number 533 where it is calling TockenProcessor::FindCertificate() . After debugging, I found that when the code store.Open(OpenFlags.ReadOnly); executes, internally there was an exception "certificate.PrivateKey threw an exception". I actually created the self-signed-certificate (on Windows server 2008) which was showing OK in IIS.
 
Can anybody help me how to solve this issue?

comments

Aravind_C wrote Jul 5, 2009 at 8:54 AM

Finally problem is resolved.
What I did is: Open Certificates MMC (for Local Computer, but not for user) -> Select certificate -> right click -> Manage Private Keys -> granted access to NETWORKSERVICE

Then application started working properly.

wrote Feb 14, 2013 at 6:35 PM