Class TlsServerProtocol
- Namespace
- Org.BouncyCastle.Tls
- Assembly
- BouncyCastle.Cryptography.dll
public class TlsServerProtocol : TlsProtocol, TlsCloseable
- Inheritance
-
TlsServerProtocol
- Implements
- Inherited Members
Constructors
TlsServerProtocol()
Constructor for non-blocking mode.
public TlsServerProtocol()
Remarks
When data is received, use OfferInput(byte[]) to provide the received ciphertext,
then use ReadInput(byte[], int, int) to read the corresponding cleartext.
Similarly, when data needs to be sent, use WriteApplicationData(byte[], int, int)
to provide the cleartext, then use ReadOutput(byte[], int, int) to get the
corresponding ciphertext.
TlsServerProtocol(Stream)
Constructor for blocking mode.
public TlsServerProtocol(Stream stream)
Parameters
TlsServerProtocol(Stream, Stream)
Constructor for blocking mode.
public TlsServerProtocol(Stream input, Stream output)
Parameters
Fields
m_certificateRequest
protected CertificateRequest m_certificateRequest
Field Value
m_keyExchange
protected TlsKeyExchange m_keyExchange
Field Value
m_offeredCipherSuites
protected int[] m_offeredCipherSuites
Field Value
- int[]
m_tlsServer
protected TlsServer m_tlsServer
Field Value
Properties
Context
protected override TlsContext Context { get; }
Property Value
Peer
protected override TlsPeer Peer { get; }
Property Value
Methods
Accept(TlsServer)
Receives a TLS handshake in the role of server.
public void Accept(TlsServer tlsServer)
Parameters
Remarks
In blocking mode, this will not return until the handshake is complete. In non-blocking mode, use NotifyHandshakeComplete() to receive a callback when the handshake is complete.
Exceptions
- IOException
If in blocking mode and handshake was not successful.
CleanupHandshake()
protected override void CleanupHandshake()
ExpectCertificateVerifyMessage()
protected virtual bool ExpectCertificateVerifyMessage()
Returns
Generate13HelloRetryRequest(ClientHello)
protected virtual ServerHello Generate13HelloRetryRequest(ClientHello clientHello)
Parameters
clientHelloClientHello
Returns
Exceptions
Generate13ServerHello(ClientHello, HandshakeMessageInput, bool)
protected virtual ServerHello Generate13ServerHello(ClientHello clientHello, HandshakeMessageInput clientHelloMessage, bool afterHelloRetryRequest)
Parameters
clientHelloClientHelloclientHelloMessageHandshakeMessageInputafterHelloRetryRequestbool
Returns
Exceptions
GenerateServerHello(ClientHello, HandshakeMessageInput)
protected virtual ServerHello GenerateServerHello(ClientHello clientHello, HandshakeMessageInput clientHelloMessage)
Parameters
clientHelloClientHelloclientHelloMessageHandshakeMessageInput
Returns
Exceptions
Handle13HandshakeMessage(short, HandshakeMessageInput)
protected virtual void Handle13HandshakeMessage(short type, HandshakeMessageInput buf)
Parameters
typeshortbufHandshakeMessageInput
Exceptions
HandleAlertWarningMessage(short)
protected override void HandleAlertWarningMessage(short alertDescription)
Parameters
alertDescriptionshort
Exceptions
HandleHandshakeMessage(short, HandshakeMessageInput)
protected override void HandleHandshakeMessage(short type, HandshakeMessageInput buf)
Parameters
typeshortbufHandshakeMessageInput
Exceptions
NotifyClientCertificate(Certificate)
protected virtual void NotifyClientCertificate(Certificate clientCertificate)
Parameters
clientCertificateCertificate
Exceptions
Receive13ClientCertificate(MemoryStream)
protected virtual void Receive13ClientCertificate(MemoryStream buf)
Parameters
bufMemoryStream
Exceptions
Receive13ClientCertificateVerify(MemoryStream)
protected void Receive13ClientCertificateVerify(MemoryStream buf)
Parameters
bufMemoryStream
Exceptions
Receive13ClientFinished(MemoryStream)
protected virtual void Receive13ClientFinished(MemoryStream buf)
Parameters
bufMemoryStream
Exceptions
ReceiveCertificateMessage(MemoryStream)
protected virtual void ReceiveCertificateMessage(MemoryStream buf)
Parameters
bufMemoryStream
Exceptions
ReceiveCertificateVerifyMessage(MemoryStream)
protected virtual void ReceiveCertificateVerifyMessage(MemoryStream buf)
Parameters
bufMemoryStream
Exceptions
ReceiveClientHelloMessage(MemoryStream)
protected virtual ClientHello ReceiveClientHelloMessage(MemoryStream buf)
Parameters
bufMemoryStream
Returns
Exceptions
ReceiveClientKeyExchangeMessage(MemoryStream)
protected virtual void ReceiveClientKeyExchangeMessage(MemoryStream buf)
Parameters
bufMemoryStream
Exceptions
Send13EncryptedExtensionsMessage(IDictionary<int, byte[]>)
protected virtual void Send13EncryptedExtensionsMessage(IDictionary<int, byte[]> serverExtensions)
Parameters
serverExtensionsIDictionary<int, byte[]>
Exceptions
Send13ServerHelloCoda(ServerHello, bool)
protected virtual void Send13ServerHelloCoda(ServerHello serverHello, bool afterHelloRetryRequest)
Parameters
serverHelloServerHelloafterHelloRetryRequestbool
Exceptions
SendCertificateRequestMessage(CertificateRequest)
protected virtual void SendCertificateRequestMessage(CertificateRequest certificateRequest)
Parameters
certificateRequestCertificateRequest
Exceptions
SendCertificateStatusMessage(CertificateStatus)
protected virtual void SendCertificateStatusMessage(CertificateStatus certificateStatus)
Parameters
certificateStatusCertificateStatus
Exceptions
SendHelloRequestMessage()
protected virtual void SendHelloRequestMessage()
Exceptions
SendNewSessionTicketMessage(NewSessionTicket)
protected virtual void SendNewSessionTicketMessage(NewSessionTicket newSessionTicket)
Parameters
newSessionTicketNewSessionTicket
Exceptions
SendServerHelloDoneMessage()
protected virtual void SendServerHelloDoneMessage()
Exceptions
SendServerHelloMessage(ServerHello)
protected virtual void SendServerHelloMessage(ServerHello serverHello)
Parameters
serverHelloServerHello
Exceptions
SendServerKeyExchangeMessage(byte[])
protected virtual void SendServerKeyExchangeMessage(byte[] serverKeyExchange)
Parameters
serverKeyExchangebyte[]
Exceptions
Skip13ClientCertificate()
protected virtual void Skip13ClientCertificate()
Exceptions
Skip13ClientCertificateVerify()
protected virtual void Skip13ClientCertificateVerify()