TLSChannel

Generic interface for TLS endpoint

static if(BOTAN_HAS_TLS)
class TLSChannel {}

Constructors

this
this(DataWriter output_fn, OnClearData data_cb, OnAlert alert_cb, OnHandshakeComplete handshake_cb, TLSSessionManager session_manager, RandomNumberGenerator rng, bool is_datagram, size_t reserved_io_buffer_size)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

activateSession
void activateSession()
Undocumented in source. Be warned that the author may not have intended to support it.
applicationProtocol
const(string) applicationProtocol()

Returns the ALPN chosen in the ServerHello with the ALPN extention

changeCipherSpecReader
void changeCipherSpecReader(ConnectionSide side)
Undocumented in source. Be warned that the author may not have intended to support it.
changeCipherSpecWriter
void changeCipherSpecWriter(ConnectionSide side)
Undocumented in source. Be warned that the author may not have intended to support it.
close
void close()

Send a close notification alert

createHandshakeState
HandshakeState createHandshakeState(TLSProtocolVersion _version)
Undocumented in source. Be warned that the author may not have intended to support it.
getPeerCertChain
Vector!X509Certificate getPeerCertChain(HandshakeState state)
Undocumented in source.
heartbeat
void heartbeat(const(ubyte)* payload, size_t payload_size)

Attempt to send a heartbeat message (if negotiated with counterparty)

heartbeat
void heartbeat()

Attempt to send a heartbeat message (if negotiated with counterparty)

heartbeatSendingAllowed
bool heartbeatSendingAllowed()
initiateHandshake
void initiateHandshake(HandshakeState state, bool force_full_renegotiation)
Undocumented in source.
isActive
bool isActive()
isClosed
bool isClosed()
keyMaterialExport
const(SymmetricKey) keyMaterialExport(string label, string context, size_t length)

Key material export (RFC 5705)

newHandshakeState
HandshakeState newHandshakeState(HandshakeIO io)
Undocumented in source.
peerCertChain
Vector!X509Certificate peerCertChain()
peerSupportsHeartbeats
bool peerSupportsHeartbeats()
processHandshakeMsg
void processHandshakeMsg(HandshakeState active_state, HandshakeState pending_state, HandshakeType type, Vector!ubyte contents)
Undocumented in source.
receivedData
size_t receivedData(const(ubyte)* input, size_t input_size)

Inject TLS traffic received from counterparty

receivedData
size_t receivedData(Vector!ubyte buf)

Inject TLS traffic received from counterparty

renegotiate
void renegotiate(bool force_full_renegotiation)

Attempt to renegotiate the session

resetState
void resetState()
Undocumented in source. Be warned that the author may not have intended to support it.
rng
RandomNumberGenerator rng()
Undocumented in source. Be warned that the author may not have intended to support it.
saveSession
bool saveSession(TLSSession session)
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationCheck
void secureRenegotiationCheck(ClientHello client_hello)
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationCheck
void secureRenegotiationCheck(ServerHello server_hello)
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationDataForClientHello
Vector!ubyte secureRenegotiationDataForClientHello()
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationDataForServerHello
Vector!ubyte secureRenegotiationDataForServerHello()
Undocumented in source. Be warned that the author may not have intended to support it.
secureRenegotiationSupported
bool secureRenegotiationSupported()
send
void send(const(ubyte)* buf, size_t buf_size)

Inject plaintext intended for counterparty Throws an exception if isActive() is false

send
void send(string str)

Inject plaintext intended for counterparty Throws an exception if isActive() is false

send
void send(Vector!(char, Alloc) val)

Inject plaintext intended for counterparty Throws an exception if isActive() is false

sendAlert
void sendAlert(TLSAlert alert)

Send a TLS alert message. If the alert is fatal, the internal state (keys, etc) will be reset.

sendFatalAlert
void sendFatalAlert(TLSAlertType type)

Send a fatal alert

sendWarningAlert
void sendWarningAlert(TLSAlertType type)

Send a warning alert

sessionId
const(ubyte[]) sessionId()

Returns the current session ID

sessionManager
TLSSessionManager sessionManager()
Undocumented in source. Be warned that the author may not have intended to support it.
timeoutCheck
bool timeoutCheck()

Perform a handshake timeout check. This does nothing unless this is a DTLS channel with a pending handshake state, in which case we check for timeout and potentially retransmit handshake packets.

Variables

m_application_protocol
string m_application_protocol;
Undocumented in source.
m_session_manager
TLSSessionManager m_session_manager;
Undocumented in source.

Meta