Click here to Skip to main content
15,920,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am developing a web service secured with digital certificates.
I have set property of web service to "require client certificates" and i tried accessing the web service from client and i am not able to access, which is correct. But even after installing certificate (.cer, file does not include only public key), I am not able to access. So i tried installing (.pfx, file with both private and public key), I am able to access.

My question is:
At client side,is it necessary to install .pfx file.
If yes, is it safe to share private key with client.

Thanks in advance.
Posted

The PFX extension is used on Windows servers for files containing both the public key files (your SSL certificate files, provided by DigiCert) and the associated private key (generated by your server at the time the CSR was generated).

Since both the public and private keys are needed for an SSL certificate to function, a PFX backup is always needed to transfer an SSL server security certificate from client to server.
 
Share this answer
 
Hi Senthil,

Thanks for the response.
Is it necessary for private key to be at client side. As per my understanding, the client only requires public key to encrypt data and server (where certificate is installed) use private key

so i use below code to pass certificate to server before calling web method where .cer contains public key

string filePath= @"C:\Certificates\test.cer";
test.Service serviceObj= new test.Service();
serviceObj.ClientCertificates.Add(X509Certificate.CreateFromCertFile(filePath));
Response.Write(serviceObj.HelloWorld());

But above code works only if .pfx file(contains private & public key) is installed in client. Is .pfx really required at client side?

Thanks.
Techie
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900