Package org.bouncycastle.tls.test
Class MockDTLSServer
- java.lang.Object
-
- org.bouncycastle.tls.AbstractTlsPeer
-
- org.bouncycastle.tls.AbstractTlsServer
-
- org.bouncycastle.tls.DefaultTlsServer
-
- org.bouncycastle.tls.test.MockDTLSServer
-
public class MockDTLSServer extends DefaultTlsServer
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.tls.AbstractTlsServer
certificateStatusRequest, cipherSuites, clientExtensions, clientProtocolNames, clientSentECPointFormats, context, encryptThenMACOffered, maxFragmentLengthOffered, offeredCipherSuites, protocolVersions, selectedCipherSuite, selectedProtocolName, serverExtensions, truncatedHMacOffered
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateRequestgetCertificateRequest()protected TlsCredentialedDecryptorgetRSAEncryptionCredentials()protected TlsCredentialedSignergetRSASignerCredentials()protected ProtocolVersion[]getSupportedVersions()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.voidnotifyClientCertificate(Certificate clientCertificate)Called by the protocol handler to report the client certificate, only ifTlsServer.getCertificateRequest()returned non-null.-
Methods inherited from class org.bouncycastle.tls.DefaultTlsServer
getCredentials, getDSASignerCredentials, getECDSASignerCredentials, getSupportedCipherSuites
-
Methods inherited from class org.bouncycastle.tls.AbstractTlsServer
allowCertificateStatus, allowEncryptThenMAC, allowTruncatedHMac, checkServerExtensions, getCertificateStatus, getCipherSuites, getDHConfig, getECDHConfig, getMaximumNegotiableCurveBits, getMaximumNegotiableFiniteFieldBits, getNewSessionTicket, getProtocolNames, getProtocolVersions, getPSKIdentityManager, getSelectedCipherSuite, getServerExtensions, getServerSupplementalData, getServerVersion, getSessionToResume, getSRPLoginParameters, init, isSelectableCipherSuite, notifyClientVersion, notifyFallback, notifyHandshakeBeginning, notifyOfferedCipherSuites, preferLocalCipherSuites, processClientExtensions, processClientSupplementalData, selectCipherSuite, selectDH, selectDHDefault, selectECDH, selectECDHDefault, selectProtocolName, selectProtocolName, shouldSelectProtocolNameEarly
-
Methods inherited from class org.bouncycastle.tls.AbstractTlsPeer
cancel, getCrypto, getHandshakeTimeoutMillis, getHeartbeat, getHeartbeatPolicy, getKeyExchangeFactory, getRenegotiationPolicy, notifyCloseHandle, notifyHandshakeComplete, notifySecureRenegotiation, requiresExtendedMasterSecret, shouldCheckSigAlgOfPeerCerts, shouldUseExtendedPadding, 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.tls.TlsPeer
cancel, getCrypto, getHandshakeTimeoutMillis, getHeartbeat, getHeartbeatPolicy, getKeyExchangeFactory, getRenegotiationPolicy, notifyCloseHandle, notifyHandshakeComplete, notifySecureRenegotiation, requiresExtendedMasterSecret, shouldCheckSigAlgOfPeerCerts, shouldUseExtendedPadding, shouldUseGMTUnixTime
-
-
-
-
Method Detail
-
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
-
getCertificateRequest
public CertificateRequest getCertificateRequest() throws java.io.IOException
- Specified by:
getCertificateRequestin interfaceTlsServer- Overrides:
getCertificateRequestin classAbstractTlsServer- Throws:
java.io.IOException
-
notifyClientCertificate
public void notifyClientCertificate(Certificate clientCertificate) throws java.io.IOException
Description copied from interface:TlsServerCalled by the protocol handler to report the client certificate, only ifTlsServer.getCertificateRequest()returned non-null. Note: this method is responsible for certificate verification and validation.- Specified by:
notifyClientCertificatein interfaceTlsServer- Overrides:
notifyClientCertificatein classAbstractTlsServer- Parameters:
clientCertificate- the effective client certificate (may be an empty chain).- Throws:
java.io.IOException
-
getRSAEncryptionCredentials
protected TlsCredentialedDecryptor getRSAEncryptionCredentials() throws java.io.IOException
- Overrides:
getRSAEncryptionCredentialsin classDefaultTlsServer- Throws:
java.io.IOException
-
getRSASignerCredentials
protected TlsCredentialedSigner getRSASignerCredentials() throws java.io.IOException
- Overrides:
getRSASignerCredentialsin classDefaultTlsServer- Throws:
java.io.IOException
-
getSupportedVersions
protected ProtocolVersion[] getSupportedVersions()
- Overrides:
getSupportedVersionsin classAbstractTlsPeer
-
-