The SecureAS400 class enables you to use an AS400 object when sending or receiving encrypted data. When an AS400 object communicates with the server, user data (except the user password) is sent unencrypted to the server. So, IBM® Toolbox for Java™ objects associated with an AS400 object exchange data with the server over a normal connection.
When you want to use IBM Toolbox for Java to exchange sensitive data with the server, you can encrypt data by using Secure Sockets Layer (SSL). Use the SecureAS400 object to designate which data you want to encrypt. IBM Toolbox for Java objects associated with a SecureAS400 object exchange data with the server over a secure connection.
For more information, see Secure Sockets Layer and Java Secure Socket Extension.
The SecureAS400 class is a subclass of the AS400 class.
The following example shows you how to use CommandCall to send commands to the server using a secure connection:
// Create a secure AS400 object. This is the only statement that changes
// from the non-SSL case.
SecureAS400 sys = new SecureAS400("mySystem.myCompany.com");
// Create a command call object
CommandCall cmd = new CommandCall(sys, "myCommand");
// Run the commands. A secure connection is made when the
// command is run. All the information that passes between the
// client and server is encrypted.
cmd.run();