Connecting to existing server using java client

sir/mam,

my current situation is that i have VC++ client which connects to java server over secure socket connection using existing certificate and private key in format CA.pem and key.pem (while CA.pem contains chain of certifications and public key nad key.pem is private key for each client)..now i want to develop small client code in java which will connect to existing java server using this cryptography information.I converted this .pem format to java compatible format .DER but i dont know what next steps i need to take to get connected with server.

i am aware of java.security and java.crypto package and can hanle the functionality very well.but prior to that some seetings and imports need to be done with keystore and truststore..which i dont know..please help me to come out of this situation...tell functions that i need to implement at each step before i can start java cryptography code..

[926 byte] By [miryavera] at [2007-10-2 21:25:40]
# 1
I think http://java.sun.com/j2se/1.5.0/docs/guide/security/jsse/JSSERefGuide.html has the information you need.
ghstarka at 2007-7-14 0:37:19 > top of Java-index,Security,Cryptography...
# 2

thanks a lot man...but ithe document is confusing..my only problem is that i already have Certification authority and private key in PEM format..i want to use existing format and use it in java client code to get connected with existing server which agree on existing CA and private key...can u tell me just steps how do i get connected..low level features i can implement myself but i should get overall idea..thanks

miryavera at 2007-7-14 0:37:19 > top of Java-index,Security,Cryptography...
# 3
The first step is to get those PEM files into a java keystore.
cdelikata at 2007-7-14 0:37:20 > top of Java-index,Security,Cryptography...
# 4

thanks a lot man i did that and name the java keystore type as "jks" and provider as "SUN".and this key store file is stored in my home directory.Shall i create two key stores for each Certifaction athority.pem and private key.pem..

what will be my next step to use the keystore and start handshaking with the server.

miryavera at 2007-7-14 0:37:20 > top of Java-index,Security,Cryptography...
# 5

> thanks a lot man i did that and name the java

> keystore type as "jks" and provider as "SUN".and this

> key store file is stored in my home directory.

How exactly did you get the private key into the keystore?

I know how I wouldve done it...

> Shall i

> create two key stores for each Certifaction

> athority.pem and private key.pem..

Wait, so did you put the pem files in a keystore or not? You say

you did, but then you ask if you should put them in separate keystores...

No, do not do this. The public and private keys need to be in

the same keystore.

> what will be my next step to use the keystore and

> start handshaking with the server.

Any java-jsse tutorial should be able to explain that just fine, but if you'd

rather get your information from a less reputable source (like me) I'll

certainly oblige with some code. Lets first verify that your private

key and public key (with chain) are correctly installed in a single keystore.

It'll make it easier to debug this later if I know we've got the keystore configured

properly.

--

cdelikata at 2007-7-14 0:37:20 > top of Java-index,Security,Cryptography...
# 6

thanks a lot man..actually i am doing lot of other things also so i wont get enough time to study material..i will still try..i have put the two files in samekey store now..i will try to develop code to connect to existing server..if i could not thn most probably i may need some low level code help from you..

Message was edited by:

miryaver

miryavera at 2007-7-14 0:37:20 > top of Java-index,Security,Cryptography...