Bouncy Castle Cryptography Library 1.49

org.bouncycastle.crypto.tls
Class TlsServerProtocol

java.lang.Object
  extended by org.bouncycastle.crypto.tls.TlsProtocol
      extended by org.bouncycastle.crypto.tls.TlsServerProtocol

public class TlsServerProtocol
extends TlsProtocol


Field Summary
protected  CertificateRequest certificateRequest
           
protected  byte[] certificateVerifyHash
           
protected  Certificate clientCertificate
           
protected  short clientCertificateType
           
protected  java.util.Hashtable clientExtensions
           
protected  TlsKeyExchange keyExchange
           
protected  int[] offeredCipherSuites
           
protected  short[] offeredCompressionMethods
           
protected  int selectedCipherSuite
           
protected  short selectedCompressionMethod
           
protected  TlsCredentials serverCredentials
           
protected  java.util.Hashtable serverExtensions
           
protected  TlsServer tlsServer
           
protected  org.bouncycastle.crypto.tls.TlsServerContextImpl tlsServerContext
           
 
Fields inherited from class org.bouncycastle.crypto.tls.TlsProtocol
connection_state, CS_CERTIFICATE_REQUEST, CS_CERTIFICATE_VERIFY, CS_CLIENT_CERTIFICATE, CS_CLIENT_CHANGE_CIPHER_SPEC, CS_CLIENT_FINISHED, CS_CLIENT_HELLO, CS_CLIENT_KEY_EXCHANGE, CS_CLIENT_SUPPLEMENTAL_DATA, CS_SERVER_CERTIFICATE, CS_SERVER_CHANGE_CIPHER_SPEC, 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, recordStream, secure_renegotiation, secureRandom, securityParameters
 
Constructor Summary
TlsServerProtocol(java.io.InputStream input, java.io.OutputStream output, java.security.SecureRandom secureRandom)
           
 
Method Summary
 void accept(TlsServer tlsServer)
          Receives a TLS handshake in the role of server
protected  boolean expectCertificateVerifyMessage()
           
protected  org.bouncycastle.crypto.tls.AbstractTlsContext getContext()
           
protected  TlsPeer getPeer()
           
protected  void handleChangeCipherSpecMessage()
           
protected  void handleHandshakeMessage(short type, byte[] data)
           
protected  void handleWarningMessage(short description)
           
protected  void notifyClientCertificate(Certificate clientCertificate)
           
protected  void receiveCertificateMessage(java.io.ByteArrayInputStream buf)
           
protected  void receiveCertificateVerifyMessage(java.io.ByteArrayInputStream buf)
           
protected  void receiveClientHelloMessage(java.io.ByteArrayInputStream buf)
           
protected  void receiveClientKeyExchangeMessage(java.io.ByteArrayInputStream buf)
           
protected  void sendCertificateRequestMessage(CertificateRequest certificateRequest)
           
protected  void sendNewSessionTicketMessage(NewSessionTicket newSessionTicket)
           
protected  void sendServerHelloDoneMessage()
           
protected  void sendServerHelloMessage()
           
protected  void sendServerKeyExchangeMessage(byte[] serverKeyExchange)
           
 
Methods inherited from class org.bouncycastle.crypto.tls.TlsProtocol
arrayContains, arrayContains, assertEmpty, close, completeHandshake, createRandomBlock, createRenegotiationInfo, createVerifyData, establishMasterSecret, failWithError, flush, getInputStream, getOutputStream, getPRFAlgorithm, handleClose, processFinishedMessage, processRecord, raiseAlert, raiseWarning, readApplicationData, readExtensions, readSupplementalDataMessage, safeReadRecord, safeWriteRecord, sendCertificateMessage, sendChangeCipherSpecMessage, sendFinishedMessage, sendSupplementalDataMessage, writeData, writeExtensions, writeSupplementalData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tlsServer

protected TlsServer tlsServer

tlsServerContext

protected org.bouncycastle.crypto.tls.TlsServerContextImpl tlsServerContext

offeredCipherSuites

protected int[] offeredCipherSuites

offeredCompressionMethods

protected short[] offeredCompressionMethods

clientExtensions

protected java.util.Hashtable clientExtensions

selectedCipherSuite

protected int selectedCipherSuite

selectedCompressionMethod

protected short selectedCompressionMethod

serverExtensions

protected java.util.Hashtable serverExtensions

keyExchange

protected TlsKeyExchange keyExchange

serverCredentials

protected TlsCredentials serverCredentials

certificateRequest

protected CertificateRequest certificateRequest

clientCertificateType

protected short clientCertificateType

clientCertificate

protected Certificate clientCertificate

certificateVerifyHash

protected byte[] certificateVerifyHash
Constructor Detail

TlsServerProtocol

public TlsServerProtocol(java.io.InputStream input,
                         java.io.OutputStream output,
                         java.security.SecureRandom secureRandom)
Method Detail

accept

public void accept(TlsServer tlsServer)
            throws java.io.IOException
Receives a TLS handshake in the role of server

Parameters:
tlsServer -
Throws:
java.io.IOException - If handshake was not successful.

getContext

protected org.bouncycastle.crypto.tls.AbstractTlsContext getContext()
Specified by:
getContext in class TlsProtocol

getPeer

protected TlsPeer getPeer()
Specified by:
getPeer in class TlsProtocol

handleChangeCipherSpecMessage

protected void handleChangeCipherSpecMessage()
                                      throws java.io.IOException
Specified by:
handleChangeCipherSpecMessage in class TlsProtocol
Throws:
java.io.IOException

handleHandshakeMessage

protected void handleHandshakeMessage(short type,
                                      byte[] data)
                               throws java.io.IOException
Specified by:
handleHandshakeMessage in class TlsProtocol
Throws:
java.io.IOException

handleWarningMessage

protected void handleWarningMessage(short description)
                             throws java.io.IOException
Overrides:
handleWarningMessage in class TlsProtocol
Throws:
java.io.IOException

notifyClientCertificate

protected void notifyClientCertificate(Certificate clientCertificate)
                                throws java.io.IOException
Throws:
java.io.IOException

receiveCertificateMessage

protected void receiveCertificateMessage(java.io.ByteArrayInputStream buf)
                                  throws java.io.IOException
Throws:
java.io.IOException

receiveCertificateVerifyMessage

protected void receiveCertificateVerifyMessage(java.io.ByteArrayInputStream buf)
                                        throws java.io.IOException
Throws:
java.io.IOException

receiveClientHelloMessage

protected void receiveClientHelloMessage(java.io.ByteArrayInputStream buf)
                                  throws java.io.IOException
Throws:
java.io.IOException

receiveClientKeyExchangeMessage

protected void receiveClientKeyExchangeMessage(java.io.ByteArrayInputStream buf)
                                        throws java.io.IOException
Throws:
java.io.IOException

sendCertificateRequestMessage

protected void sendCertificateRequestMessage(CertificateRequest certificateRequest)
                                      throws java.io.IOException
Throws:
java.io.IOException

sendNewSessionTicketMessage

protected void sendNewSessionTicketMessage(NewSessionTicket newSessionTicket)
                                    throws java.io.IOException
Throws:
java.io.IOException

sendServerHelloMessage

protected void sendServerHelloMessage()
                               throws java.io.IOException
Throws:
java.io.IOException

sendServerHelloDoneMessage

protected void sendServerHelloDoneMessage()
                                   throws java.io.IOException
Throws:
java.io.IOException

sendServerKeyExchangeMessage

protected void sendServerKeyExchangeMessage(byte[] serverKeyExchange)
                                     throws java.io.IOException
Throws:
java.io.IOException

expectCertificateVerifyMessage

protected boolean expectCertificateVerifyMessage()

Bouncy Castle Cryptography Library 1.49