class TinyTLS.TLSOutputStream
extends java.io.OutputStream
| Modifier and Type | Field and Description |
|---|---|
private TLSPlaintextRecord |
m_aktTLSRecord |
private java.io.OutputStream |
m_stream |
| Constructor and Description |
|---|
TLSOutputStream(java.io.OutputStream ostream)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
private void |
send(int type,
byte[] message,
int offset,
int len)
Sends a TLS Message, given the type and message content in the
correct format.
|
void |
sendCertificateVerify()
Sends a Certificate Verify message, signing the hash of all sent and
received handshake messages up to this point.
|
void |
sendChangeCipherSpec()
Sends a Change Cipher Spec message accepting the change and signaling
that all following messages will be encrypted.
|
void |
sendClientCertificate()
Sends a Client Certificate message with the clients certificate chain
to the server.
|
void |
sendClientFinished()
Sends a Finished message to the peer.
|
void |
sendClientHello()
Sends a Client Hello message when connecting or when receiving a
Hello Request message.
|
void |
sendClientKeyExchange()
Sends a Client Key Exchange message to share the premaster secret.
|
void |
sendCloseNotify()
Sends an Alert message notifying the peer that the connection will be
closed and no new messages will be transfered.
|
void |
sendHandshake(int type,
byte[] message)
Sends a Handshake Message, given the sub type and message content in
the correct format.
|
void |
write(byte[] message)
Sends a message over a TLS secured connection.
|
void |
write(byte[] message,
int offset,
int len)
Sends part of a Byte Array, described by an offset and its length,
as a message over a TLS secured connection.
|
void |
write(int i) |
private java.io.OutputStream m_stream
private TLSPlaintextRecord m_aktTLSRecord
public TLSOutputStream(java.io.OutputStream ostream)
ostream - The OutputStream to send TLS messages through.
Probably a Socket of some sort.public void write(byte[] message)
throws java.io.IOException
write in class java.io.OutputStreammessage - The data to be sent in a Byte Array.java.io.IOExceptionpublic void write(byte[] message,
int offset,
int len)
throws java.io.IOException
write in class java.io.OutputStreammessage - A Byte Array containing the message to be sent.offset - Where the message starts.len - The length of the message.java.io.IOExceptionpublic void write(int i)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionprivate void send(int type,
byte[] message,
int offset,
int len)
throws java.io.IOException
type - TLS Message type identifier.message - Content of the message.java.io.IOExceptionTLSPlaintextRecordpublic void sendHandshake(int type,
byte[] message)
throws java.io.IOException
type - Handshake Message type identifier.message - Content of the message.java.io.IOExceptionTLSHandshakeRecordpublic void sendClientHello()
throws java.io.IOException
java.io.IOExceptionpublic void sendClientCertificate()
throws java.io.IOException
java.io.IOExceptionpublic void sendClientKeyExchange()
throws java.io.IOException
java.io.IOExceptionpublic void sendCertificateVerify()
throws java.io.IOException
java.io.IOExceptionpublic void sendChangeCipherSpec()
throws java.io.IOException
java.io.IOExceptionpublic void sendCloseNotify()
throws java.io.IOException
java.io.IOExceptionpublic void sendClientFinished()
throws java.io.IOException
java.io.IOExceptionCopyright © 2023. All rights reserved.