anon.crypto.tinytls
Class TinyTLSServerSocket.TLSInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by anon.crypto.tinytls.TinyTLSServerSocket.TLSInputStream
All Implemented Interfaces:
java.io.Closeable
Enclosing class:
TinyTLSServerSocket

 class TinyTLSServerSocket.TLSInputStream
extends java.io.InputStream

Author:
stefan TLSInputStream

Field Summary
private  int m_aktPendLen
           
private  int m_aktPendOffset
           
private  TLSPlaintextRecord m_aktTLSRecord
           
private  int m_ReadRecordState
           
private  java.io.DataInputStream m_stream
           
private static int STATE_LENGTH
           
private static int STATE_PAYLOAD
           
private static int STATE_START
           
private static int STATE_VERSION
           
 
Constructor Summary
TinyTLSServerSocket.TLSInputStream(java.io.InputStream istream)
          Constructor
 
Method Summary
 int available()
           
private  void handleAlert()
          handle alert message
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void readClientFinished()
          checks the client finished message
 void readClientHello()
          reads the client hello
 void readClientKeyExchange()
          processes the client key exchange
private  void readRecord()
          Reads one record if we need more data...
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_stream

private java.io.DataInputStream m_stream

m_aktPendOffset

private int m_aktPendOffset

m_aktPendLen

private int m_aktPendLen

m_aktTLSRecord

private TLSPlaintextRecord m_aktTLSRecord

m_ReadRecordState

private int m_ReadRecordState

STATE_START

private static final int STATE_START
See Also:
Constant Field Values

STATE_VERSION

private static final int STATE_VERSION
See Also:
Constant Field Values

STATE_LENGTH

private static final int STATE_LENGTH
See Also:
Constant Field Values

STATE_PAYLOAD

private static final int STATE_PAYLOAD
See Also:
Constant Field Values
Constructor Detail

TinyTLSServerSocket.TLSInputStream

public TinyTLSServerSocket.TLSInputStream(java.io.InputStream istream)
Constructor

Parameters:
istream - inputstream
Method Detail

readRecord

private void readRecord()
                 throws java.io.IOException
Reads one record if we need more data... Block until data is available...

Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException

available

public int available()
Overrides:
available in class java.io.InputStream

handleAlert

private void handleAlert()
                  throws java.io.IOException
handle alert message

Throws:
java.io.IOException

readClientHello

public void readClientHello()
                     throws java.io.IOException
reads the client hello

Throws:
java.io.IOException

readClientKeyExchange

public void readClientKeyExchange()
                           throws java.io.IOException
processes the client key exchange

Throws:
java.io.IOException

readClientFinished

public void readClientFinished()
                        throws java.io.IOException
checks the client finished message

Throws:
java.io.IOException