473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HttpWebRequest encapsulate client certificate

Problem....

I need some help, i got an implementation manual wich uses asp (not
..net) code as example. In this example the object 'WinHttp' is
initiated. Now this is an com object and since i'm working in c# i
would like to use managed code. So i figured that i should use the
'HttpWebRequest'. All fine but the WinHttp has got an option to set and
ClientCertificate.

Is there a way a can set an ClientCertificate with HttpWebRequest?
Are there any other options in managed code?

Nov 19 '05 #1
1 1615
/// <summary>Adds client certificate from a cert file to a http web
request.</summary>
/// <param name="req">Http web request.</param>
/// <param name="fileName">Certificate file name.</param>
public static void AddCertificateFromCertFile (HttpWebRequest req, string
fileName)
{
System.Security.Cryptography.X509Certificates.X509 CertificateCollection
certColl = req.ClientCertificates;
System.Security.Cryptography.X509Certificates.X509 Certificate cert =

System.Security.Cryptography.X509Certificates.X509 Certificate.CreateFromCert
File (fileName);
req.ClientCertificates.Add (cert);
}

Eliyahu

"Frank" <fr***@hubhop.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Problem....

I need some help, i got an implementation manual wich uses asp (not
.net) code as example. In this example the object 'WinHttp' is
initiated. Now this is an com object and since i'm working in c# i
would like to use managed code. So i figured that i should use the
'HttpWebRequest'. All fine but the WinHttp has got an option to set and
ClientCertificate.

Is there a way a can set an ClientCertificate with HttpWebRequest?
Are there any other options in managed code?

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: EMonaco | last post by:
Is there any way to programmatically select a particular client certificate and associate it with an HttpWebRequest instance? I know using WinINet this was possible. Erin.
1
by: Marvin | last post by:
my asp.net app is posting to another webpage using httpwebRequest & x509Certificates and in return the certificate's name used for the posting is sent back. But instead of getting information about...
1
by: Deepak | last post by:
We retrieve data from a company called XYZ through httpwebrequest. The program is coded using VB.NET They have given a certificate to install. This certificate is included with the request...
2
by: steveS | last post by:
Hi all, I'm having trouble connecting to a Java web service using HttpWebRequest. I get the error message "The request was aborted: Could not create SSL/TLS secure channel". The Java service...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.