I want to download pfx from my asp.net server, add the pfx to client's
X509Store as
a trusted publisher, Is it possible? my func in aspx is like this:
void InstallCertific ation()
{
try{
WebClient web = new WebClient();
string url = "http:/myaspserver/mydir/mykey_2008.pfx" ;
byte [] b = web.DownloadDat a(url);
X509Certificate 2 cert = new X509Certificate 2(b, "password") ;
X509Store store = new X509Store(Store Name.AuthRoot,
StoreLocation.L ocalMachine);
store.Open(Open Flags.ReadWrite );
store.Add(cert) ;
store.Close();
store = new X509Store(Store Name.TrustedPub lisher,
StoreLocation.L ocalMachine);
store.Open(Open Flags.ReadWrite );
store.Add(cert) ;
store.Close();
msg.Text = "Certificat ion installed";
}
catch(Exception e)
{
//MessageBox( e.ToString());
msg.Text = e.ToString();
}
but the page will load pretty much longer time and show the error of
System.net.webe xception that unable to connect to remote server
(Actually myaspserver is working, the aspx and the pfx url is correct).
Best Regards
Steven
--
=============== ========
Steven Tang
SYWWUYU)
**:)
Comment