anon.crypto.tinytls
Class TinyTLSServerSocket.TLSOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by anon.crypto.tinytls.TinyTLSServerSocket.TLSOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Enclosing class:
TinyTLSServerSocket

 class TinyTLSServerSocket.TLSOutputStream
extends java.io.OutputStream

Author:
stefan TLSOutputStream

Field Summary
private  TLSPlaintextRecord m_aktTLSRecord
           
private  java.io.DataOutputStream m_stream
           
 
Constructor Summary
TinyTLSServerSocket.TLSOutputStream(java.io.OutputStream ostream)
          Constructor
 
Method Summary
 void flush()
           
private  void send(int type, byte[] message, int offset, int len)
          send a message to the server
 void sendChangeCipherSpec()
          send a change cipher spec message now all client data will be encrypted
 void sendHandshake(int type, byte[] message)
          sends a handshake
 void sendServerCertificate()
          send the server certificate
 void sendServerFinished()
          send the server finished message
 void sendServerHandshakes()
          send server handshakes
 void sendServerHello()
          send a server hello
 void sendServerHelloDone()
          send a server hello done message
 void sendServerKeyExchange()
          send the server key exchange message
 void write(byte[] message)
           
 void write(byte[] message, int offset, int len)
           
 void write(int i)
           
 
Methods inherited from class java.io.OutputStream
close
 
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.DataOutputStream m_stream

m_aktTLSRecord

private TLSPlaintextRecord m_aktTLSRecord
Constructor Detail

TinyTLSServerSocket.TLSOutputStream

public TinyTLSServerSocket.TLSOutputStream(java.io.OutputStream ostream)
Constructor

Parameters:
ostream - outputstream
Method Detail

write

public void write(byte[] message)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] message,
                  int offset,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(int i)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

send

private void send(int type,
                  byte[] message,
                  int offset,
                  int len)
           throws java.io.IOException
send a message to the server

Parameters:
type - type of the tls message
message - message
Throws:
java.io.IOException

sendHandshake

public void sendHandshake(int type,
                          byte[] message)
                   throws java.io.IOException
sends a handshake

Parameters:
type - handshaketype
message - message
Throws:
java.io.IOException

sendServerHello

public void sendServerHello()
                     throws java.io.IOException
send a server hello

Throws:
java.io.IOException

sendServerCertificate

public void sendServerCertificate()
                           throws java.io.IOException
send the server certificate

Throws:
java.io.IOException

sendServerKeyExchange

public void sendServerKeyExchange()
                           throws java.io.IOException
send the server key exchange message

Throws:
java.io.IOException

sendServerHelloDone

public void sendServerHelloDone()
                         throws java.io.IOException
send a server hello done message

Throws:
java.io.IOException

sendServerHandshakes

public void sendServerHandshakes()
                          throws java.io.IOException
send server handshakes

Throws:
java.io.IOException

sendChangeCipherSpec

public void sendChangeCipherSpec()
                          throws java.io.IOException
send a change cipher spec message now all client data will be encrypted

Throws:
java.io.IOException

sendServerFinished

public void sendServerFinished()
                        throws java.io.IOException
send the server finished message

Throws:
java.io.IOException