News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Problems connecting to cert store  
by certiguy
posted on 2003/10/31

Hi,

I have created a self signed cert with makecert.exe and installed it into my computers personal certificates.

I now try to connect to local machine "My" cert store but exception is raised. No any informatic message is given in the exception object and I'm now totally stuck.

Creating a Certificate object works if I generate it from disk file.

Can anyone give hints what to check, to be able to connect to the cert store.

best rgds

certiguy

ps thousand thanks for this unbelievable library, .NET is yet like black hell by it's security properites.

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/10/31

What type of exception are you getting? What is the message of the exception? Could you post a stacktrace of the exception (optionally with line numbers)?

Also, could you post the code you use to open the certificate store and retrieve the certificate?

Are you running your application as a normal application, or is it an ASP.NET program?

by certiguy
posted on 2003/11/03

I have installed the certificate to :

Certificates (Local Computer) - Personal - Certificates

(viewed by Console - add snap in - certificates)



I try to connect to this cert store with code:

string certStoreName = CertificateStore.MyStore;
CertificateStore store = new CertificateStore(StoreLocation.LocalMachine, certStoreName);
Certificate cert = store.FindCertificateBySubjectString("my.own.cert");

but this exception is thrown :

Org.Mentalis.Security.Certificates.CertificateException: An error occurs while opening the specified store.



thanks for any hints...


best wishes CGuy


by certiguy
posted on 2003/11/03

now the problem seems to be more clear:

I'm running that problematic code in ASP.NET application. Running the same code centences work perfectly from console application. So problem lies in the identity who executes the ASP.NET runtime. Perhaps I should configure my ASP.NET application to impersonate itself to be able to connect to the certificate store.

best regards

certiguy

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/11/03

After searching online for an answer, here's what I came up with:

1. Open Windows Explorer.
2. Navigate to the C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys folder.
3. Select the files containing the keys that the WSE will need to retrieve.
4. From the File menu, select Properties.
5. On the Security tab, add the ASPNET account and select the Full Control option.

Could you try this and tell me if this works?

by certiguy
posted on 2003/11/04

yes I tried, I set full control for the ASP.NET user for these files and folders. The exception pops up still :(

cg

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.