public class MockDTLSServer extends DefaultTlsServer
cipherFactory, clientECPointFormats, clientExtensions, clientVersion, context, eccCipherSuitesOffered, encryptThenMACOffered, maxFragmentLengthOffered, namedCurves, offeredCipherSuites, offeredCompressionMethods, selectedCipherSuite, selectedCompressionMethod, serverECPointFormats, serverExtensions, serverVersion, supportedSignatureAlgorithms, truncatedHMacOffered
Constructor and Description |
---|
MockDTLSServer() |
Modifier and Type | Method and Description |
---|---|
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.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 |
notifyClientCertificate(Certificate clientCertificate)
Called by the protocol handler to report the client certificate, only if
TlsServer.getCertificateRequest() returned non-null. |
createDHEKeyExchange, createDHKeyExchange, createECDHEKeyExchange, createECDHKeyExchange, createRSAKeyExchange, getCredentials, getDHParameters, getDSASignerCredentials, getECDSASignerCredentials, getKeyExchange
allowEncryptThenMAC, allowTruncatedHMac, checkServerExtensions, getCertificateStatus, getCipher, getCompression, getCompressionMethods, getNewSessionTicket, getSelectedCipherSuite, getSelectedCompressionMethod, getServerExtensions, getServerSupplementalData, getServerVersion, init, notifyClientVersion, notifyFallback, notifyOfferedCipherSuites, notifyOfferedCompressionMethods, processClientExtensions, processClientSupplementalData, supportsClientECCCapabilities
notifyHandshakeComplete, notifySecureRenegotiation, shouldUseGMTUnixTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
notifyHandshakeComplete, notifySecureRenegotiation, shouldUseGMTUnixTime
public void notifyAlertRaised(short alertLevel, short alertDescription, java.lang.String message, java.lang.Throwable cause)
TlsPeer
notifyAlertRaised
in interface TlsPeer
notifyAlertRaised
in class AbstractTlsPeer
alertLevel
- AlertLevel
alertDescription
- AlertDescription
message
- A human-readable message explaining what caused this alert. May be null.cause
- The Throwable
that caused this alert to be raised. May be null.public void notifyAlertReceived(short alertLevel, short alertDescription)
TlsPeer
notifyAlertReceived
in interface TlsPeer
notifyAlertReceived
in class AbstractTlsPeer
alertLevel
- AlertLevel
alertDescription
- AlertDescription
protected int[] getCipherSuites()
getCipherSuites
in class DefaultTlsServer
public CertificateRequest getCertificateRequest() throws java.io.IOException
getCertificateRequest
in interface TlsServer
getCertificateRequest
in class AbstractTlsServer
java.io.IOException
public void notifyClientCertificate(Certificate clientCertificate) throws java.io.IOException
TlsServer
TlsServer.getCertificateRequest()
returned non-null.
Note: this method is responsible for certificate verification and validation.notifyClientCertificate
in interface TlsServer
notifyClientCertificate
in class AbstractTlsServer
clientCertificate
- the effective client certificate (may be an empty chain).java.io.IOException
protected ProtocolVersion getMaximumVersion()
getMaximumVersion
in class AbstractTlsServer
protected ProtocolVersion getMinimumVersion()
getMinimumVersion
in class AbstractTlsServer
protected TlsEncryptionCredentials getRSAEncryptionCredentials() throws java.io.IOException
getRSAEncryptionCredentials
in class DefaultTlsServer
java.io.IOException
protected TlsSignerCredentials getRSASignerCredentials() throws java.io.IOException
getRSASignerCredentials
in class DefaultTlsServer
java.io.IOException