use public key and cipher suite from server cert to encrypt
I am a beginner with JSSE so please do share your wisdom. :-)
The segment of codes below is the starting point. I need to be able to use the public key and the cipher suite from the server certificate to encrypt something. Which APIs should I use? Code samples would be great.
Thousands Thanks in advance. :-)
SSLContext context = SSLContext.getInstance("SSL", new com.sun.net.ssl.internal.ssl.Provider());
context.init(null, null, null);
SSLSocket s = (SSLSocket)context.getSocketFactory().createSocket(HOST, PORT);
s.startHandshake();
javax.security.cert.X509Certificate [] certChain = s.getSession().getPeerCertificateChain();
........

