Package org.bouncycastle.crypto.tls
Class AbstractTlsPeer
- java.lang.Object
-
- org.bouncycastle.crypto.tls.AbstractTlsPeer
-
- All Implemented Interfaces:
TlsPeer
- Direct Known Subclasses:
AbstractTlsClient,AbstractTlsServer
public abstract class AbstractTlsPeer extends java.lang.Object implements TlsPeer
-
-
Constructor Summary
Constructors Constructor Description AbstractTlsPeer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidnotifyHandshakeComplete()Notifies the peer that the handshake has been successfully completed.voidnotifySecureRenegotiation(boolean secureRenegotiation)booleanrequiresExtendedMasterSecret()This implementation supports RFC 7627 and will always negotiate the extended_master_secret extension where possible.booleanshouldUseGMTUnixTime()draft-mathewson-no-gmtunixtime-00 2.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.crypto.tls.TlsPeer
getCipher, getCompression
-
-
-
-
Method Detail
-
requiresExtendedMasterSecret
public boolean requiresExtendedMasterSecret()
Description copied from interface:TlsPeerThis implementation supports RFC 7627 and will always negotiate the extended_master_secret extension where possible. When connecting to a peer that does not offer/accept this extension, it is recommended to abort the handshake. This option is provided for interoperability with legacy peers, although some TLS features will be disabled in that case (see RFC 7627 5.4).- Specified by:
requiresExtendedMasterSecretin interfaceTlsPeer- Returns:
trueif the handshake should be aborted when the peer does not negotiate the extended_master_secret extension, orfalseto support legacy interoperability.
-
shouldUseGMTUnixTime
public boolean shouldUseGMTUnixTime()
Description copied from interface:TlsPeerdraft-mathewson-no-gmtunixtime-00 2. "If existing users of a TLS implementation may rely on gmt_unix_time containing the current time, we recommend that implementors MAY provide the ability to set gmt_unix_time as an option only, off by default."- Specified by:
shouldUseGMTUnixTimein interfaceTlsPeer- Returns:
trueif the current time should be used in the gmt_unix_time field of Random, orfalseif gmt_unix_time should contain a cryptographically random value.
-
notifySecureRenegotiation
public void notifySecureRenegotiation(boolean secureRenegotiation) throws java.io.IOException- Specified by:
notifySecureRenegotiationin interfaceTlsPeer- Throws:
java.io.IOException
-
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- 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- Parameters:
alertLevel-AlertLevelalertDescription-AlertDescription
-
notifyHandshakeComplete
public void notifyHandshakeComplete() throws java.io.IOExceptionDescription copied from interface:TlsPeerNotifies the peer that the handshake has been successfully completed.- Specified by:
notifyHandshakeCompletein interfaceTlsPeer- Throws:
java.io.IOException
-
-