TLSSession

Class representing a TLS session state

Constructors

this
this(Vector!ubyte session_identifier, SecureVector!ubyte master_secret, TLSProtocolVersion _version, ushort ciphersuite, ubyte compression_method, ConnectionSide side, size_t fragment_size, Vector!X509Certificate certs, Vector!ubyte ticket, TLSServerInformation server_info, string srp_identifier)

New session (sets session start time)

this
this(const(ubyte)* ber, size_t ber_len)

Load a session from DER representation (created by DER_encode)

this
this(string pem)

Load a session from PEM representation (created by PEM_encode)

Members

Functions

DER_encode
SecureVector!ubyte DER_encode()

Encode this session data for storage Notes: if the master secret is compromised so is the session traffic

PEM_encode
string PEM_encode()

Encode this session data for storage Notes: if the master secret is compromised so is the session traffic

Version
TLSProtocolVersion Version()

Get the version of the saved session

ciphersuite
const(TLSCiphersuite) ciphersuite()

Get the ciphersuite info of the saved session

ciphersuiteCode
ushort ciphersuiteCode()

Get the ciphersuite code of the saved session

compressionMethod
ubyte compressionMethod()

Get the compression method used in the saved session

encrypt
Vector!ubyte encrypt(SymmetricKey master_key, RandomNumberGenerator rng)

Encrypt a session (useful for serialization or session tickets)

fragmentSize
size_t fragmentSize()

Get the negotiated maximum fragment size (or 0 if default)

masterSecret
const(SecureVector!ubyte) masterSecret()

Get the saved master secret

peerCerts
const(Vector!X509Certificate) peerCerts()

Return the certificate chain of the peer (possibly empty)

serverInfo
TLSServerInformation serverInfo()
Undocumented in source. Be warned that the author may not have intended to support it.
sessionAge
const(Duration) sessionAge()

Return how long this session has existed (in seconds)

sessionId
const(Vector!ubyte) sessionId()

Get the session identifier

sessionTicket
const(Vector!ubyte) sessionTicket()

Return the session ticket the server gave us

side
const(ConnectionSide) side()

Get which side of the connection the resumed session we are/were acting as.

srpIdentifier
string srpIdentifier()

Get the SRP identity (if sent by the client in the initial handshake)

startTime
SysTime startTime()

Get the wall clock time this session began

Static functions

decrypt
TLSSession decrypt(const(ubyte)* buf, size_t buf_len, SymmetricKey master_key)

Decrypt a session created by encrypt

decrypt
TLSSession decrypt(Vector!ubyte ctext, SymmetricKey key)

Decrypt a session created by encrypt

Meta