de.bb.minissl
Class SslClient

java.lang.Object
  |
  +--de.bb.minissl.SslClient

public final class SslClient
extends java.lang.Object

Implements the client side handshake for SSL. Creates the primary hello and passes the answer either to a Ssl2 or Ssl3 client.


Constructor Summary
SslClient()
          Creates a new SslClient object, which uses the given InputStream for reading and the given OutputStream for writing.
SslClient(java.io.InputStream is, java.io.OutputStream os)
          Creates a new SslClient object, which uses the given InputStream for reading and the given OutputStream for writing.
 
Method Summary
 void connect(java.io.InputStream is, java.io.OutputStream os)
          Connects the current object, which uses the given InputStream for reading and the given OutputStream for writing.
 java.util.Vector getCertificates()
          Return the vector of received certificates.
 int getCipherType()
          Query the used ciphertype
 java.io.InputStream getInputStream()
          Returns an input stream for this Ssl connection.
 java.io.OutputStream getOutputStream()
          Returns an input stream for this Ssl connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SslClient

public SslClient()
Creates a new SslClient object, which uses the given InputStream for reading and the given OutputStream for writing. To use this object it must be initialized using the method connect(InputStream is, OutputStream os)
See Also:
connect(InputStream is, OutputStream os) throws IOException

SslClient

public SslClient(java.io.InputStream is,
                 java.io.OutputStream os)
          throws java.io.IOException
Creates a new SslClient object, which uses the given InputStream for reading and the given OutputStream for writing.
Parameters:
is - the InputStream, which is used for reading
os - the OutputStream, which is used for writing
Throws:
java.io.IOException - throws an IOException if any non recoverable error occurs.
Method Detail

connect

public void connect(java.io.InputStream is,
                    java.io.OutputStream os)
             throws java.io.IOException
Connects the current object, which uses the given InputStream for reading and the given OutputStream for writing.
Parameters:
is - the InputStream, which is used for reading
os - the OutputStream, which is used for writing
Throws:
java.io.IOException - throws an IOException if any non recoverable error occurs.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns an input stream for this Ssl connection.
Returns:
a stream for reading from this Ssl connection.
Throws:
java.io.IOException - throws an IOException on error

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns an input stream for this Ssl connection.
Returns:
a stream for reading from this Ssl connection.
Throws:
java.io.IOException - throws an IOException on error

getCipherType

public int getCipherType()
                  throws java.io.IOException
Query the used ciphertype
Returns:
the used ciphertype
  • 3 = SSL_RSA_WITH_RC4_40_MD5
  • 4 = SSL_RSA_WITH_RC4_128_MD5
  • 5 = SSL_RSA_WITH_RC4_128_SHA
Throws:
java.io.IOException - throws an IOException when not connected

getCertificates

public final java.util.Vector getCertificates()
                                       throws java.io.IOException
Return the vector of received certificates. The vector contains elements of byte arrays (byte[]) with each a X.509 certificate. The application must verify the validity of the cerificate(s)!
Returns:
a vector with all received certificates
Throws:
java.io.IOException - throws an IOException when not connected