Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2006

Tip: Looking for answers? Try searching our database.

Install server Public.cer via code.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rudi - 19 Apr 2006 16:01 GMT
Hi Guys,

I am trying to get around the lack of support for installing the client
certificate on a .NET windows app (which uses the WSE secure Conversation
idea to talk to a server). I have read the posting before which recommends
using script files, but I would like to do it all in code and not rely on
them having to have the other .exe's also on their PC's. The code i have for
this is below

X509Certificate cert =
X509Certificate.CreateCertFromFile(@"C:\Cert\MyPublicCert.cer");
X509CertificateStore store = X509CertificateStore.CurrentUserStore(
X509CertificateStore.OtherPeople );
store.Open();
Console.WriteLine("There are {0} certs in the
store",store.Certificates.Count);
int x = store.Certificates.Add(cert);
Console.WriteLine("Added at index : {0}",x);
//Console.WriteLine("store.Certificates[{0}] =
{1}",x,store.Certificates[x].ToStringxtrue));
Console.WriteLine("Added to CurrentUserStore/OtherPeople. There are now {0}
certs in the store",store.Certificates.Count);
store.Close();

NOTE: There are all WSE classes, not the standard
System.Security.Cryptography classes.

The problem i have is that everything appears to work, e.g. it does not
throw any errors, but the item is not added, it returns the index which it
says it added it at, but if you check that index (see commented out line) it
does not exist!!

Any ideas anyone??

TIA

Ian M
Brian Smith - 25 Apr 2006 09:25 GMT
Hi Ian. I also have this problem - can you point me to the discussions
about using script code. I actually want to build the certificate
installation into a ClickOnce package...

brian

> Hi Guys,
>
[quoted text clipped - 33 lines]
>
> Ian M

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.