com.ibm.as400.access
Class SecureAS400

java.lang.Object
  extended by com.ibm.as400.access.AS400
      extended by com.ibm.as400.access.SecureAS400
All Implemented Interfaces:
Serializable

public class SecureAS400
extends AS400

Represents a secure system sign-on. Secure Sockets Layer (SSL) connections are used to provide encrypted communications. This function requires an SSL capable system at release V4R4 or later.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
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 CLIENT_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 system.
static int CLINT_TO_SERVER
          Deprecated. Use CLIENT_TO_SERVER instead.
static int PROXY_SERVER_TO_SERVER
          Constant indicating that encryption should only be done on the connection between the proxy server and the system.
 
Fields inherited from class com.ibm.as400.access.AS400
AUTHENTICATION_SCHEME_GSS_TOKEN, AUTHENTICATION_SCHEME_IDENTITY_TOKEN, AUTHENTICATION_SCHEME_PASSWORD, AUTHENTICATION_SCHEME_PROFILE_TOKEN, CENTRAL, COMMAND, DATABASE, DATAQUEUE, FILE, GSS_OPTION_FALLBACK, GSS_OPTION_MANDATORY, GSS_OPTION_NONE, PRINT, RECORDACCESS, SIGNON, USE_PORT_MAPPER
 
Constructor Summary
Constructor and Description
SecureAS400()
          Constructs a SecureAS400 object.
SecureAS400(AS400 system)
          Constructs a SecureAS400 object.
SecureAS400(String systemName)
          Constructs a SecureAS400 object.
SecureAS400(String systemName, ProfileTokenCredential profileToken)
          Constructs a SecureAS400 object.
SecureAS400(String systemName, String userId)
          Constructs a SecureAS400 object.
SecureAS400(String systemName, String userId, String password)
          Constructs a SecureAS400 object.
SecureAS400(String systemName, String userId, String password, String proxyServer)
          Constructs a SecureAS400 object.
 
Method Summary
Modifier and Type Method and Description
static void addPasswordCacheEntry(String systemName, String userId, String password)
          Validates the user ID and password against the system, and if successful, adds the information to the password cache.
static void addPasswordCacheEntry(String systemName, String userId, String password, String proxyServer)
          Validates the user ID and password against the system, and if successful, adds the information to the password cache.
 String getKeyRingName()
          Returns the key ring class name used for SSL communications with the system.
 int getProxyEncryptionMode()
          Returns the proxy encryption mode.
 void setKeyRingName(String keyRingName)
          Sets the key ring class name used for SSL communications with the system.
 void setKeyRingName(String keyRingName, String keyRingPassword)
          Sets the key ring class name used for SSL communications with the system.
 void setKeyRingPassword(String keyRingPassword)
          Sets the key ring password used for SSL communications with the system.
 void setProxyEncryptionMode(int proxyEncryptionMode)
          Sets the proxy encryption mode.
 
Methods inherited from class com.ibm.as400.access.AS400
addConnectionListener, addPropertyChangeListener, addVetoableChangeListener, arePropertiesFrozen, authenticate, canUseNativeOptimizations, changePassword, clearPasswordCache, clearPasswordCache, connectService, disconnectAllServices, disconnectService, generateProfileToken, generateVRM, getAuthenticationScheme, getCcsid, getDDMRDB, getDefaultSignonHandler, getDefaultUser, getGSSName, getGSSOption, getJobCCSIDEncoding, getJobs, getLocale, getModification, getNLV, getPasswordExpirationDate, getPasswordExpirationWarningDays, getPreviousSignonDate, getProfileToken, getProfileToken, getProfileToken, getProfileToken, getProxyServer, getRelease, getServicePort, getSignonDate, getSignonHandler, getSocketProperties, getSystemName, getUserId, getVersion, getVRM, initializeConverter, isConnected, isConnected, isConnectionAlive, isConnectionAlive, isGuiAvailable, isLocal, isMustAddLanguageLibrary, isMustUseNetSockets, isMustUseSockets, isMustUseSuppliedProfile, isShowCheckboxes, isThreadUsed, isUseDefaultUser, isUsePasswordCache, removeConnectionListener, removeDefaultUser, removePasswordCacheEntry, removePropertyChangeListener, removeVetoableChangeListener, resetAllServices, setCcsid, setDDMRDB, setDefaultSignonHandler, setDefaultUser, setGSSCredential, setGSSName, setGSSOption, setGuiAvailable, setIdentityToken, setLocale, setLocale, setMustAddLanguageLibrary, setMustUseNetSockets, setMustUseSockets, setMustUseSuppliedProfile, setPassword, setPasswordExpirationWarningDays, setProfileToken, setProxyServer, setServicePort, setServicePortsToDefault, setShowCheckboxes, setSignonHandler, setSocketProperties, 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.

See Also:
Constant Field Values

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 system.

See Also:
Constant Field Values

CLINT_TO_SERVER

public static final int CLINT_TO_SERVER
Deprecated. Use CLIENT_TO_SERVER instead.
See Also:
Constant Field Values

CLIENT_TO_SERVER

public static final int CLIENT_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 system.

See Also:
Constant Field Values
Constructor Detail

SecureAS400

public SecureAS400()
Constructs a SecureAS400 object.


SecureAS400

public SecureAS400(String systemName)
Constructs a SecureAS400 object. It uses the specified system name.

Parameters:
systemName - The name of the system.

SecureAS400

public SecureAS400(String systemName,
                   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 system.
userId - The user profile name to use to authenticate to the system.

SecureAS400

public SecureAS400(String systemName,
                   ProfileTokenCredential profileToken)
Constructs a SecureAS400 object. It uses the specified system name and profile token.

Parameters:
systemName - The name of the system. Use localhost to access data locally.
profileToken - The profile token to use to authenticate to the system.

SecureAS400

public SecureAS400(String systemName,
                   String userId,
                   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 system.
userId - The user profile name to use to authenticate to the system.
password - The user profile password to use to authenticate to the system.

SecureAS400

public SecureAS400(String systemName,
                   String userId,
                   String password,
                   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 system.
userId - The user profile name to use to authenticate to the system.
password - The user profile password to use to authenticate 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(String systemName,
                                         String userId,
                                         String password)
                                  throws AS400SecurityException,
                                         IOException
Validates the user ID and password against the system, and if successful, adds the information to the password cache.

Parameters:
systemName - The name of the system.
userId - The user profile name.
password - The user profile password.
Throws:
AS400SecurityException - If a security or authority error occurs.
IOException - If an error occurs while communicating with the system.

addPasswordCacheEntry

public static void addPasswordCacheEntry(String systemName,
                                         String userId,
                                         String password,
                                         String proxyServer)
                                  throws AS400SecurityException,
                                         IOException
Validates the user ID and password against the system, and if successful, adds the information to the password cache.

Parameters:
systemName - The name of the system.
userId - The user profile name.
password - The user profile 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.
IOException - If an error occurs while communicating with the system.

getKeyRingName

public String getKeyRingName()
Returns the key ring class name used for SSL communications with the system. 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 IBM i system are encrypted.

Returns:
The proxy encryption mode.

setKeyRingName

public void setKeyRingName(String keyRingName)
                    throws PropertyVetoException
Sets the key ring class name used for SSL communications with the system. 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:
PropertyVetoException - If any of the registered listeners vetos the property change.

setKeyRingName

public void setKeyRingName(String keyRingName,
                           String keyRingPassword)
                    throws PropertyVetoException
Sets the key ring class name used for SSL communications with the system. 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:
PropertyVetoException - If any of the registered listeners vetos the property change.

setKeyRingPassword

public void setKeyRingPassword(String keyRingPassword)
Sets the key ring password used for SSL communications with the system.

Parameters:
keyRingPassword - The password for the key ring class.

setProxyEncryptionMode

public void setProxyEncryptionMode(int proxyEncryptionMode)
                            throws PropertyVetoException
Sets the proxy encryption mode. The proxy encryption mode specifies which portions of the communications between the client, proxy server, and IBM i system 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 IBM i system.
CLIENT_TO_SERVER - encrypt both portions of connection.

Parameters:
proxyEncryptionMode - The proxy encryption mode.
Throws:
PropertyVetoException - If any of the registered listeners vetos the property change.