Bouncy Castle Cryptography Library 1.49

org.bouncycastle.crypto.tls
Class AbstractTlsServer

java.lang.Object
  extended by org.bouncycastle.crypto.tls.AbstractTlsPeer
      extended by org.bouncycastle.crypto.tls.AbstractTlsServer
All Implemented Interfaces:
TlsPeer, TlsServer
Direct Known Subclasses:
DefaultTlsServer

public abstract class AbstractTlsServer
extends AbstractTlsPeer
implements TlsServer


Field Summary
protected  TlsCipherFactory cipherFactory
           
protected  short[] clientECPointFormats
           
protected  java.util.Hashtable clientExtensions
           
protected  ProtocolVersion clientVersion
           
protected  TlsServerContext context
           
protected  boolean eccCipherSuitesOffered
           
protected  int[] namedCurves
           
protected  int[] offeredCipherSuites
           
protected  short[] offeredCompressionMethods
           
protected  int selectedCipherSuite
           
protected  short selectedCompressionMethod
           
protected  short[] serverECPointFormats
           
protected  java.util.Hashtable serverExtensions
           
protected  ProtocolVersion serverVersion
           
protected  java.util.Vector supportedSignatureAlgorithms
           
 
Constructor Summary
AbstractTlsServer()
           
AbstractTlsServer(TlsCipherFactory cipherFactory)
           
 
Method Summary
 CertificateRequest getCertificateRequest()
           
protected abstract  int[] getCipherSuites()
           
 TlsCompression getCompression()
           
protected  short[] getCompressionMethods()
           
protected  ProtocolVersion getMaximumVersion()
           
protected  ProtocolVersion getMinimumVersion()
           
 NewSessionTicket getNewSessionTicket()
          RFC 5077 3.3.
 int getSelectedCipherSuite()
           
 short getSelectedCompressionMethod()
           
 java.util.Hashtable getServerExtensions()
           
 java.util.Vector getServerSupplementalData()
           
 ProtocolVersion getServerVersion()
           
 void init(TlsServerContext context)
           
 void notifyClientCertificate(Certificate clientCertificate)
          Called by the protocol handler to report the client certificate, only if a Certificate TlsServer.getCertificateRequest() returned non-null.
 void notifyClientVersion(ProtocolVersion clientVersion)
           
 void notifyHandshakeComplete()
           
 void notifyOfferedCipherSuites(int[] offeredCipherSuites)
           
 void notifyOfferedCompressionMethods(short[] offeredCompressionMethods)
           
 void notifySecureRenegotiation(boolean secureRenegotiation)
           
 void processClientExtensions(java.util.Hashtable clientExtensions)
           
 void processClientSupplementalData(java.util.Vector clientSupplementalData)
           
protected  boolean supportsClientECCCapabilities(int[] namedCurves, short[] ecPointFormats)
           
 
Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsPeer
notifyAlertRaised, notifyAlertReceived
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.bouncycastle.crypto.tls.TlsServer
getCipher, getCredentials, getKeyExchange
 
Methods inherited from interface org.bouncycastle.crypto.tls.TlsPeer
notifyAlertRaised, notifyAlertReceived
 

Field Detail

cipherFactory

protected TlsCipherFactory cipherFactory

context

protected TlsServerContext context

clientVersion

protected ProtocolVersion clientVersion

offeredCipherSuites

protected int[] offeredCipherSuites

offeredCompressionMethods

protected short[] offeredCompressionMethods

clientExtensions

protected java.util.Hashtable clientExtensions

supportedSignatureAlgorithms

protected java.util.Vector supportedSignatureAlgorithms

eccCipherSuitesOffered

protected boolean eccCipherSuitesOffered

namedCurves

protected int[] namedCurves

clientECPointFormats

protected short[] clientECPointFormats

serverECPointFormats

protected short[] serverECPointFormats

serverVersion

protected ProtocolVersion serverVersion

selectedCipherSuite

protected int selectedCipherSuite

selectedCompressionMethod

protected short selectedCompressionMethod

serverExtensions

protected java.util.Hashtable serverExtensions
Constructor Detail

AbstractTlsServer

public AbstractTlsServer()

AbstractTlsServer

public AbstractTlsServer(TlsCipherFactory cipherFactory)
Method Detail

getCipherSuites

protected abstract int[] getCipherSuites()

getCompressionMethods

protected short[] getCompressionMethods()

getMaximumVersion

protected ProtocolVersion getMaximumVersion()

getMinimumVersion

protected ProtocolVersion getMinimumVersion()

supportsClientECCCapabilities

protected boolean supportsClientECCCapabilities(int[] namedCurves,
                                                short[] ecPointFormats)

init

public void init(TlsServerContext context)
Specified by:
init in interface TlsServer

notifyClientVersion

public void notifyClientVersion(ProtocolVersion clientVersion)
                         throws java.io.IOException
Specified by:
notifyClientVersion in interface TlsServer
Throws:
java.io.IOException

notifyOfferedCipherSuites

public void notifyOfferedCipherSuites(int[] offeredCipherSuites)
                               throws java.io.IOException
Specified by:
notifyOfferedCipherSuites in interface TlsServer
Throws:
java.io.IOException

notifyOfferedCompressionMethods

public void notifyOfferedCompressionMethods(short[] offeredCompressionMethods)
                                     throws java.io.IOException
Specified by:
notifyOfferedCompressionMethods in interface TlsServer
Throws:
java.io.IOException

notifySecureRenegotiation

public void notifySecureRenegotiation(boolean secureRenegotiation)
                               throws java.io.IOException
Specified by:
notifySecureRenegotiation in interface TlsServer
Throws:
java.io.IOException

processClientExtensions

public void processClientExtensions(java.util.Hashtable clientExtensions)
                             throws java.io.IOException
Specified by:
processClientExtensions in interface TlsServer
Throws:
java.io.IOException

getServerVersion

public ProtocolVersion getServerVersion()
                                 throws java.io.IOException
Specified by:
getServerVersion in interface TlsServer
Throws:
java.io.IOException

getSelectedCipherSuite

public int getSelectedCipherSuite()
                           throws java.io.IOException
Specified by:
getSelectedCipherSuite in interface TlsServer
Throws:
java.io.IOException

getSelectedCompressionMethod

public short getSelectedCompressionMethod()
                                   throws java.io.IOException
Specified by:
getSelectedCompressionMethod in interface TlsServer
Throws:
java.io.IOException

getServerExtensions

public java.util.Hashtable getServerExtensions()
                                        throws java.io.IOException
Specified by:
getServerExtensions in interface TlsServer
Throws:
java.io.IOException

getServerSupplementalData

public java.util.Vector getServerSupplementalData()
                                           throws java.io.IOException
Specified by:
getServerSupplementalData in interface TlsServer
Throws:
java.io.IOException

getCertificateRequest

public CertificateRequest getCertificateRequest()
Specified by:
getCertificateRequest in interface TlsServer

processClientSupplementalData

public void processClientSupplementalData(java.util.Vector clientSupplementalData)
                                   throws java.io.IOException
Specified by:
processClientSupplementalData in interface TlsServer
Throws:
java.io.IOException

notifyClientCertificate

public void notifyClientCertificate(Certificate clientCertificate)
                             throws java.io.IOException
Description copied from interface: TlsServer
Called by the protocol handler to report the client certificate, only if a Certificate TlsServer.getCertificateRequest() returned non-null. Note: this method is responsible for certificate verification and validation.

Specified by:
notifyClientCertificate in interface TlsServer
Parameters:
clientCertificate - the effective client certificate (may be an empty chain).
Throws:
java.io.IOException

getCompression

public TlsCompression getCompression()
                              throws java.io.IOException
Specified by:
getCompression in interface TlsServer
Throws:
java.io.IOException

getNewSessionTicket

public NewSessionTicket getNewSessionTicket()
                                     throws java.io.IOException
Description copied from interface: TlsServer
RFC 5077 3.3. NewSessionTicket Handshake Message.

This method will be called (only) if a NewSessionTicket extension was sent by the server. See RFC 5077 4. Recommended Ticket Construction for recommended format and protection.

Specified by:
getNewSessionTicket in interface TlsServer
Returns:
The ticket.
Throws:
java.io.IOException

notifyHandshakeComplete

public void notifyHandshakeComplete()
                             throws java.io.IOException
Specified by:
notifyHandshakeComplete in interface TlsServer
Throws:
java.io.IOException

Bouncy Castle Cryptography Library 1.49