0

I am trying to make SSL communication between client/server.

So far I have created java.security.cert.X509Certificate from a keystore. What should I do next in order to make this communication successful. Any example will be helpful.

Muhammad Imran Tariq
  • 22,654
  • 47
  • 125
  • 190

2 Answers2

2

So far I have created java.security.cert.X509Certificate

You don't need that.

Follow all the instructions in the JSSE Reference Guide.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • But one of my senior told that I will use this certificate for communication. Also I am not finding any help from your link. Can you please point to one example? – Muhammad Imran Tariq May 31 '12 at 09:07
  • @imran You need a private key and a *certificate.* What you don't need is a `java.security.cert.X509Certificate`: that's an object in a running Java program, produced by loading from a certificate file or a keystore. JSSE does all that for you. I can't imagine why you didn't find the official reference guide helpful, and the code examples that it provides. – user207421 May 31 '12 at 12:08
  • Yes. As I was unaware of what I should do. If you mention this early then it was good as I spent a lot of time on coming to a point. – Muhammad Imran Tariq May 31 '12 at 12:11
  • @imrantariq I cannot see the point of this comment. You seem to be just shooting the messenger and blaming me for your own time management issues. – user207421 May 31 '12 at 19:39
0

This answer solves my problem. https://stackoverflow.com/a/859271/420613 Also see this code.

Community
  • 1
  • 1
Muhammad Imran Tariq
  • 22,654
  • 47
  • 125
  • 190