public interface TlsPeer
Modifier and Type | Method and Description |
---|---|
boolean |
allowLegacyResumption() |
void |
cancel() |
int[] |
getCipherSuites() |
TlsCrypto |
getCrypto() |
int |
getHandshakeResendTimeMillis()
NOTE: Currently only respected by DTLS protocols.
|
int |
getHandshakeTimeoutMillis()
NOTE: Currently only respected by DTLS protocols.
|
TlsHeartbeat |
getHeartbeat()
Return a
TlsHeartbeat instance that will control the generation of heartbeats locally
(if permitted by the remote peer), or null to not generate heartbeats. |
short |
getHeartbeatPolicy()
Return the heartbeat mode applicable to the remote peer.
|
TlsKeyExchangeFactory |
getKeyExchangeFactory() |
int |
getMaxCertificateChainLength() |
int |
getMaxHandshakeMessageSize() |
ProtocolVersion[] |
getProtocolVersions() |
short[] |
getPskKeyExchangeModes() |
int |
getRenegotiationPolicy()
WARNING: EXPERIMENTAL FEATURE
Return this peer's policy on renegotiation requests from the remote peer.
|
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 |
notifyCloseHandle(TlsCloseable closehandle) |
void |
notifyConnectionClosed()
Notifies the peer that the connection has been closed.
|
void |
notifyHandshakeBeginning()
Notifies the peer that a new handshake is about to begin.
|
void |
notifyHandshakeComplete()
Notifies the peer that the handshake has been successfully completed.
|
void |
notifySecureRenegotiation(boolean secureRenegotiation)
RFC 5746 3.4/3.6.
|
boolean |
requiresCloseNotify()
This option is provided as a last resort for interoperability with TLS peers that fail to
correctly send a close_notify alert at end of stream.
|
boolean |
requiresExtendedMasterSecret()
This implementation supports RFC 7627 and will always negotiate the extended_master_secret
extension where possible.
|
boolean |
shouldCheckSigAlgOfPeerCerts()
Deprecated.
No longer called by the protocol classes. Can call
TlsUtils.checkPeerSigAlgs(TlsContext, TlsCertificate[]) once a complete
CertPath has been determined (i.e. as part of chain validation). |
boolean |
shouldUseExtendedMasterSecret() |
boolean |
shouldUseExtendedPadding()
See RFC 5246 6.2.3.2.
|
boolean |
shouldUseGMTUnixTime()
draft-mathewson-no-gmtunixtime-00 2.
|
TlsCrypto getCrypto()
void notifyCloseHandle(TlsCloseable closehandle)
void cancel() throws java.io.IOException
java.io.IOException
ProtocolVersion[] getProtocolVersions()
int[] getCipherSuites()
void notifyHandshakeBeginning() throws java.io.IOException
java.io.IOException
int getHandshakeTimeoutMillis()
NOTE: Currently only respected by DTLS protocols.
Specify the timeout, in milliseconds, to use for the complete handshake process. Negative values are not allowed. A timeout of zero means an infinite timeout (i.e. the handshake will never time out).
int getHandshakeResendTimeMillis()
NOTE: Currently only respected by DTLS protocols.
Specify the time, in milliseconds, after which a handshake packet is resent.
boolean allowLegacyResumption()
int getMaxCertificateChainLength()
int getMaxHandshakeMessageSize()
short[] getPskKeyExchangeModes()
boolean requiresCloseNotify()
boolean requiresExtendedMasterSecret()
true
if the handshake should be aborted when the peer does not negotiate
the extended_master_secret extension, or false
to support legacy
interoperability.boolean shouldCheckSigAlgOfPeerCerts()
TlsUtils.checkPeerSigAlgs(TlsContext, TlsCertificate[])
once a complete
CertPath has been determined (i.e. as part of chain validation).true
if the 'signatureAlgorithm' of received certificates should be
checked, or false
to skip those checks.boolean shouldUseExtendedMasterSecret()
boolean shouldUseExtendedPadding()
true
if random extra padding should be added during block cipher
encryption, or false
to always use the minimum amount of required
padding.boolean shouldUseGMTUnixTime()
true
if the current time should be used in the gmt_unix_time field of
Random, or false
if gmt_unix_time should contain a cryptographically
random value.void notifySecureRenegotiation(boolean secureRenegotiation) throws java.io.IOException
java.io.IOException
TlsKeyExchangeFactory getKeyExchangeFactory() throws java.io.IOException
java.io.IOException
void notifyAlertRaised(short alertLevel, short alertDescription, java.lang.String message, java.lang.Throwable cause)
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.void notifyAlertReceived(short alertLevel, short alertDescription)
alertLevel
- AlertLevel
alertDescription
- AlertDescription
void notifyConnectionClosed()
void notifyHandshakeComplete() throws java.io.IOException
java.io.IOException
TlsHeartbeat getHeartbeat()
TlsHeartbeat
instance that will control the generation of heartbeats locally
(if permitted by the remote peer), or null to not generate heartbeats. Heartbeats are
described in RFC 6520.TlsHeartbeat
.DefaultTlsHeartbeat
short getHeartbeatPolicy()
Return the heartbeat mode applicable to the remote peer. Heartbeats are described in RFC 6520.
See enumeration class HeartbeatMode
for appropriate return values.
HeartbeatMode
value.int getRenegotiationPolicy()
RenegotiationPolicy
constant corresponding to the desired policy.RenegotiationPolicy