Bouncy Castle Cryptography Library 1.64

org.bouncycastle.crypto.tls.test
Class MockDTLSClient

java.lang.Object
  extended byorg.bouncycastle.crypto.tls.AbstractTlsPeer
      extended byorg.bouncycastle.crypto.tls.AbstractTlsClient
          extended byorg.bouncycastle.crypto.tls.DefaultTlsClient
              extended byorg.bouncycastle.crypto.tls.test.MockDTLSClient
All Implemented Interfaces:
TlsClient, TlsPeer

public class MockDTLSClient
extends DefaultTlsClient


Field Summary
protected  TlsSession session
           
 
Fields inherited from class org.bouncycastle.crypto.tls.DefaultTlsClient
dhVerifier
 
Fields inherited from class org.bouncycastle.crypto.tls.AbstractTlsClient
cipherFactory, clientECPointFormats, context, namedCurves, selectedCipherSuite, selectedCompressionMethod, serverECPointFormats, supportedSignatureAlgorithms
 
Constructor Summary
MockDTLSClient(TlsSession session)
           
 
Method Summary
 TlsAuthentication getAuthentication()
           
 java.util.Hashtable getClientExtensions()
           
 ProtocolVersion getClientVersion()
           
 ProtocolVersion getMinimumVersion()
           
 TlsSession getSessionToResume()
          Return the session this client wants to resume, if any.
 void notifyAlertRaised(short alertLevel, short alertDescription, java.lang.String message, java.lang.Throwable 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 notifyHandshakeComplete()
          Notifies the peer that the handshake has been successfully completed.
 void notifyServerVersion(ProtocolVersion serverVersion)
           
 
Methods inherited from class org.bouncycastle.crypto.tls.DefaultTlsClient
createDHEKeyExchange, createDHKeyExchange, createECDHEKeyExchange, createECDHKeyExchange, createRSAKeyExchange, getCipherSuites, getKeyExchange
 
Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsClient
allowUnexpectedServerExtension, checkForUnexpectedServerExtension, getCipher, getClientHelloRecordLayerVersion, getClientSupplementalData, getCompression, getCompressionMethods, init, isFallback, notifyNewSessionTicket, notifySelectedCipherSuite, notifySelectedCompressionMethod, notifySessionID, processServerExtensions, processServerSupplementalData
 
Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsPeer
cancel, notifyCloseHandle, notifySecureRenegotiation, requiresExtendedMasterSecret, 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
cancel, notifyCloseHandle, notifySecureRenegotiation, requiresExtendedMasterSecret, shouldUseGMTUnixTime
 

Field Detail

session

protected TlsSession session
Constructor Detail

MockDTLSClient

public MockDTLSClient(TlsSession session)
Method Detail

getSessionToResume

public TlsSession getSessionToResume()
Description copied from interface: TlsClient
Return the session this client wants to resume, if any. Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated.

Specified by:
getSessionToResume in interface TlsClient
Overrides:
getSessionToResume in class AbstractTlsClient

notifyAlertRaised

public void notifyAlertRaised(short alertLevel,
                              short alertDescription,
                              java.lang.String message,
                              java.lang.Throwable 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

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

getClientVersion

public ProtocolVersion getClientVersion()
Specified by:
getClientVersion in interface TlsClient
Overrides:
getClientVersion in class AbstractTlsClient

getMinimumVersion

public ProtocolVersion getMinimumVersion()
Overrides:
getMinimumVersion in class AbstractTlsClient

getClientExtensions

public java.util.Hashtable getClientExtensions()
                                        throws java.io.IOException
Specified by:
getClientExtensions in interface TlsClient
Overrides:
getClientExtensions in class AbstractTlsClient
Throws:
java.io.IOException

notifyServerVersion

public void notifyServerVersion(ProtocolVersion serverVersion)
                         throws java.io.IOException
Specified by:
notifyServerVersion in interface TlsClient
Overrides:
notifyServerVersion in class AbstractTlsClient
Throws:
java.io.IOException

getAuthentication

public TlsAuthentication getAuthentication()
                                    throws java.io.IOException
Throws:
java.io.IOException

notifyHandshakeComplete

public void notifyHandshakeComplete()
                             throws java.io.IOException
Description copied from interface: TlsPeer
Notifies the peer that the handshake has been successfully completed.

Specified by:
notifyHandshakeComplete in interface TlsPeer
Overrides:
notifyHandshakeComplete in class AbstractTlsPeer
Throws:
java.io.IOException

Bouncy Castle Cryptography Library 1.64