Package 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
-
public class MockDTLSClient extends DefaultTlsClient
-
-
Field Summary
Fields Modifier and Type Field Description protected TlsSessionsession-
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
Constructors Constructor Description MockDTLSClient(TlsSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsAuthenticationgetAuthentication()java.util.HashtablegetClientExtensions()ProtocolVersiongetClientVersion()ProtocolVersiongetMinimumVersion()TlsSessiongetSessionToResume()Return the session this client wants to resume, if any.voidnotifyAlertRaised(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.voidnotifyAlertReceived(short alertLevel, short alertDescription)This method will be called when an alert is received from the remote peer.voidnotifyHandshakeComplete()Notifies the peer that the handshake has been successfully completed.voidnotifyServerVersion(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
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
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:TlsClientReturn 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:
getSessionToResumein interfaceTlsClient- Overrides:
getSessionToResumein classAbstractTlsClient- Returns:
- A
TlsSessionrepresenting 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.Throwable cause)Description copied from interface:TlsPeerThis method will be called when an alert is raised by the protocol.- Specified by:
notifyAlertRaisedin interfaceTlsPeer- Overrides:
notifyAlertRaisedin classAbstractTlsPeer- Parameters:
alertLevel-AlertLevelalertDescription-AlertDescriptionmessage- A human-readable message explaining what caused this alert. May be null.cause- TheThrowablethat caused this alert to be raised. May be null.
-
notifyAlertReceived
public void notifyAlertReceived(short alertLevel, short alertDescription)Description copied from interface:TlsPeerThis method will be called when an alert is received from the remote peer.- Specified by:
notifyAlertReceivedin interfaceTlsPeer- Overrides:
notifyAlertReceivedin classAbstractTlsPeer- Parameters:
alertLevel-AlertLevelalertDescription-AlertDescription
-
getClientVersion
public ProtocolVersion getClientVersion()
- Specified by:
getClientVersionin interfaceTlsClient- Overrides:
getClientVersionin classAbstractTlsClient
-
getMinimumVersion
public ProtocolVersion getMinimumVersion()
- Overrides:
getMinimumVersionin classAbstractTlsClient
-
getClientExtensions
public java.util.Hashtable getClientExtensions() throws java.io.IOException- Specified by:
getClientExtensionsin interfaceTlsClient- Overrides:
getClientExtensionsin classAbstractTlsClient- Throws:
java.io.IOException
-
notifyServerVersion
public void notifyServerVersion(ProtocolVersion serverVersion) throws java.io.IOException
- Specified by:
notifyServerVersionin interfaceTlsClient- Overrides:
notifyServerVersionin classAbstractTlsClient- Throws:
java.io.IOException
-
getAuthentication
public TlsAuthentication getAuthentication() throws java.io.IOException
- Throws:
java.io.IOException
-
notifyHandshakeComplete
public void notifyHandshakeComplete() throws java.io.IOExceptionDescription copied from interface:TlsPeerNotifies the peer that the handshake has been successfully completed.- Specified by:
notifyHandshakeCompletein interfaceTlsPeer- Overrides:
notifyHandshakeCompletein classAbstractTlsPeer- Throws:
java.io.IOException
-
-