Package org.bouncycastle.crypto.tls
Class TlsServerProtocol
- java.lang.Object
-
- org.bouncycastle.crypto.tls.TlsProtocol
-
- org.bouncycastle.crypto.tls.TlsServerProtocol
-
- All Implemented Interfaces:
TlsCloseable
public class TlsServerProtocol extends TlsProtocol
Deprecated.Migrate to the (D)TLS API in org.bouncycastle.tls (bctls jar).
-
-
Field Summary
Fields Modifier and Type Field Description protected CertificateRequest
certificateRequest
Deprecated.protected short
clientCertificateType
Deprecated.protected TlsKeyExchange
keyExchange
Deprecated.protected TlsHandshakeHash
prepareFinishHash
Deprecated.protected TlsCredentials
serverCredentials
Deprecated.protected TlsServer
tlsServer
Deprecated.-
Fields inherited from class org.bouncycastle.crypto.tls.TlsProtocol
ADS_MODE_0_N, ADS_MODE_0_N_FIRSTONLY, ADS_MODE_1_Nsub1, allowCertificateStatus, blocking, clientExtensions, connection_state, CS_CERTIFICATE_REQUEST, CS_CERTIFICATE_STATUS, CS_CERTIFICATE_VERIFY, CS_CLIENT_CERTIFICATE, CS_CLIENT_FINISHED, CS_CLIENT_HELLO, CS_CLIENT_KEY_EXCHANGE, CS_CLIENT_SUPPLEMENTAL_DATA, CS_END, CS_SERVER_CERTIFICATE, CS_SERVER_FINISHED, CS_SERVER_HELLO, CS_SERVER_HELLO_DONE, CS_SERVER_KEY_EXCHANGE, CS_SERVER_SESSION_TICKET, CS_SERVER_SUPPLEMENTAL_DATA, CS_START, expectSessionTicket, EXT_RenegotiationInfo, EXT_SessionTicket, inputBuffers, offeredCipherSuites, offeredCompressionMethods, outputBuffer, peerCertificate, receivedChangeCipherSpec, resumedSession, secure_renegotiation, secureRandom, securityParameters, serverExtensions, sessionParameters, tlsSession
-
-
Constructor Summary
Constructors Constructor Description TlsServerProtocol(java.io.InputStream input, java.io.OutputStream output, java.security.SecureRandom secureRandom)
Deprecated.Constructor for blocking mode.TlsServerProtocol(java.security.SecureRandom secureRandom)
Deprecated.Constructor for non-blocking mode.
When data is received, useTlsProtocol.offerInput(byte[])
to provide the received ciphertext, then useTlsProtocol.readInput(byte[], int, int)
to read the corresponding cleartext.
Similarly, when data needs to be sent, useTlsProtocol.offerOutput(byte[], int, int)
to provide the cleartext, then useTlsProtocol.readOutput(byte[], int, int)
to get the corresponding ciphertext.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
accept(TlsServer tlsServer)
Deprecated.Receives a TLS handshake in the role of server.
In blocking mode, this will not return until the handshake is complete.protected void
cleanupHandshake()
Deprecated.protected boolean
expectCertificateVerifyMessage()
Deprecated.protected TlsContext
getContext()
Deprecated.protected TlsPeer
getPeer()
Deprecated.protected void
handleAlertWarningMessage(short alertDescription)
Deprecated.protected void
handleHandshakeMessage(short type, java.io.ByteArrayInputStream buf)
Deprecated.protected void
notifyClientCertificate(Certificate clientCertificate)
Deprecated.protected void
receiveCertificateMessage(java.io.ByteArrayInputStream buf)
Deprecated.protected void
receiveCertificateVerifyMessage(java.io.ByteArrayInputStream buf)
Deprecated.protected void
receiveClientHelloMessage(java.io.ByteArrayInputStream buf)
Deprecated.protected void
receiveClientKeyExchangeMessage(java.io.ByteArrayInputStream buf)
Deprecated.protected void
sendCertificateRequestMessage(CertificateRequest certificateRequest)
Deprecated.protected void
sendCertificateStatusMessage(CertificateStatus certificateStatus)
Deprecated.protected void
sendNewSessionTicketMessage(NewSessionTicket newSessionTicket)
Deprecated.protected void
sendServerHelloDoneMessage()
Deprecated.protected void
sendServerHelloMessage()
Deprecated.protected void
sendServerKeyExchangeMessage(byte[] serverKeyExchange)
Deprecated.-
Methods inherited from class org.bouncycastle.crypto.tls.TlsProtocol
applicationDataAvailable, applyMaxFragmentLengthExtension, assertEmpty, blockForHandshake, checkReceivedChangeCipherSpec, close, closeInput, completeHandshake, createRandomBlock, createRenegotiationInfo, createVerifyData, establishMasterSecret, flush, getAvailableInputBytes, getAvailableOutputBytes, getCurrentPRFHash, getInputStream, getOutputStream, getPRFAlgorithm, handleAlertMessage, handleChangeCipherSpecMessage, handleClose, handleException, handleFailure, invalidateSession, isClosed, offerInput, offerInput, offerOutput, processFinishedMessage, processMaxFragmentLengthExtension, processRecord, raiseAlertFatal, raiseAlertWarning, readApplicationData, readExtensions, readInput, readOutput, readSupplementalDataMessage, refuseRenegotiation, safeCheckRecordHeader, safeReadRecord, safeWriteRecord, sendCertificateMessage, sendChangeCipherSpecMessage, sendFinishedMessage, sendSupplementalDataMessage, setAppDataSplitMode, writeData, writeExtensions, writeHandshakeMessage, writeSelectedExtensions, writeSupplementalData
-
-
-
-
Field Detail
-
tlsServer
protected TlsServer tlsServer
Deprecated.
-
keyExchange
protected TlsKeyExchange keyExchange
Deprecated.
-
serverCredentials
protected TlsCredentials serverCredentials
Deprecated.
-
certificateRequest
protected CertificateRequest certificateRequest
Deprecated.
-
clientCertificateType
protected short clientCertificateType
Deprecated.
-
prepareFinishHash
protected TlsHandshakeHash prepareFinishHash
Deprecated.
-
-
Constructor Detail
-
TlsServerProtocol
public TlsServerProtocol(java.io.InputStream input, java.io.OutputStream output, java.security.SecureRandom secureRandom)
Deprecated.Constructor for blocking mode.- Parameters:
input
- The stream of data from the clientoutput
- The stream of data to the clientsecureRandom
- Random number generator for various cryptographic functions
-
TlsServerProtocol
public TlsServerProtocol(java.security.SecureRandom secureRandom)
Deprecated.Constructor for non-blocking mode.
When data is received, useTlsProtocol.offerInput(byte[])
to provide the received ciphertext, then useTlsProtocol.readInput(byte[], int, int)
to read the corresponding cleartext.
Similarly, when data needs to be sent, useTlsProtocol.offerOutput(byte[], int, int)
to provide the cleartext, then useTlsProtocol.readOutput(byte[], int, int)
to get the corresponding ciphertext.- Parameters:
secureRandom
- Random number generator for various cryptographic functions
-
-
Method Detail
-
accept
public void accept(TlsServer tlsServer) throws java.io.IOException
Deprecated.Receives a TLS handshake in the role of server.
In blocking mode, this will not return until the handshake is complete. In non-blocking mode, useTlsPeer.notifyHandshakeComplete()
to receive a callback when the handshake is complete.- Parameters:
tlsServer
-- Throws:
java.io.IOException
- If in blocking mode and handshake was not successful.
-
cleanupHandshake
protected void cleanupHandshake()
Deprecated.- Overrides:
cleanupHandshake
in classTlsProtocol
-
getContext
protected TlsContext getContext()
Deprecated.- Specified by:
getContext
in classTlsProtocol
-
getPeer
protected TlsPeer getPeer()
Deprecated.- Specified by:
getPeer
in classTlsProtocol
-
handleHandshakeMessage
protected void handleHandshakeMessage(short type, java.io.ByteArrayInputStream buf) throws java.io.IOException
Deprecated.- Specified by:
handleHandshakeMessage
in classTlsProtocol
- Throws:
java.io.IOException
-
handleAlertWarningMessage
protected void handleAlertWarningMessage(short alertDescription) throws java.io.IOException
Deprecated.- Overrides:
handleAlertWarningMessage
in classTlsProtocol
- Throws:
java.io.IOException
-
notifyClientCertificate
protected void notifyClientCertificate(Certificate clientCertificate) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
receiveCertificateMessage
protected void receiveCertificateMessage(java.io.ByteArrayInputStream buf) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
receiveCertificateVerifyMessage
protected void receiveCertificateVerifyMessage(java.io.ByteArrayInputStream buf) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
receiveClientHelloMessage
protected void receiveClientHelloMessage(java.io.ByteArrayInputStream buf) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
receiveClientKeyExchangeMessage
protected void receiveClientKeyExchangeMessage(java.io.ByteArrayInputStream buf) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendCertificateRequestMessage
protected void sendCertificateRequestMessage(CertificateRequest certificateRequest) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendCertificateStatusMessage
protected void sendCertificateStatusMessage(CertificateStatus certificateStatus) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendNewSessionTicketMessage
protected void sendNewSessionTicketMessage(NewSessionTicket newSessionTicket) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendServerHelloMessage
protected void sendServerHelloMessage() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendServerHelloDoneMessage
protected void sendServerHelloDoneMessage() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
sendServerKeyExchangeMessage
protected void sendServerKeyExchangeMessage(byte[] serverKeyExchange) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
expectCertificateVerifyMessage
protected boolean expectCertificateVerifyMessage()
Deprecated.
-
-