public abstract class AbstractTlsClient extends AbstractTlsPeer implements TlsClient
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
cipherSuites |
protected TlsClientContext |
context |
protected ProtocolVersion[] |
protocolVersions |
protected java.util.Vector |
supportedGroups |
protected java.util.Vector |
supportedSignatureAlgorithms |
protected java.util.Vector |
supportedSignatureAlgorithmsCert |
| Constructor and Description |
|---|
AbstractTlsClient(TlsCrypto crypto) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowUnexpectedServerExtension(java.lang.Integer extensionType,
byte[] extensionData) |
protected void |
checkForUnexpectedServerExtension(java.util.Hashtable serverExtensions,
java.lang.Integer extensionType) |
protected CertificateStatusRequest |
getCertificateStatusRequest() |
int[] |
getCipherSuites() |
java.util.Hashtable |
getClientExtensions() |
java.util.Vector |
getClientSupplementalData() |
TlsDHGroupVerifier |
getDHGroupVerifier() |
java.util.Vector |
getEarlyKeyShareGroups()
If this client is offering TLS 1.3 or higher, this method may be called to determine for which
groups a key share should be included in the initial ClientHello.
|
protected java.util.Vector |
getNamedGroupRoles() |
protected java.util.Vector |
getProtocolNames() |
ProtocolVersion[] |
getProtocolVersions() |
TlsPSKIdentity |
getPSKIdentity() |
TlsSession |
getSessionToResume()
Return the session this client wants to resume, if any.
|
protected java.util.Vector |
getSNIServerNames() |
TlsSRPConfigVerifier |
getSRPConfigVerifier() |
TlsSRPIdentity |
getSRPIdentity() |
protected java.util.Vector |
getSupportedGroups(java.util.Vector namedGroupRoles)
The default
getClientExtensions() implementation calls this to determine which named
groups to include in the supported_groups extension for the ClientHello. |
protected java.util.Vector |
getSupportedSignatureAlgorithms() |
protected java.util.Vector |
getSupportedSignatureAlgorithmsCert() |
void |
init(TlsClientContext context) |
boolean |
isFallback() |
void |
notifyHandshakeBeginning()
Notifies the peer that a new handshake is about to begin.
|
void |
notifyNewSessionTicket(NewSessionTicket newSessionTicket)
RFC 5077 3.3.
|
void |
notifySelectedCipherSuite(int selectedCipherSuite) |
void |
notifyServerVersion(ProtocolVersion serverVersion) |
void |
notifySessionID(byte[] sessionID)
Notifies the client of the session_id sent in the ServerHello.
|
void |
processServerExtensions(java.util.Hashtable serverExtensions) |
void |
processServerSupplementalData(java.util.Vector serverSupplementalData) |
allowLegacyResumption, cancel, getCrypto, getHandshakeTimeoutMillis, getHeartbeat, getHeartbeatPolicy, getKeyExchangeFactory, getRenegotiationPolicy, getSupportedCipherSuites, getSupportedVersions, notifyAlertRaised, notifyAlertReceived, notifyCloseHandle, notifyHandshakeComplete, notifySecureRenegotiation, requiresExtendedMasterSecret, shouldCheckSigAlgOfPeerCerts, shouldUseExtendedMasterSecret, shouldUseExtendedPadding, shouldUseGMTUnixTimeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAuthenticationallowLegacyResumption, cancel, getCrypto, getHandshakeTimeoutMillis, getHeartbeat, getHeartbeatPolicy, getKeyExchangeFactory, getRenegotiationPolicy, notifyAlertRaised, notifyAlertReceived, notifyCloseHandle, notifyHandshakeComplete, notifySecureRenegotiation, requiresExtendedMasterSecret, shouldCheckSigAlgOfPeerCerts, shouldUseExtendedMasterSecret, shouldUseExtendedPadding, shouldUseGMTUnixTimeprotected TlsClientContext context
protected ProtocolVersion[] protocolVersions
protected int[] cipherSuites
protected java.util.Vector supportedGroups
protected java.util.Vector supportedSignatureAlgorithms
protected java.util.Vector supportedSignatureAlgorithmsCert
public AbstractTlsClient(TlsCrypto crypto)
protected boolean allowUnexpectedServerExtension(java.lang.Integer extensionType,
byte[] extensionData)
throws java.io.IOException
java.io.IOExceptionprotected java.util.Vector getNamedGroupRoles()
protected void checkForUnexpectedServerExtension(java.util.Hashtable serverExtensions,
java.lang.Integer extensionType)
throws java.io.IOException
java.io.IOExceptionpublic TlsPSKIdentity getPSKIdentity() throws java.io.IOException
getPSKIdentity in interface TlsClientjava.io.IOExceptionpublic TlsSRPIdentity getSRPIdentity() throws java.io.IOException
getSRPIdentity in interface TlsClientjava.io.IOExceptionpublic TlsDHGroupVerifier getDHGroupVerifier()
getDHGroupVerifier in interface TlsClientpublic TlsSRPConfigVerifier getSRPConfigVerifier()
getSRPConfigVerifier in interface TlsClientprotected java.util.Vector getProtocolNames()
protected CertificateStatusRequest getCertificateStatusRequest()
protected java.util.Vector getSNIServerNames()
protected java.util.Vector getSupportedGroups(java.util.Vector namedGroupRoles)
getClientExtensions() implementation calls this to determine which named
groups to include in the supported_groups extension for the ClientHello.namedGroupRoles - The named group roles for which there should be at
least one supported group. By default this is inferred from the offered cipher
suites and signature algorithms.Vector of Integer. See NamedGroup for group constants.protected java.util.Vector getSupportedSignatureAlgorithms()
protected java.util.Vector getSupportedSignatureAlgorithmsCert()
public void init(TlsClientContext context)
public ProtocolVersion[] getProtocolVersions()
getProtocolVersions in interface TlsPeerpublic int[] getCipherSuites()
getCipherSuites in interface TlsPeerpublic void notifyHandshakeBeginning()
throws java.io.IOException
TlsPeernotifyHandshakeBeginning in interface TlsPeernotifyHandshakeBeginning in class AbstractTlsPeerjava.io.IOExceptionpublic TlsSession getSessionToResume()
TlsClientgetSessionToResume in interface TlsClientTlsSession representing the resumable session to be used for this
connection, or null to use a new session.SessionParameters.getPeerCertificate()public boolean isFallback()
isFallback in interface TlsClientpublic java.util.Hashtable getClientExtensions()
throws java.io.IOException
getClientExtensions in interface TlsClientjava.io.IOExceptionpublic java.util.Vector getEarlyKeyShareGroups()
TlsClientTlsClient.getClientExtensions() will be ignored. The protocol
will then add a suitable key_share extension to the ClientHello extensions.getEarlyKeyShareGroups in interface TlsClientVector of named group values, possibly empty or null.public void notifyServerVersion(ProtocolVersion serverVersion) throws java.io.IOException
notifyServerVersion in interface TlsClientjava.io.IOExceptionpublic void notifySessionID(byte[] sessionID)
TlsClientnotifySessionID in interface TlsClientTlsContext.getSession()public void notifySelectedCipherSuite(int selectedCipherSuite)
notifySelectedCipherSuite in interface TlsClientpublic void processServerExtensions(java.util.Hashtable serverExtensions)
throws java.io.IOException
processServerExtensions in interface TlsClientjava.io.IOExceptionpublic void processServerSupplementalData(java.util.Vector serverSupplementalData)
throws java.io.IOException
processServerSupplementalData in interface TlsClientjava.io.IOExceptionpublic java.util.Vector getClientSupplementalData()
throws java.io.IOException
getClientSupplementalData in interface TlsClientjava.io.IOExceptionpublic void notifyNewSessionTicket(NewSessionTicket newSessionTicket) throws java.io.IOException
TlsClientThis method will be called (only) when a NewSessionTicket handshake message is received. The ticket is opaque to the client and clients MUST NOT examine the ticket under the assumption that it complies with e.g. RFC 5077 4. Recommended Ticket Construction.
notifyNewSessionTicket in interface TlsClientnewSessionTicket - The ticket.java.io.IOException