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