anon.tor.tinytls
Class TinyTLS.TLSOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byanon.tor.tinytls.TinyTLS.TLSOutputStream
Enclosing class:
TinyTLS

class TinyTLS.TLSOutputStream
extends java.io.OutputStream

Author:
stefan TLSOutputStream

Field Summary
private  TLSRecord m_aktTLSRecord
           
private  java.io.DataOutputStream m_stream
           
 
Constructor Summary
TinyTLS.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 sendCertificateVerify()
          send a certificate verify message if a certificate is used
 void sendChangeCipherSpec()
          send a change cipher spec message now all client data will be encrypted
 void sendClientCertificate()
          send a client certificate message
 void sendClientFinished()
          send a client finished message
 void sendClientHello()
          send a client hello message
 void sendClientKeyExchange()
          send a client key exchange message
 void sendHandshake(int type, byte[] message)
          send a handshake message to the server
 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 TLSRecord m_aktTLSRecord
Constructor Detail

TinyTLS.TLSOutputStream

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

Parameters:
ostream - outputstream
Method Detail

write

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

write

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

write

public void write(int i)
           throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
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
send a handshake message to the server

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

sendClientHello

public void sendClientHello()
                     throws java.io.IOException
send a client hello message

Throws:
java.io.IOException

sendClientCertificate

public void sendClientCertificate()
                           throws java.io.IOException
send a client certificate message

Throws:
java.io.IOException

sendClientKeyExchange

public void sendClientKeyExchange()
                           throws java.io.IOException
send a client key exchange message

Throws:
java.io.IOException

sendCertificateVerify

public void sendCertificateVerify()
                           throws java.io.IOException
send a certificate verify message if a certificate is used

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

sendClientFinished

public void sendClientFinished()
                        throws java.io.IOException
send a client finished message

Throws:
java.io.IOException