Bouncy Castle Cryptography 1.51

org.bouncycastle.crypto.tls.test
Class MockDTLSServer

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

public class MockDTLSServer
extends DefaultTlsServer


Field Summary
 
Fields inherited from class org.bouncycastle.crypto.tls.AbstractTlsServer
cipherFactory, clientECPointFormats, clientExtensions, clientVersion, context, eccCipherSuitesOffered, encryptThenMACOffered, maxFragmentLengthOffered, namedCurves, offeredCipherSuites, offeredCompressionMethods, selectedCipherSuite, selectedCompressionMethod, serverECPointFormats, serverExtensions, serverVersion, supportedSignatureAlgorithms, truncatedHMacOffered
 
Constructor Summary
MockDTLSServer()
           
 
Method Summary
 CertificateRequest getCertificateRequest()
           
protected  int[] getCipherSuites()
           
protected  ProtocolVersion getMaximumVersion()
           
protected  ProtocolVersion getMinimumVersion()
           
protected  TlsEncryptionCredentials getRSAEncryptionCredentials()
           
protected  TlsSignerCredentials getRSASignerCredentials()
           
 void notifyAlertRaised(short alertLevel, short alertDescription, java.lang.String message, java.lang.Exception cause)
          This method will be called when an alert is raised by the protocol.
 void notifyAlertReceived(short alertLevel, short alertDescription)
          This method will be called when an alert is received from the remote peer.
 void notifyClientCertificate(Certificate clientCertificate)
          Called by the protocol handler to report the client certificate, only if TlsServer.getCertificateRequest() returned non-null.
 
Methods inherited from class org.bouncycastle.crypto.tls.DefaultTlsServer
createDHEKeyExchange, createDHKeyExchange, createECDHEKeyExchange, createECDHKeyExchange, createRSAKeyExchange, getCipher, getCredentials, getDHParameters, getKeyExchange
 
Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsServer
allowEncryptThenMAC, allowTruncatedHMac, checkServerExtensions, getCertificateStatus, getCompression, getCompressionMethods, getNewSessionTicket, getSelectedCipherSuite, getSelectedCompressionMethod, getServerExtensions, getServerSupplementalData, getServerVersion, init, notifyClientVersion, notifyOfferedCipherSuites, notifyOfferedCompressionMethods, processClientExtensions, processClientSupplementalData, supportsClientECCCapabilities
 
Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsPeer
notifyHandshakeComplete, notifySecureRenegotiation, shouldUseGMTUnixTime
 
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.TlsPeer
notifyHandshakeComplete, notifySecureRenegotiation, shouldUseGMTUnixTime
 

Constructor Detail

MockDTLSServer

public MockDTLSServer()
Method Detail

notifyAlertRaised

public void notifyAlertRaised(short alertLevel,
                              short alertDescription,
                              java.lang.String message,
                              java.lang.Exception cause)
Description copied from interface: TlsPeer
This method will be called when an alert is raised by the protocol.

Specified by:
notifyAlertRaised in interface TlsPeer
Overrides:
notifyAlertRaised in class AbstractTlsPeer
Parameters:
alertLevel - AlertLevel
alertDescription - AlertDescription
message - A human-readable message explaining what caused this alert. May be null.
cause - The exception that caused this alert to be raised. May be null.

notifyAlertReceived

public void notifyAlertReceived(short alertLevel,
                                short alertDescription)
Description copied from interface: TlsPeer
This method will be called when an alert is received from the remote peer.

Specified by:
notifyAlertReceived in interface TlsPeer
Overrides:
notifyAlertReceived in class AbstractTlsPeer
Parameters:
alertLevel - AlertLevel
alertDescription - AlertDescription

getCipherSuites

protected int[] getCipherSuites()
Overrides:
getCipherSuites in class DefaultTlsServer

getCertificateRequest

public CertificateRequest getCertificateRequest()
                                         throws java.io.IOException
Specified by:
getCertificateRequest in interface TlsServer
Overrides:
getCertificateRequest in class AbstractTlsServer
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 TlsServer.getCertificateRequest() returned non-null. Note: this method is responsible for certificate verification and validation.

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

getMaximumVersion

protected ProtocolVersion getMaximumVersion()
Overrides:
getMaximumVersion in class AbstractTlsServer

getMinimumVersion

protected ProtocolVersion getMinimumVersion()
Overrides:
getMinimumVersion in class AbstractTlsServer

getRSAEncryptionCredentials

protected TlsEncryptionCredentials getRSAEncryptionCredentials()
                                                        throws java.io.IOException
Overrides:
getRSAEncryptionCredentials in class DefaultTlsServer
Throws:
java.io.IOException

getRSASignerCredentials

protected TlsSignerCredentials getRSASignerCredentials()
                                                throws java.io.IOException
Overrides:
getRSASignerCredentials in class DefaultTlsServer
Throws:
java.io.IOException

Bouncy Castle Cryptography 1.51