Re: using p12 Certificate - converting to x509 What am I doing wrong?
From: news.microsoft.com (mike@kearl.net)
Date: 02/11/03
- Next message: Michel Gallant (MVP): "Re: using p12 Certificate - converting to x509 What am I doing wrong?"
- Previous message: ghh: "managing untrusted code"
- In reply to: news.microsoft.com: "using p12 Certificate - converting to x509 What am I doing wrong?"
- Next in thread: Michel Gallant (MVP): "Re: using p12 Certificate - converting to x509 What am I doing wrong?"
- Reply: Michel Gallant (MVP): "Re: using p12 Certificate - converting to x509 What am I doing wrong?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "news.microsoft.com" <mike@kearl.net> Date: Mon, 10 Feb 2003 19:32:32 -0700
Well .looks like I wasted two weeks on p12 and trying to use this library
which I dont think the conversion works anyway. All I had to do was go to
the certificate manager export it to DES type. and use the built in
libraries. GRR
"news.microsoft.com" <mike@kearl.net> wrote in message
news:eEMQyLA0CHA.2288@TK2MSFTNGP09...
> I am trying to use a p12 certificate to access a secure site. I am using
> the library found at http://mentalis.org/soft/projects/certificates/
>
> I am loading in the certificate then converting it to a x509 cert. I am
> getting an error saying that a trusted relationship could not be
> established. What am I missing? is there something I have to do in order
> to acknowledge the certificate once I make the Web Request?? Any help or
> ideas would be greatly appreciated.
>
> this is my sourccode that I am using......
>
>
> this.req =
>
(HttpWebRequest)WebRequest.Create("https://test.transunionnetaccess.com:3018
> ?ping");
> try
> {
> //Loads the p12 certificate from the file
> Org.Mentalis.Security.Certificates.Certificate cert=
> Org.Mentalis.Security.Certificates.Certificate.CreateFromPfxFile(@"C:\TUNA
> Test Client Cert.p12","password");
> //Converts the p12 certificate to an x509 certificate.
>
> X509Certificate cert2 = cert.ToX509();
> WebClient c = new WebClient();
> this.req.ClientCertificates.Add(cert2);
> WebResponse result = req.GetResponse();
>
>
> Stream strm = result.GetResponseStream();
> byte[] buffer = new byte[1024];
> int len = 0;
> do
> {
> try
> {
> len = strm.Read(buffer, 0, 1024);
> this.textBox1.Text += System.Text.Encoding.ASCII.GetString(buffer, 0,
> len); }
> catch {}
> }
> while(len > 0); strm.Close();
> }
> catch (System.Exception ex)
> {
> Console.WriteLine(ex);
> }
>
>
>
- Next message: Michel Gallant (MVP): "Re: using p12 Certificate - converting to x509 What am I doing wrong?"
- Previous message: ghh: "managing untrusted code"
- In reply to: news.microsoft.com: "using p12 Certificate - converting to x509 What am I doing wrong?"
- Next in thread: Michel Gallant (MVP): "Re: using p12 Certificate - converting to x509 What am I doing wrong?"
- Reply: Michel Gallant (MVP): "Re: using p12 Certificate - converting to x509 What am I doing wrong?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|