Groups | Blog | Home
all groups > dotnet security > april 2007 >

dotnet security : X509 certificate with password


Filippo Bettinaglio
4/10/2007 3:10:02 PM
Hi,

I have a certificate X509 with a private key therefore is protected by
password stored in a file.

I need to read the certificate, with NET2 is a peace of cake:

X509Certificate cert = new X509Certificate(@"...path...", "password");

Done !!!!

Can someone tell me how it is possible reading the certificate with .NET1.1?
There is no possibility to specify a password, The framework is not so
developed like .NET2

Do I need to go back to APIs? If so any sample?

I am also happy to install the cert in the machine (and therefore get rid of
the password) and read it from the certificate container? If doing so, I can
stay in a pure .NET 1.1 enviroment without using iterop…..


Many thanks,
Filippo
Joe Kaplan
4/10/2007 7:49:09 PM
How important is the password protection to you? If it isn't and you can
install the cert in the machine without pwd protection on the private key,
then you should be able to use one of the constructors in that just takes
the cert file or something and it will actually find the certificate in the
store and use the matching private key (assuming correct privileges on teh
private key and such).

If you need to use the password protection, then you probably need to do
some p/invoke to the crypto api to do what .NET 2.0 is doing under the hood.

Best of luck!

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
[quoted text, click to view]

AddThis Social Bookmark Button