com.ibm.as400.access

Class SecureAS400

  • All Implemented Interfaces:
    java.io.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 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
      • changeCipherSuites

        public static boolean changeCipherSuites
        Indicate whether the cipher suites changed by the caller. We add this for iNav.
      • newCipherSuites

        public static java.lang.String[] newCipherSuites
    • 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 system.
      • 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 system.
        userId - The user profile name to use to authenticate to the system.
      • SecureAS400

        public SecureAS400(java.lang.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(java.lang.String systemName,
                   java.lang.String userId,
                   java.lang.String password)
        Deprecated. 
        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(java.lang.String systemName,
                   java.lang.String userId,
                   char[] 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(java.lang.String systemName,
                   java.lang.String userId,
                   java.lang.String password,
                   java.lang.String proxyServer)
        Deprecated. 
        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(java.lang.String systemName,
                   java.lang.String userId,
                   char[] 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 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(java.lang.String systemName,
                                 java.lang.String userId,
                                 java.lang.String password)
                                          throws AS400SecurityException,
                                                 java.io.IOException
        Deprecated. 
        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.
        java.io.IOException - If an error occurs while communicating with the system.
      • addPasswordCacheEntry

        public static void addPasswordCacheEntry(java.lang.String systemName,
                                 java.lang.String userId,
                                 char[] 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 name of the system.
        userId - The user profile name.
        password - The user profile password.
        Throws:
        AS400SecurityException - If a security or authority error occurs.
        java.io.IOException - If an error occurs while communicating with the system.
      • 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
        Deprecated. 
        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.
        java.io.IOException - If an error occurs while communicating with the system.
      • addPasswordCacheEntry

        public static void addPasswordCacheEntry(java.lang.String systemName,
                                 java.lang.String userId,
                                 char[] 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 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.
        java.io.IOException - If an error occurs while communicating with the system.
      • getKeyRingName

        public java.lang.String getKeyRingName()
        Deprecated. 
        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(java.lang.String keyRingName)
                            throws java.beans.PropertyVetoException
        Sets the key ring class name used for SSL communications with the system. This method is no longer supported because sslight is not longer supported.
        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 system. This method is no longer available since support for sslight has been removed.
        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)
        Deprecated. 
        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 java.beans.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:
        java.beans.PropertyVetoException - If any of the registered listeners vetos the property change.
      • setEnabledCipherSuites

        public void setEnabledCipherSuites(java.lang.String[] suites)