O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The SSLClient Class Constructor

The SSLClient class constructor contains the details of obtaining the SSLSocketFactory reference. The SSLSocketFactory must be initialized using three arguments: the keystore to be used, the truststore to be used, and the SecureRandom class reference to use.

As was done in the SSLServer constructor, the password is created as a character array. The getInstance factory method for the KeyStore is then created using the JKS format. The KeyStore is then loaded, passing both the password and the InputStream for the keystore file to the load method. In this case, the truststore file is read from the directory in which the program is run.

A TrustManagerFactory is then created using the default encryption algorithm. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required