About this tutorial
This tutorial explains the use of the Java Secure Socket Extension (JSSE) packages included in JDK 1.4. The complexity of using JSSE is not in the communication itself, but rather in the configuration. Before you can run your client/server software, you must create the keys needed by the encryption algorithms, and these keys must be properly loaded by your software before it can create secure sockets.
This tutorial provides cookbook-style instructions for creating and installing JSSE encryption keys in a client/server application environment. When you have completed this tutorial, you will know how to easily convert any existing client/server application to use encryption, as well as how to create a secure application from scratch.
To follow the discussion in this tutorial, you need
to know a few things about the Java language, starting with the basics of Java
programming in a client/server environment (that is, working with
classes, objects, threads, and so on). Because stream and socket
communication is central to our discussion, you need to know how
to use streams and sockets. In particular, you should know what a
stream is and what it is used for. You should know how to create a
Socket and a
ServerSocket, how to get
streams from each, and how to communicate using those streams. You
also should know how to create and compile a .java file using the
JDK or an IDE.
Two developerWorks tutorials, "Java sockets 101" and "Introduction to Java I/O," both accessible from Resources, provide useful background information.
You do not need to know anything about encryption technology to complete this tutorial. While a comprehensive overview of encryption is beyond the scope of the discussion here, you will be given the information you need to create secure client/server connections within your applications.
To run the examples in this tutorial, you need the following tools and components:
- JDK 1.4 from Sun Microsystems
- A development environment -- either an IDE or a suitable command-shell
- A computer on which you can run an Internet server
See Resources to download the JDK 1.4 and complete source files necessary for the completion of this tutorial.