|
|
От: | tapatoon | |
| Дата: | 25.02.09 10:40 | ||
| Оценка: | |||
hUrl = InternetOpenUrl(hInet, url, NULL, 0, INTERNET_FLAG_SECURE
| INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_IGNORE_CERT_CN_INVALID, 0);Internet Explorer 5.5 has a new option that allows you to select client certificate programmatically, INTERNET_OPTION_CLIENT_CERT_CONTEXT. When you use this option with InternetSetOption, (LPVOID) lpBuffer parameter should point to CERT_CONTEXT structure.
You can obtain CERT_CONTEXT structure by using Win32 Crypto APIs, such as CertEnumCertificatesInStore() or CertFindCertificateInStore().
ServicePointManager.ServerCertificateValidationCallback =
new RemoteCertificateValidationCallback(rcvc);
WebClient wc = new WebClient();
byte[] data = wc.DownloadData("https://...");