By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Using digital certificates when calling web services

P: n/a
I'm having some difficulty finding the information I need. Maybe someone can
point me in the right direction.

I need to call methods on a web service defined by one of our vendors. They
require, when I make these calls, that I identify myself with a digital
certificate. All of their coding examples are for Java, and they have no
immediate plans to support .NET folks, alas.

I've successfully added a web reference to their web service and am able to
browse all of the classes/methods in Class View. What I'm having trouble
with is finding information regarding how to identify myself with this
digital certificate they've provided me.

Here's what I have from them:

VerisignRoot.cer - (binary) root certificate for verisign-issued
certificates
SBCRootAuthority.cer - (binary) root certificate for my vendor
VgeDev.csr - (text) Certificate request I made (using Java tools,
unfortunately) to request a key from them
VgeDev.p7b - (binary) Certificate they sent back to me, which I'm supposed
to use to make all my calls to their web service.

Can I get some pointers on what exactly to do with these 4 files, and how to
make sure when I invoke a web method that I'm identifying myself?

Oh, and one final thing: is there a .NET equivalent of the Java "keytool"
utility? I had to use that to generate my certificate request because I
couldn't find anything comparable for .NET.

thanks
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you want to load the certificate from the file, look at the
X509Certificate class in .Net:
System.Securtiy.Cryptograpy.X509Certificates.X509C ertificate

You can load the cert from the file provided:

// The path to the certificate.
string Certificate = "filepath\VgeDev.p7b";

// Load the certificate into an X509Certificate object.
X509Certificate cert =
X509Certificate.CreateFromCertFile(Certificate);

once you have the cert, you can add it to the web service

if (cert != null)
{
webService.ClientCertificates.Add(cert);
}
You can also look at Microsoft's Web Service Enhancements (WSE) 2.0 for
additional information about security.

Rob Vretenar [imason inc.]

Nov 21 '05 #2

P: n/a
Rob,

Thanks for your response. I eventually figured out what my problem was: all
this stuff was originally stored in a Java keystore. When I extracted the
cert into the VgeDev.p7b file, it only extracted the public key. As a
result, I never could use it. I finally found a tool from IBM called
"KeyMan" that extracts the entire key pair and now I'm good to go.

"Rob Vretenar" <ro**********@imason.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
If you want to load the certificate from the file, look at the
X509Certificate class in .Net:
System.Securtiy.Cryptograpy.X509Certificates.X509C ertificate

You can load the cert from the file provided:

// The path to the certificate.
string Certificate = "filepath\VgeDev.p7b";

// Load the certificate into an X509Certificate object.
X509Certificate cert =
X509Certificate.CreateFromCertFile(Certificate);

once you have the cert, you can add it to the web service

if (cert != null)
{
webService.ClientCertificates.Add(cert);
}
You can also look at Microsoft's Web Service Enhancements (WSE) 2.0 for
additional information about security.

Rob Vretenar [imason inc.]

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.