IP*Works! SSL V6

ipworksssl
Class Ipdaemons

java.lang.Object
  |
  +--ipworksssl.Ipdaemons

public class Ipdaemons
extends java.lang.Object

The IPDaemonS bean is used to create TCP/IP servers. The bean handles multiple simultaneous connections on the same TCP/IP port (service port). It is designed to balance the load between connections for a fast, powerful server.

The IPDaemonS bean is the SSL-enabled equivalent of the IP*Works! IPDaemon bean. The main difference is the introduction of a set of new properties and events that deal with SSL security. TheSSLProviderconfiguration setting chooses a security provider subsystem. TheSSLEnabledProtocolsandSSLCipherStrengthconfiguration settings determine which protocols are enabled and at what security level. SSLCertStore , SSLCertSubject , and/or SSLCertEncoded are used to select a certificate for the server (please note that a valid certificate MUST be selected before the server can function). The SSLAuthenticateClients property together with SSLClientAuthentication event allow you to use digital certificates for client authentication. Finally, the SSLStatus event provides information about the SSL handshake.

IPDaemonS is the server complement of IPPortS (which is used to create client applications). They share a common design philosophy and interface. We expect you will find IPDaemonS as easy to use as IPPortS.

By default, each instance of IPDaemonS can handle up to 1000 simultaneous incoming connections (this number may be increased up to 100,000, or decreased to a lower value by using theMaxConnectionsconfiguration setting).

The connections are identified by a ConnectionId (a number between 1 andMaxConnections). Most of IPDaemon's properties are array properties indexed by ConnectionId . IPDaemon's events also have ConnectionId as a parameter to identify the connection they relate to.

Our main goal in designing IPDaemonS was to make it easy to use without sacrificing performance. The bean has a minimum of properties, and six events: ConnectionRequest , Connected , DataIn , Disconnected , ReadyToSend , and Error .

IPDaemonS can start to listen on a port by setting the Listening property to True. When a remote host asks for a connection, the ConnectionRequest event is fired. At that point, the connection can either be accepted or rejected. If the connection is accepted, a ConnectionId is assigned, and communication can start. From this point on, the operation is very similar to IPPort. Data is sent by assigning the data string to the DataToSend property. The address and port of the incoming connection can be found by querying the RemoteHost and RemotePort properties.


Field Summary
static int sslAutomatic
           
static int sslExplicit
           
static int sslImplicit
           
static int sslNone
           
static int sstMachine
           
static int sstPEMKey
           
static int sstPFXBlob
           
static int sstPFXFile
           
static int sstUser
           
 
Constructor Summary
Ipdaemons()
           
 
Method Summary
 void addIpdaemonsEventListener(IpdaemonsEventListener l)
           
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a beanconfiguration setting.
 void disconnect(int connectionId)
          Disconnect from the remote host.
 void doEvents()
          Processes events from the internal message queue.
 int getBytesSent(int connectionId)
          The number of bytes actually sent after an assignment to DataToSend .
 int getConnectionBacklog()
          The maximum number of pending connections maintained by the TCP/IP subsystem.
 int getConnectionCount()
          The number of currently connected clients.
 byte[] getEOL(int connectionId)
          Used to break the incoming data stream into chunks separated by EOL .
 java.lang.String getLocalAddress(int connectionId)
          The IP address of the interface for ConnectionId in Internet dotted format.
 java.lang.String getLocalHost()
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 int getLocalPort()
          The TCP port in the local host where the bean listens.
 java.lang.String getRemoteHost(int connectionId)
          The IP address of the RemoteHost in Internet dotted format.
 int getRemotePort(int connectionId)
          The IP port of the RemoteHost for a connection.
 byte[] getSSLCertEncoded()
          The SSL certificate (PEM/base64 encoded).
 byte[] getSSLCertStore()
          The name of the certificate store for the client certificate.
 java.lang.String getSSLCertStorePassword()
          The password for the certificate store (if any).
 int getSSLCertStoreType()
          The type of certificate store for the client certificate.
 java.lang.String getSSLCertSubject()
          The subject of the certificate used for client authentication.
 int getSSLStartMode()
          Determines how the bean starts the SSL negotiation.
 boolean isAcceptData(int connectionId)
          Enables or disables data reception (the DataIn event).
 boolean isConnected(int connId)
          Used to disconnect individual connections and/or show their status.
 boolean isKeepAlive()
          When True, KEEPALIVE packets are enabled (for long connections).
 boolean isLinger()
          When set to True, connections are terminated gracefully.
 boolean isListening()
          If True, the bean accepts incoming connections on LocalPort.
 boolean isSingleLineMode(int connectionId)
          Special mode for line-oriented protocols.
 boolean isSSLAuthenticateClients()
          If true, the server asks the client(s) for a certificate.
 void removeIpdaemonsEventListener(IpdaemonsEventListener l)
           
 void send(int connectionId, byte[] text)
          Send data to the remote host.
 void sendLine(int connectionId, java.lang.String text)
          Sends a string followed by a newline.
 void setAcceptData(int connectionId, boolean acceptData)
          Enables or disables data reception (the DataIn event).
 void setConnected(int connId, boolean connected)
          Used to disconnect individual connections and/or show their status.
 void setConnectionBacklog(int connectionBacklog)
          The maximum number of pending connections maintained by the TCP/IP subsystem.
 void setDataToSend(int connectionId, byte[] dataToSend)
          A string of data to be sent to the remote host.
 void setEOL(int connectionId, byte[] EOL)
          Used to break the incoming data stream into chunks separated by EOL .
 void setKeepAlive(boolean keepAlive)
          When True, KEEPALIVE packets are enabled (for long connections).
 void setLinger(boolean linger)
          When set to True, connections are terminated gracefully.
 void setListening(boolean listening)
          If True, the bean accepts incoming connections on LocalPort.
 void setLocalHost(java.lang.String localHost)
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 void setLocalPort(int localPort)
          The TCP port in the local host where the bean listens.
 void setSingleLineMode(int connectionId, boolean singleLineMode)
          Special mode for line-oriented protocols.
 void setSSLAuthenticateClients(boolean SSLAuthenticateClients)
          If true, the server asks the client(s) for a certificate.
 void setSSLCertEncoded(byte[] SSLCertEncoded)
          The SSL certificate (PEM/base64 encoded).
 void setSSLCertStore(byte[] SSLCertStore)
          The name of the certificate store for the client certificate.
 void setSSLCertStorePassword(java.lang.String SSLCertStorePassword)
          The password for the certificate store (if any).
 void setSSLCertStoreType(int SSLCertStoreType)
          The type of certificate store for the client certificate.
 void setSSLCertSubject(java.lang.String SSLCertSubject)
          The subject of the certificate used for client authentication.
 void setSSLStartMode(int SSLStartMode)
          Determines how the bean starts the SSL negotiation.
 void shutdown()
          Shutdown the server.
 void startSSL(int connectionId)
          starts SSL negotiation on a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sstUser

public static final int sstUser
See Also:
Constant Field Values

sstMachine

public static final int sstMachine
See Also:
Constant Field Values

sstPFXFile

public static final int sstPFXFile
See Also:
Constant Field Values

sstPFXBlob

public static final int sstPFXBlob
See Also:
Constant Field Values

sstPEMKey

public static final int sstPEMKey
See Also:
Constant Field Values

sslAutomatic

public static final int sslAutomatic
See Also:
Constant Field Values

sslImplicit

public static final int sslImplicit
See Also:
Constant Field Values

sslExplicit

public static final int sslExplicit
See Also:
Constant Field Values

sslNone

public static final int sslNone
See Also:
Constant Field Values
Constructor Detail

Ipdaemons

public Ipdaemons()
Method Detail

isAcceptData

public boolean isAcceptData(int connectionId)
                     throws IPWorksSSLException
Enables or disables data reception (the DataIn event).

Setting the property to False, temporarily disables data reception (and the DataIn event) on the connection specified by ConnectionId . Setting the property to True, reenables data reception.

IPWorksSSLException

setAcceptData

public void setAcceptData(int connectionId,
                          boolean acceptData)
                   throws IPWorksSSLException
Enables or disables data reception (the DataIn event).

Setting the property to False, temporarily disables data reception (and the DataIn event) on the connection specified by ConnectionId . Setting the property to True, reenables data reception.

IPWorksSSLException

getBytesSent

public int getBytesSent(int connectionId)
                 throws IPWorksSSLException
The number of bytes actually sent after an assignment to DataToSend .

The BytesSent property shows how many bytes were sent after the last assignment to DataToSend . Please check the DataToSend property for more information.

IPWorksSSLException

isConnected

public boolean isConnected(int connId)
                    throws IPWorksSSLException
Used to disconnect individual connections and/or show their status.

The Connected property is used to close connections.

Connected also shows the status of a particular connection (connected/disconnected).

How and when the connection is closed is controlled by the Linger property. Please refer to its description for more information.

IPWorksSSLException

setConnected

public void setConnected(int connId,
                         boolean connected)
                  throws IPWorksSSLException
Used to disconnect individual connections and/or show their status.

The Connected property is used to close connections.

Connected also shows the status of a particular connection (connected/disconnected).

How and when the connection is closed is controlled by the Linger property. Please refer to its description for more information.

IPWorksSSLException

getConnectionBacklog

public int getConnectionBacklog()
The maximum number of pending connections maintained by the TCP/IP subsystem.

This value reflects the SOMAXCON option for the main listening socket. The default value for most systems is 5. You may set ConnectionBacklog to a larger value if the server is expected to receive a large number of connections, and queuing them is desirable.


setConnectionBacklog

public void setConnectionBacklog(int connectionBacklog)
                          throws IPWorksSSLException
The maximum number of pending connections maintained by the TCP/IP subsystem.

This value reflects the SOMAXCON option for the main listening socket. The default value for most systems is 5. You may set ConnectionBacklog to a larger value if the server is expected to receive a large number of connections, and queuing them is desirable.

IPWorksSSLException

getConnectionCount

public int getConnectionCount()
The number of currently connected clients.

The value of ConnectionCount automatically increases and decreases as Connected and Disconnected events are fired.

Please note that setting Listening to False, does not actually disconnected connected clients, and ConnectionCount keeps reflecting the number of these active connections. You must use the Connected property to disconnect each client individually.


setDataToSend

public void setDataToSend(int connectionId,
                          byte[] dataToSend)
                   throws IPWorksSSLException
A string of data to be sent to the remote host. Write-only property.

Assigning a string to the DataToSend property makes the bean send the string to the remote host. The Send method provides similar functionality.

If you are sending data to the remote host faster than it can process it, or faster than the network's bandwidth allows, the outgoing queue might fill up. When this happens, DataToSend fails with exception 10035: "[10035] Operation would block" (WSAEWOULDBLOCK). You can check this error, and then try to send the data again. The BytesSent property shows how many bytes were sent (if any). If 0 bytes were sent, then you can wait for the ReadyToSend event before attempting to send data again. (However, please note that ReadyToSend is not fired when part of the data is successfully sent).

IPWorksSSLException

getEOL

public byte[] getEOL(int connectionId)
              throws IPWorksSSLException
Used to break the incoming data stream into chunks separated by EOL .

The EOL property is used to define boundaries in the input stream using the value of the property.

The EOL property is especially useful with ASCII files. Setting it to CRLF ("\\r\\n") enables splitting of the incoming ASCII text stream into lines. In this case, one event is fired for each line received (as well as in packet boundaries). The CRLF ("\\r\\n") . bytes are discarded.

The EOL property is a binary string. In particular, this means that it can be more than one byte long, and it can contain NULL bytes.

IPWorksSSLException

setEOL

public void setEOL(int connectionId,
                   byte[] EOL)
            throws IPWorksSSLException
Used to break the incoming data stream into chunks separated by EOL .

The EOL property is used to define boundaries in the input stream using the value of the property.

The EOL property is especially useful with ASCII files. Setting it to CRLF ("\\r\\n") enables splitting of the incoming ASCII text stream into lines. In this case, one event is fired for each line received (as well as in packet boundaries). The CRLF ("\\r\\n") . bytes are discarded.

The EOL property is a binary string. In particular, this means that it can be more than one byte long, and it can contain NULL bytes.

IPWorksSSLException

isKeepAlive

public boolean isKeepAlive()
When True, KEEPALIVE packets are enabled (for long connections).

The KeepAlive enables the SO_KEEPALIVE option on the incoming connections. This option prevents long connections from timing out in case of inactivity.

Please note that system TCP/IP stack implementations are not required to support SO_KEEPALIVE.

The KeepAlive property is shared among incoming connections. When the property is set, the corresponding value is set for incoming connections as they are accepted. Existing connections are not modified.


setKeepAlive

public void setKeepAlive(boolean keepAlive)
                  throws IPWorksSSLException
When True, KEEPALIVE packets are enabled (for long connections).

The KeepAlive enables the SO_KEEPALIVE option on the incoming connections. This option prevents long connections from timing out in case of inactivity.

Please note that system TCP/IP stack implementations are not required to support SO_KEEPALIVE.

The KeepAlive property is shared among incoming connections. When the property is set, the corresponding value is set for incoming connections as they are accepted. Existing connections are not modified.

IPWorksSSLException

isLinger

public boolean isLinger()
When set to True, connections are terminated gracefully.

The Linger property controls how a connection is closed. The default is True. In this case the connection is closed only after all the data is sent. Setting it to False forces an abrupt (hard) disconnection. Any data that was in the sending queue may be lost.

The default behavior (which is also the default mode for Winsock stream sockets) might result in an indefinite delay in closing the connection. Although the bean returns control immediately, the system might indefinitely hold system resources until all pending data is sent (even after your application closes). This means that valuable system resources might be wasted.

Setting Linger to False forces an immediate disconnection. If you know that the other side has received all the data you had sent (by a client acknowledgment, for example), setting Linger to False might be the appropriate course of action.

The Linger property is shared among incoming connections. When the property is set, the corresponding value is set for incoming connections as they are accepted. Existing connections are not modified.


setLinger

public void setLinger(boolean linger)
               throws IPWorksSSLException
When set to True, connections are terminated gracefully.

The Linger property controls how a connection is closed. The default is True. In this case the connection is closed only after all the data is sent. Setting it to False forces an abrupt (hard) disconnection. Any data that was in the sending queue may be lost.

The default behavior (which is also the default mode for Winsock stream sockets) might result in an indefinite delay in closing the connection. Although the bean returns control immediately, the system might indefinitely hold system resources until all pending data is sent (even after your application closes). This means that valuable system resources might be wasted.

Setting Linger to False forces an immediate disconnection. If you know that the other side has received all the data you had sent (by a client acknowledgment, for example), setting Linger to False might be the appropriate course of action.

The Linger property is shared among incoming connections. When the property is set, the corresponding value is set for incoming connections as they are accepted. Existing connections are not modified.

IPWorksSSLException

isListening

public boolean isListening()
If True, the bean accepts incoming connections on LocalPort.

Use the Listening property to make the bean 'listen' (accept connections) on the port specified by the LocalPort property. Setting Listening to False will make the bean stop listening. (Please note that this does not close any existing connections).


setListening

public void setListening(boolean listening)
                  throws IPWorksSSLException
If True, the bean accepts incoming connections on LocalPort.

Use the Listening property to make the bean 'listen' (accept connections) on the port specified by the LocalPort property. Setting Listening to False will make the bean stop listening. (Please note that this does not close any existing connections).

IPWorksSSLException

getLocalAddress

public java.lang.String getLocalAddress(int connectionId)
                                 throws IPWorksSSLException
The IP address of the interface for ConnectionId in Internet dotted format.

The LocalAddress shows the IP address of the interface through which the connection identified by ConnectionId is passing.

This property is important for multihomed hosts where it can be used to find which particular network interface an individual connection is going through.

IPWorksSSLException

getLocalHost

public java.lang.String getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.


setLocalHost

public void setLocalHost(java.lang.String localHost)
                  throws IPWorksSSLException
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multihomed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multihomed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

IPWorksSSLException

getLocalPort

public int getLocalPort()
The TCP port in the local host where the bean listens.

The LocalPort property must be set before IPDaemon starts listening. If its value is 0, then the TCP/IP subsystem picks a port number at random. The port number can be found by checking the value of the LocalPort property after IPDaemon is in listening mode (after successfully assigning True to the Listening property).

The service port is not shared among servers (i.e. there can be only one IPDaemon 'listening' on a particular port at one time).


setLocalPort

public void setLocalPort(int localPort)
                  throws IPWorksSSLException
The TCP port in the local host where the bean listens.

The LocalPort property must be set before IPDaemon starts listening. If its value is 0, then the TCP/IP subsystem picks a port number at random. The port number can be found by checking the value of the LocalPort property after IPDaemon is in listening mode (after successfully assigning True to the Listening property).

The service port is not shared among servers (i.e. there can be only one IPDaemon 'listening' on a particular port at one time).

IPWorksSSLException

getRemoteHost

public java.lang.String getRemoteHost(int connectionId)
                               throws IPWorksSSLException
The IP address of the RemoteHost in Internet dotted format.

The RemoteHost property shows the IP address of the remote host through which the connection specified by ConnectionId is coming.

ConnectionId must indicate a valid connection, or an error will be fired.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with a "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

IPWorksSSLException

getRemotePort

public int getRemotePort(int connectionId)
                  throws IPWorksSSLException
The IP port of the RemoteHost for a connection.

The RemotePort property shows the TCP port on the remote host through which the connection specified by ConnectionId is coming.

ConnectionId must indicate a valid connection, or an error will be fired.

IPWorksSSLException

isSingleLineMode

public boolean isSingleLineMode(int connectionId)
                         throws IPWorksSSLException
Special mode for line-oriented protocols.

When SingleLineMode is True, the bean treats the incoming data stream as lines separated by CRLF, CR, or LF. The EOL property is ignored.

IPWorksSSLException

setSingleLineMode

public void setSingleLineMode(int connectionId,
                              boolean singleLineMode)
                       throws IPWorksSSLException
Special mode for line-oriented protocols.

When SingleLineMode is True, the bean treats the incoming data stream as lines separated by CRLF, CR, or LF. The EOL property is ignored.

IPWorksSSLException

isSSLAuthenticateClients

public boolean isSSLAuthenticateClients()
If true, the server asks the client(s) for a certificate.

This property is used in conjunction with the SSLClientAuthentication event. Please refer to the documentation of the SSLClientAuthentication event for details.


setSSLAuthenticateClients

public void setSSLAuthenticateClients(boolean SSLAuthenticateClients)
                               throws IPWorksSSLException
If true, the server asks the client(s) for a certificate.

This property is used in conjunction with the SSLClientAuthentication event. Please refer to the documentation of the SSLClientAuthentication event for details.

IPWorksSSLException

getSSLCertEncoded

public byte[] getSSLCertEncoded()
The SSL certificate (PEM/base64 encoded).

This property is used to assign a specific certificate for SSL client authentication (SSL server authentication in the case of the IPDaemonS bean). The SSLCertStore and SSLCertSubject properties may also be used to specify a certificate.

When SSLCertEncoded is set, a search is initiated in the current SSLCertStore for the private key of the certificate. If the key is found, SSLCertSubject is updated to reflect the full subject of the selected certificate, otherwise SSLCertSubject is set to empty string.


setSSLCertEncoded

public void setSSLCertEncoded(byte[] SSLCertEncoded)
                       throws IPWorksSSLException
The SSL certificate (PEM/base64 encoded).

This property is used to assign a specific certificate for SSL client authentication (SSL server authentication in the case of the IPDaemonS bean). The SSLCertStore and SSLCertSubject properties may also be used to specify a certificate.

When SSLCertEncoded is set, a search is initiated in the current SSLCertStore for the private key of the certificate. If the key is found, SSLCertSubject is updated to reflect the full subject of the selected certificate, otherwise SSLCertSubject is set to empty string.

IPWorksSSLException

getSSLCertStore

public byte[] getSSLCertStore()
The name of the certificate store for the client certificate.

The SSLCertStoreType property specifies the type of the certificate store specified by SSLCertStore . If the store is password protected, specify the password in SSLCertStorePassword .

SSLCertStore is used in conjunction with the SSLCertSubject property in order to specify client certificates. If SSLCertStore has a value, and SSLCertSubject or SSLCertEncoded is set, a search for a certificate is initiated. Please refer to the SSLCertSubject property for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MY
A certificate store holding personal certificates with their associated private keys.
CA
Certifying authority certificates.
ROOT
Root certificates.
SPC
Software publisher certificates.

In Java, the certificate store normally is a file containing certificates and optional private keys.

When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).

If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.


setSSLCertStore

public void setSSLCertStore(byte[] SSLCertStore)
                     throws IPWorksSSLException
The name of the certificate store for the client certificate.

The SSLCertStoreType property specifies the type of the certificate store specified by SSLCertStore . If the store is password protected, specify the password in SSLCertStorePassword .

SSLCertStore is used in conjunction with the SSLCertSubject property in order to specify client certificates. If SSLCertStore has a value, and SSLCertSubject or SSLCertEncoded is set, a search for a certificate is initiated. Please refer to the SSLCertSubject property for details.

Designations of certificate stores are platform-dependent.

The following are designations of the most common User and Machine certificate stores in Windows:

MY
A certificate store holding personal certificates with their associated private keys.
CA
Certifying authority certificates.
ROOT
Root certificates.
SPC
Software publisher certificates.

In Java, the certificate store normally is a file containing certificates and optional private keys.

When the certificate store type is PFXFile, this property must be set to the name of the file. When the type is PFXBlob, the property must be set to the binary contents of a PFX file (i.e. PKCS12 certificate store).

If the provider is OpenSSL, the certificate store is a file containing a certificate and a private key. This property must be set to the name of the file.

IPWorksSSLException

getSSLCertStorePassword

public java.lang.String getSSLCertStorePassword()
The password for the certificate store (if any).

If the certificate store is of a type that requires a password, the value of this property is used to open the certificate store.


setSSLCertStorePassword

public void setSSLCertStorePassword(java.lang.String SSLCertStorePassword)
                             throws IPWorksSSLException
The password for the certificate store (if any).

If the certificate store is of a type that requires a password, the value of this property is used to open the certificate store.

IPWorksSSLException

getSSLCertStoreType

public int getSSLCertStoreType()
The type of certificate store for the client certificate.

This property can take one of the following values:

0 (sstUser - default)
For Windows, this specifies that the certificate store is a certificate store owned by the current user. For Java, this specifies that the certificate store is the name of a JKS (Java Key Store) file. If the provider is OpenSSL, this specifies that the certificate store is a file that contains PEM encoded certificate and private key.
1 (sstMachine)
The certificate store is a machine store (not available in Java and when provider is OpenSSL).
2 (sstPFXFile)
The certificate store is the name of a PFX (PKCS12) file containing certificates. If the provider is OpenSSL, the file may contain only one certificate and private key.
3 (sstPFXBlob)
The certificate store is a string (binary or base64 encoded) representing a certificate store in PFX (PKCS12) format.This setting is currently not supported when the provider is OpenSSL.

4 (sstPEMKey)
The certificate store is a string or filename that contains a PEM encoded certificate and private key.This store type is currently not supported in Java.


setSSLCertStoreType

public void setSSLCertStoreType(int SSLCertStoreType)
                         throws IPWorksSSLException
The type of certificate store for the client certificate.

This property can take one of the following values:

0 (sstUser - default)
For Windows, this specifies that the certificate store is a certificate store owned by the current user. For Java, this specifies that the certificate store is the name of a JKS (Java Key Store) file. If the provider is OpenSSL, this specifies that the certificate store is a file that contains PEM encoded certificate and private key.
1 (sstMachine)
The certificate store is a machine store (not available in Java and when provider is OpenSSL).
2 (sstPFXFile)
The certificate store is the name of a PFX (PKCS12) file containing certificates. If the provider is OpenSSL, the file may contain only one certificate and private key.
3 (sstPFXBlob)
The certificate store is a string (binary or base64 encoded) representing a certificate store in PFX (PKCS12) format.This setting is currently not supported when the provider is OpenSSL.

4 (sstPEMKey)
The certificate store is a string or filename that contains a PEM encoded certificate and private key.This store type is currently not supported in Java.

IPWorksSSLException

getSSLCertSubject

public java.lang.String getSSLCertSubject()
The subject of the certificate used for client authentication.

When this property is set, a search is performed in the current certificate store certificate with matching subject.

If an exact match is not found, the store is searched for subjects containing the value of the property.

When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US

Example (Searching with partial subject)

 Control.CertSubject = "Test" 

If a match is not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

If a matching certificate is found, the SSLCertSubject property is set to the full subject of the matching certificate.


setSSLCertSubject

public void setSSLCertSubject(java.lang.String SSLCertSubject)
                       throws IPWorksSSLException
The subject of the certificate used for client authentication.

When this property is set, a search is performed in the current certificate store certificate with matching subject.

If an exact match is not found, the store is searched for subjects containing the value of the property.

When setting the property to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US

Example (Searching with partial subject)

 Control.CertSubject = "Test" 

If a match is not found, the property is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

If a matching certificate is found, the SSLCertSubject property is set to the full subject of the matching certificate.

IPWorksSSLException

getSSLStartMode

public int getSSLStartMode()
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic - default)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.


setSSLStartMode

public void setSSLStartMode(int SSLStartMode)
                     throws IPWorksSSLException
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic - default)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.

IPWorksSSLException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksSSLException
Sets or retrieves a beanconfiguration setting.

Config is a generic method available in every bean. It is used to set and retrieveconfiguration settingsfor the bean.

Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

IPWorksSSLException

disconnect

public void disconnect(int connectionId)
                throws IPWorksSSLException
Disconnect from the remote host.

Calling this method is equivalent to setting the Connected property to False.

IPWorksSSLException

doEvents

public void doEvents()
              throws IPWorksSSLException
Processes events from the internal message queue.

When DoEvents is called, the bean processes any available events. If no events are available, it waits for a preset period of time, and then returns.

IPWorksSSLException

send

public void send(int connectionId,
                 byte[] text)
          throws IPWorksSSLException
Send data to the remote host.

Calling this method is equivalent to setting the DataToSend property to Text .

IPWorksSSLException

sendLine

public void sendLine(int connectionId,
                     java.lang.String text)
              throws IPWorksSSLException
Sends a string followed by a newline.

This method is used for sending data with line-oriented protocols. The line is followed by CRLF ("\\r\\n") .

Please refer to the GetLine method and SingleLineMode property for more information.

IPWorksSSLException

shutdown

public void shutdown()
              throws IPWorksSSLException
Shutdown the server.

Calling this method is equivalent to setting Listening to False, and then breaking every client connection by setting Connected to False.

IPWorksSSLException

startSSL

public void startSSL(int connectionId)
              throws IPWorksSSLException
starts SSL negotiation on a connection.

This method is used to start SSL negotiation on a plaintext connection. Please refer to the SSLStartMode property for more information.

Note that the Connected event will fire again after SSL negotiation is complete.

IPWorksSSLException

addIpdaemonsEventListener

public void addIpdaemonsEventListener(IpdaemonsEventListener l)
                               throws java.util.TooManyListenersException
java.util.TooManyListenersException

removeIpdaemonsEventListener

public void removeIpdaemonsEventListener(IpdaemonsEventListener l)

IP*Works! SSL V6

Copyright (c) 2004 /n software inc. - All rights reserved.