com.ibm.as400.access
Class SecureAS400

java.lang.Object
  |
  +--com.ibm.as400.access.AS400
        |
        +--com.ibm.as400.access.SecureAS400

public class SecureAS400
extends AS400

The SecureAS400 class represents a secure AS/400 sign-on. Secure Sockets Layer (SSL) connections are used to provide encrypted communications. This function requires an SSL capable server at OS/400 release V4R4 or later.

See Also:
Serialized Form

Field Summary
static int CLIENT_TO_PROXY_SERVER
          Constant indicating that encryption should only be done on the connection between the client and the proxy server.
static int CLINT_TO_SERVER
          Constant indicating that encryption should be done in both the connection between the client and the proxy server and the connection between the proxy server and the server.
static int PROXY_SERVER_TO_SERVER
          Constant indicating that encryption should only be done on the connection between the proxy server and the server.
 
Fields inherited from class com.ibm.as400.access.AS400
CENTRAL, COMMAND, DATABASE, DATAQUEUE, FILE, PRINT, RECORDACCESS, SIGNON, USE_PORT_MAPPER
 
Constructor Summary
SecureAS400()
          Constructs a SecureAS400 object.
SecureAS400(AS400 system)
          Constructs a SecureAS400 object.
SecureAS400(java.lang.String systemName)
          Constructs a SecureAS400 object.
SecureAS400(java.lang.String systemName, java.lang.String userId)
          Constructs a SecureAS400 object.
SecureAS400(java.lang.String systemName, java.lang.String userId, java.lang.String password)
          Constructs a SecureAS400 object.
SecureAS400(java.lang.String systemName, java.lang.String userId, java.lang.String password, java.lang.String proxyServer)
          Constructs a SecureAS400 object.
 
Method Summary
static void addPasswordCacheEntry(java.lang.String systemName, java.lang.String userId, java.lang.String password)
          Validates the user ID and password against the system, and if successful, adds the information to the password cache.
static void addPasswordCacheEntry(java.lang.String systemName, java.lang.String userId, java.lang.String password, java.lang.String proxyServer)
          Validates the user ID and password against the system, and if successful, adds the information to the password cache.
 java.lang.String getKeyRingName()
          Returns the key ring class name used for SSL communications with the servers.
 int getProxyEncryptionMode()
          Returns the proxy encryption mode.
 void setKeyRingName(java.lang.String keyRingName)
          Sets the key ring class name used for SSL communications with the servers.
 void setKeyRingName(java.lang.String keyRingName, java.lang.String keyRingPassword)
          Sets the key ring class name used for SSL communications with the servers.
 void setKeyRingPassword(java.lang.String keyRingPassword)
          Sets the key ring password used for SSL communications with the servers.
 void setProxyEncryptionMode(int proxyEncryptionMode)
          Sets the proxy encryption mode.
 
Methods inherited from class com.ibm.as400.access.AS400
addConnectionListener, addPropertyChangeListener, addVetoableChangeListener, arePropertiesFrozen, authenticate, changePassword, clearPasswordCache, clearPasswordCache, connectService, disconnectAllServices, disconnectService, generateVRM, getCcsid, getDefaultUser, getJobCCSIDEncoding, getModification, getPasswordExpirationDate, getPasswordExpirationWarningDays, getPreviousSignonDate, getProfileToken, getProfileToken, getProfileToken, getProfileToken, getProxyServer, getRelease, getServicePort, getSignonDate, getSystemName, getUserId, getVersion, getVRM, initializeConverter, isConnected, isConnected, isGuiAvailable, isLocal, isMustUseSockets, isShowCheckboxes, isThreadUsed, isUseDefaultUser, isUsePasswordCache, removeConnectionListener, removeDefaultUser, removePasswordCacheEntry, removePropertyChangeListener, removeVetoableChangeListener, resetAllServices, setCcsid, setDefaultUser, setGuiAvailable, setMustUseSockets, setPassword, setPasswordExpirationWarningDays, setProxyServer, setServicePort, setServicePortsToDefault, setShowCheckboxes, setSystemName, setThreadUsed, setUseDefaultUser, setUsePasswordCache, setUserId, toString, validateSignon, validateSignon, validateSignon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLIENT_TO_PROXY_SERVER

public static final int CLIENT_TO_PROXY_SERVER
Constant indicating that encryption should only be done on the connection between the client and the proxy server.

PROXY_SERVER_TO_SERVER

public static final int PROXY_SERVER_TO_SERVER
Constant indicating that encryption should only be done on the connection between the proxy server and the server.

CLINT_TO_SERVER

public static final int CLINT_TO_SERVER
Constant indicating that encryption should be done in both the connection between the client and the proxy server and the connection between the proxy server and the server.
Constructor Detail

SecureAS400

public SecureAS400()
Constructs a SecureAS400 object.

SecureAS400

public SecureAS400(java.lang.String systemName)
Constructs a SecureAS400 object. It uses the specified system name.
Parameters:
systemName - The name of the AS/400.

SecureAS400

public SecureAS400(java.lang.String systemName,
                   java.lang.String userId)
Constructs a SecureAS400 object. It uses the specified system name and user ID. When the sign-on prompt is displayed, the user is able to specify the password. Note that the user ID may be overridden.
Parameters:
systemName - The name of the AS/400.
userId - The user ID to use to connect to the system.

SecureAS400

public SecureAS400(java.lang.String systemName,
                   java.lang.String userId,
                   java.lang.String password)
Constructs a SecureAS400 object. It uses the specified system name, user ID, and password. No sign-on prompt is displayed unless the sign-on fails.
Parameters:
systemName - The name of the AS/400.
userId - The user ID to use to connect to the system.
password - The password to use to connect to the system.

SecureAS400

public SecureAS400(java.lang.String systemName,
                   java.lang.String userId,
                   java.lang.String password,
                   java.lang.String proxyServer)
Constructs a SecureAS400 object. It uses the specified system, user ID, and password. No sign-on prompt is displayed unless the sign-on fails.
Parameters:
systemName - The name of the AS/400.
userId - The user ID to use to connect to the system.
password - The password to use to connect to the system.
proxyServer - The name and port in the format serverName[:port]. If no port is specified, a default will be used.

SecureAS400

public SecureAS400(AS400 system)
Constructs a SecureAS400 object. It uses the same system name and user ID. This does not create a clone. The new SecureAS400 object has the same behavior, but results in a new set of socket connections.
Parameters:
system - A previously instantiated AS400 or SecureAS400 object.
Method Detail

addPasswordCacheEntry

public static void addPasswordCacheEntry(java.lang.String systemName,
                                         java.lang.String userId,
                                         java.lang.String password)
                                  throws AS400SecurityException,
                                         java.io.IOException
Validates the user ID and password against the system, and if successful, adds the information to the password cache.
Parameters:
systemName - The system name for the AS/400.
userId - The user ID.
password - The password.
Throws:
AS400SecurityException - If a security or authority error occurs.
java.io.IOException - If an error occurs while communicating with the AS/400.
java.net.UnknownHostException - If the AS/400 system cannot be located.

addPasswordCacheEntry

public static void addPasswordCacheEntry(java.lang.String systemName,
                                         java.lang.String userId,
                                         java.lang.String password,
                                         java.lang.String proxyServer)
                                  throws AS400SecurityException,
                                         java.io.IOException
Validates the user ID and password against the system, and if successful, adds the information to the password cache.
Parameters:
systemName - The system name for the AS/400.
userId - The user ID.
password - The password.
proxyServer - The name and port in the format serverName[:port]. If no port is specified, a default will be used.
Throws:
AS400SecurityException - If a security or authority error occurs.
java.io.IOException - If an error occurs while communicating with the AS/400.
java.net.UnknownHostException - If the AS/400 system cannot be located.

getKeyRingName

public java.lang.String getKeyRingName()
Returns the key ring class name used for SSL communications with the servers. The class com.ibm.as400.access.KeyRing is the default and will be returned if not overridden.
Returns:
The key ring class name.

getProxyEncryptionMode

public int getProxyEncryptionMode()
Returns the proxy encryption mode. The proxy encryption mode specifies which portions of the communications between the client, proxy server, and server are encrypted.
Returns:
The proxy encryption mode.

setKeyRingName

public void setKeyRingName(java.lang.String keyRingName)
                    throws java.beans.PropertyVetoException
Sets the key ring class name used for SSL communications with the servers. The default class name that will be used if this method is not called is com.ibm.as400.access.KeyRing.
Parameters:
keyRingName - The key ring class name.
Throws:
java.beans.PropertyVetoException - If any of the registered listeners vetos the property change.

setKeyRingName

public void setKeyRingName(java.lang.String keyRingName,
                           java.lang.String keyRingPassword)
                    throws java.beans.PropertyVetoException
Sets the key ring class name used for SSL communications with the servers. The default class name that will be used if this method is not called is com.ibm.as400.access.KeyRing.
Parameters:
keyRingName - The key ring class name.
keyRingPassword - The password for the key ring class.
Throws:
java.beans.PropertyVetoException - If any of the registered listeners vetos the property change.

setKeyRingPassword

public void setKeyRingPassword(java.lang.String keyRingPassword)
Sets the key ring password used for SSL communications with the servers.
Parameters:
keyRingPassword - The password for the key ring class.

setProxyEncryptionMode

public void setProxyEncryptionMode(int proxyEncryptionMode)
                            throws java.beans.PropertyVetoException
Sets the proxy encryption mode. The proxy encryption mode specifies which portions of the communications between the client, proxy server, and server are encrypted. The default is to encrypt all communications. This value is ignored if a proxy server is not used.
Valid proxy encryption modes are:
CLIENT_TO_PROXY_SERVER - encrypt between client and proxy server.
PROXY_SERVER_TO_SERVER - encrypt between proxy server and server.
CLINT_TO_SERVER - encrypt both portions of connection.
Parameters:
proxyEncryptionMode - The proxy encryption mode.
Throws:
java.beans.PropertyVetoException - If any of the registered listeners vetos the property change.