org.bouncycastle.crypto.tls.test
Class MockDTLSClient
java.lang.Object
org.bouncycastle.crypto.tls.AbstractTlsPeer
org.bouncycastle.crypto.tls.AbstractTlsClient
org.bouncycastle.crypto.tls.DefaultTlsClient
org.bouncycastle.crypto.tls.test.MockDTLSClient
- All Implemented Interfaces:
- TlsClient, TlsPeer
public class MockDTLSClient
- extends DefaultTlsClient
| Methods inherited from class org.bouncycastle.crypto.tls.AbstractTlsClient |
getClientHelloRecordLayerVersion, getClientSupplementalData, getCompression, getCompressionMethods, init, notifyNewSessionTicket, notifySelectedCipherSuite, notifySelectedCompressionMethod, notifySessionID, processServerExtensions, processServerSupplementalData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
protected TlsSession session
MockDTLSClient
public MockDTLSClient(TlsSession session)
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
- Returns:
- A
TlsSession representing the resumable session to be used for this
connection, or null to use a new session. - See Also:
SessionParameters.getPeerCertificate()
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 - AlertLevelalertDescription - AlertDescriptionmessage - 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 - AlertLevelalertDescription - AlertDescription
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