-
- All Superinterfaces:
MessageProcessor,TlsEngine,TrafficSecrets
- All Known Implementing Classes:
TlsServerEngineImpl
public interface TlsServerEngine extends TlsEngine
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddServerExtensions(Extension extension)Adds extension to the list of extensions to be included in the EncryptedExtensions message.voidaddSupportedCiphers(java.util.List<TlsConstants.CipherSuite> cipherSuites)Adds ciphers to the list of the symmetric cipher options supported by the server (specifically the record protection algorithm (including secret key length) and a hash to be used with HKDF), in descending order of server preference.TlsConstants.CipherSuitegetSelectedCipher()Get the selected (negotiated) cipher suite.java.util.List<Extension>getServerExtensions()Returns the list of extensions actually included in the EncryptedExtensions message.voidreceived(ClientHello clientHello, ProtectionKeysType protectedBy)voidreceived(FinishedMessage clientFinished, ProtectionKeysType protectedBy)voidsetSelectedApplicationLayerProtocol(java.lang.String applicationProtocol)Sets the negotiated application layer protocol.voidsetServerMessageSender(ServerMessageSender serverMessageSender)Sets the callback used for sending server messages (to the client).voidsetSessionData(byte[] additionalSessionData)Set (other layer's) session data for this session.voidsetSessionDataVerificationCallback(java.util.function.Function<java.nio.ByteBuffer,java.lang.Boolean> callback)Set the callback that is called before a session is (successfully) resumed.voidsetStatusHandler(TlsStatusEventHandler statusHandler)Sets the callback used for notifying the status of the TLS connection.-
Methods inherited from interface net.luminis.tls.engine.MessageProcessor
received, received, received, received, received, received
-
Methods inherited from interface net.luminis.tls.engine.TrafficSecrets
getClientApplicationTrafficSecret, getClientEarlyTrafficSecret, getClientHandshakeTrafficSecret, getServerApplicationTrafficSecret, getServerHandshakeTrafficSecret
-
-
-
-
Method Detail
-
addSupportedCiphers
void addSupportedCiphers(java.util.List<TlsConstants.CipherSuite> cipherSuites)
Adds ciphers to the list of the symmetric cipher options supported by the server (specifically the record protection algorithm (including secret key length) and a hash to be used with HKDF), in descending order of server preference. By default, the server supports TLS_AES_128_GCM_SHA256.- Parameters:
cipherSuites-
-
setSelectedApplicationLayerProtocol
void setSelectedApplicationLayerProtocol(java.lang.String applicationProtocol)
Sets the negotiated application layer protocol.- Parameters:
applicationProtocol-
-
addServerExtensions
void addServerExtensions(Extension extension)
Adds extension to the list of extensions to be included in the EncryptedExtensions message.- Parameters:
extension-
-
setServerMessageSender
void setServerMessageSender(ServerMessageSender serverMessageSender)
Sets the callback used for sending server messages (to the client).- Parameters:
serverMessageSender-
-
setStatusHandler
void setStatusHandler(TlsStatusEventHandler statusHandler)
Sets the callback used for notifying the status of the TLS connection.- Parameters:
statusHandler-
-
setSessionDataVerificationCallback
void setSessionDataVerificationCallback(java.util.function.Function<java.nio.ByteBuffer,java.lang.Boolean> callback)
Set the callback that is called before a session is (successfully) resumed. If there is no data associated with the session, the callback is not called and verification is assumed to be successful, i.e. the session will be resumed.- Parameters:
callback- the callback that is called with the stored session data; when the callback returns false the session will not be resumed.
-
getSelectedCipher
TlsConstants.CipherSuite getSelectedCipher()
Get the selected (negotiated) cipher suite.- Returns:
-
getServerExtensions
java.util.List<Extension> getServerExtensions()
Returns the list of extensions actually included in the EncryptedExtensions message.- Returns:
-
setSessionData
void setSessionData(byte[] additionalSessionData)
Set (other layer's) session data for this session. When this session is resumed (with a session ticket), this data will be provided to the session data verification callback, which enables the application layer to accept or deny the session resumption based on the data stored in the session. For example, with QUIC this is used to store the QUIC version in the session data, so when the session is resumed, the QUIC layer can verify the same QUIC version is used.- Parameters:
additionalSessionData-
-
received
void received(ClientHello clientHello, ProtectionKeysType protectedBy) throws TlsProtocolException, java.io.IOException
- Specified by:
receivedin interfaceMessageProcessor- Throws:
TlsProtocolExceptionjava.io.IOException
-
received
void received(FinishedMessage clientFinished, ProtectionKeysType protectedBy) throws TlsProtocolException, java.io.IOException
- Specified by:
receivedin interfaceMessageProcessor- Throws:
TlsProtocolExceptionjava.io.IOException
-
-