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.OutputStream
message
- The data to be sent in a Byte Array.java.io.IOException
public void write(byte[] message, int offset, int len) throws java.io.IOException
write
in class java.io.OutputStream
message
- A Byte Array containing the message to be sent.offset
- Where the message starts.len
- The length of the message.java.io.IOException
public void write(int i) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
private 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.IOException
TLSPlaintextRecord
public void sendHandshake(int type, byte[] message) throws java.io.IOException
type
- Handshake Message type identifier.message
- Content of the message.java.io.IOException
TLSHandshakeRecord
public void sendClientHello() throws java.io.IOException
java.io.IOException
public void sendClientCertificate() throws java.io.IOException
java.io.IOException
public void sendClientKeyExchange() throws java.io.IOException
java.io.IOException
public void sendCertificateVerify() throws java.io.IOException
java.io.IOException
public void sendChangeCipherSpec() throws java.io.IOException
java.io.IOException
public void sendCloseNotify() throws java.io.IOException
java.io.IOException
public void sendClientFinished() throws java.io.IOException
java.io.IOException
Copyright © 2023. All rights reserved.