public abstract class AbstractTlsServer extends AbstractTlsPeer implements TlsServer
Modifier and Type | Field and Description |
---|---|
protected CertificateStatusRequest |
certificateStatusRequest |
protected short[] |
clientECPointFormats |
protected java.util.Hashtable |
clientExtensions |
protected int[] |
clientSupportedGroups |
protected ProtocolVersion |
clientVersion |
protected TlsServerContext |
context |
protected boolean |
encryptThenMACOffered |
protected TlsKeyExchangeFactory |
keyExchangeFactory |
protected short |
maxFragmentLengthOffered |
protected int[] |
offeredCipherSuites |
protected short[] |
offeredCompressionMethods |
protected int |
selectedCipherSuite |
protected short |
selectedCompressionMethod |
protected short[] |
serverECPointFormats |
protected java.util.Hashtable |
serverExtensions |
protected ProtocolVersion |
serverVersion |
protected java.util.Vector |
supportedSignatureAlgorithms |
protected boolean |
truncatedHMacOffered |
Constructor and Description |
---|
AbstractTlsServer(TlsCrypto crypto) |
AbstractTlsServer(TlsCrypto crypto,
TlsKeyExchangeFactory keyExchangeFactory) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowEncryptThenMAC() |
protected boolean |
allowTruncatedHMac() |
protected java.util.Hashtable |
checkServerExtensions() |
CertificateRequest |
getCertificateRequest() |
CertificateStatus |
getCertificateStatus()
This method will be called (only) if the server included an extension of type
"status_request" with empty "extension_data" in the extended server hello.
|
TlsCipher |
getCipher() |
protected abstract int[] |
getCipherSuites() |
TlsCompression |
getCompression() |
protected short[] |
getCompressionMethods() |
protected int |
getMaximumNegotiableCurveBits() |
protected int |
getMaximumNegotiableFiniteFieldBits() |
protected ProtocolVersion |
getMaximumVersion() |
protected ProtocolVersion |
getMinimumVersion() |
NewSessionTicket |
getNewSessionTicket()
RFC 5077 3.3.
|
int |
getSelectedCipherSuite() |
short |
getSelectedCompressionMethod() |
java.util.Hashtable |
getServerExtensions() |
java.util.Vector |
getServerSupplementalData() |
ProtocolVersion |
getServerVersion() |
TlsSession |
getSessionToResume(byte[] sessionID)
Return the specified session, if available.
|
void |
init(TlsServerContext context) |
protected boolean |
isSelectableCipherSuite(int cipherSuite,
int availCurveBits,
int availFiniteFieldBits,
java.util.Vector sigAlgs) |
void |
notifyClientCertificate(Certificate clientCertificate)
Called by the protocol handler to report the client certificate, only if
TlsServer.getCertificateRequest() returned non-null. |
void |
notifyClientVersion(ProtocolVersion clientVersion) |
void |
notifyFallback(boolean isFallback) |
void |
notifyOfferedCipherSuites(int[] offeredCipherSuites) |
void |
notifyOfferedCompressionMethods(short[] offeredCompressionMethods) |
void |
processClientExtensions(java.util.Hashtable clientExtensions) |
void |
processClientSupplementalData(java.util.Vector clientSupplementalData) |
protected boolean |
selectCipherSuite(int cipherSuite) |
protected int |
selectCurve(int minimumCurveBits) |
protected int |
selectDefaultCurve(int minimumCurveBits) |
protected TlsDHConfig |
selectDefaultDHConfig(int minimumFiniteFieldBits) |
protected TlsDHConfig |
selectDHConfig() |
protected TlsDHConfig |
selectDHConfig(int minimumFiniteFieldBits) |
protected TlsECConfig |
selectECConfig() |
getCrypto, notifyAlertRaised, notifyAlertReceived, notifyHandshakeComplete, notifySecureRenegotiation, shouldUseExtendedPadding, shouldUseGMTUnixTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCredentials, getKeyExchange
getCrypto, notifyAlertRaised, notifyAlertReceived, notifyHandshakeComplete, notifySecureRenegotiation, shouldUseExtendedPadding, shouldUseGMTUnixTime
protected TlsKeyExchangeFactory keyExchangeFactory
protected TlsServerContext context
protected ProtocolVersion clientVersion
protected int[] offeredCipherSuites
protected short[] offeredCompressionMethods
protected java.util.Hashtable clientExtensions
protected boolean encryptThenMACOffered
protected short maxFragmentLengthOffered
protected boolean truncatedHMacOffered
protected java.util.Vector supportedSignatureAlgorithms
protected int[] clientSupportedGroups
protected short[] clientECPointFormats
protected short[] serverECPointFormats
protected CertificateStatusRequest certificateStatusRequest
protected ProtocolVersion serverVersion
protected int selectedCipherSuite
protected short selectedCompressionMethod
protected java.util.Hashtable serverExtensions
public AbstractTlsServer(TlsCrypto crypto)
public AbstractTlsServer(TlsCrypto crypto, TlsKeyExchangeFactory keyExchangeFactory)
protected boolean allowEncryptThenMAC()
protected boolean allowTruncatedHMac()
protected java.util.Hashtable checkServerExtensions()
protected abstract int[] getCipherSuites()
protected short[] getCompressionMethods()
protected ProtocolVersion getMaximumVersion()
protected ProtocolVersion getMinimumVersion()
protected int getMaximumNegotiableCurveBits()
protected int getMaximumNegotiableFiniteFieldBits()
protected boolean isSelectableCipherSuite(int cipherSuite, int availCurveBits, int availFiniteFieldBits, java.util.Vector sigAlgs)
protected boolean selectCipherSuite(int cipherSuite) throws java.io.IOException
java.io.IOException
protected int selectCurve(int minimumCurveBits)
protected int selectDefaultCurve(int minimumCurveBits)
protected TlsDHConfig selectDefaultDHConfig(int minimumFiniteFieldBits)
protected TlsDHConfig selectDHConfig() throws java.io.IOException
java.io.IOException
protected TlsDHConfig selectDHConfig(int minimumFiniteFieldBits)
protected TlsECConfig selectECConfig() throws java.io.IOException
java.io.IOException
public void init(TlsServerContext context)
public TlsSession getSessionToResume(byte[] sessionID)
TlsServer
getSessionToResume
in interface TlsServer
sessionID
- the ID of the session to resume.TlsSession
with the specified session ID, or null.SessionParameters.getPeerCertificate()
public void notifyClientVersion(ProtocolVersion clientVersion) throws java.io.IOException
notifyClientVersion
in interface TlsServer
java.io.IOException
public void notifyFallback(boolean isFallback) throws java.io.IOException
notifyFallback
in interface TlsServer
java.io.IOException
public void notifyOfferedCipherSuites(int[] offeredCipherSuites) throws java.io.IOException
notifyOfferedCipherSuites
in interface TlsServer
java.io.IOException
public void notifyOfferedCompressionMethods(short[] offeredCompressionMethods) throws java.io.IOException
notifyOfferedCompressionMethods
in interface TlsServer
java.io.IOException
public void processClientExtensions(java.util.Hashtable clientExtensions) throws java.io.IOException
processClientExtensions
in interface TlsServer
java.io.IOException
public ProtocolVersion getServerVersion() throws java.io.IOException
getServerVersion
in interface TlsServer
java.io.IOException
public int getSelectedCipherSuite() throws java.io.IOException
getSelectedCipherSuite
in interface TlsServer
java.io.IOException
public short getSelectedCompressionMethod() throws java.io.IOException
getSelectedCompressionMethod
in interface TlsServer
java.io.IOException
public java.util.Hashtable getServerExtensions() throws java.io.IOException
getServerExtensions
in interface TlsServer
java.io.IOException
public java.util.Vector getServerSupplementalData() throws java.io.IOException
getServerSupplementalData
in interface TlsServer
java.io.IOException
public CertificateStatus getCertificateStatus() throws java.io.IOException
TlsServer
CertificateStatus
is returned, it
is sent to the client as a handshake message of type "certificate_status".getCertificateStatus
in interface TlsServer
CertificateStatus
to be sent to the client (or null for none).java.io.IOException
public CertificateRequest getCertificateRequest() throws java.io.IOException
getCertificateRequest
in interface TlsServer
java.io.IOException
public void processClientSupplementalData(java.util.Vector clientSupplementalData) throws java.io.IOException
processClientSupplementalData
in interface TlsServer
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
clientCertificate
- the effective client certificate (may be an empty chain).java.io.IOException
public TlsCompression getCompression() throws java.io.IOException
getCompression
in interface TlsPeer
java.io.IOException
public TlsCipher getCipher() throws java.io.IOException
public NewSessionTicket getNewSessionTicket() throws java.io.IOException
TlsServer
This method will be called (only) if a NewSessionTicket extension was sent by the server. See RFC 5077 4. Recommended Ticket Construction for recommended format and protection.
getNewSessionTicket
in interface TlsServer
java.io.IOException