public interface KexExtensionHandler
| Modifier and Type | Interface and Description |
|---|---|
static class |
KexExtensionHandler.AvailabilityPhase
Provides a hint as to the context in which
isKexExtensionsAvailable is invoked |
static class |
KexExtensionHandler.KexPhase
The phase at which
sendKexExtensions is invoked |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
handleKexCompressionMessage(Session session,
Buffer buffer)
Parses the
SSH_MSG_NEWCOMPRESS message. |
default void |
handleKexExtensionNegotiation(Session session,
KexProposalOption option,
java.lang.String nValue,
java.util.Map<KexProposalOption,java.lang.String> c2sOptions,
java.lang.String cValue,
java.util.Map<KexProposalOption,java.lang.String> s2cOptions,
java.lang.String sValue)
Invoked during the KEX negotiation phase to inform about option being negotiated.
|
default boolean |
handleKexExtensionRequest(Session session,
int index,
int count,
java.lang.String name,
byte[] data)
Invoked by
handleKexExtensionsMessage(Session, Buffer) in order to handle a specific extension. |
default boolean |
handleKexExtensionsMessage(Session session,
Buffer buffer)
Parses the
SSH_MSG_EXT_INFO message. |
default void |
handleKexInitProposal(Session session,
boolean initiator,
java.util.Map<KexProposalOption,java.lang.String> proposal)
Invoked when a peer is ready to send the KEX options proposal or has received such a proposal.
|
default boolean |
isKexExtensionsAvailable(Session session,
KexExtensionHandler.AvailabilityPhase phase) |
default void |
sendKexExtensions(Session session,
KexExtensionHandler.KexPhase phase)
Invoked in order to allow the handler to send an
SSH_MSG_EXT_INFO message. |
default boolean isKexExtensionsAvailable(Session session, KexExtensionHandler.AvailabilityPhase phase) throws java.io.IOException
session - The Session about to execute KEXphase - The KexExtensionHandler.AvailabilityPhase hint as to why the query is being madetrue whether to KEX extensions are supported/allowed for the sessionjava.io.IOException - If failed to process the requestdefault void handleKexInitProposal(Session session, boolean initiator, java.util.Map<KexProposalOption,java.lang.String> proposal) throws java.io.IOException
isKexExtensionsAvailable returns false for
the session.session - The Session initiating or receiving the proposalinitiator - true if the proposal is about to be sent, false if this is a proposal
received from the peer.proposal - The proposal contents - Caveat emptor: the proposal is modifiable i.e., the
handler can modify before being sent or before being processed (if incoming)java.io.IOException - If failed to handle the requestdefault void handleKexExtensionNegotiation(Session session, KexProposalOption option, java.lang.String nValue, java.util.Map<KexProposalOption,java.lang.String> c2sOptions, java.lang.String cValue, java.util.Map<KexProposalOption,java.lang.String> s2cOptions, java.lang.String sValue) throws java.io.IOException
isKexExtensionsAvailable returns false for the
session.session - The Session executing the negotiationoption - The negotiated KexProposalOptionnValue - The negotiated option value (may be null/empty).c2sOptions - The client proposalscValue - The client-side value for the option (may be null/empty).s2cOptions - The server proposalssValue - The server-side value for the option (may be null/empty).java.io.IOException - If failed to handle the invocationdefault void sendKexExtensions(Session session, KexExtensionHandler.KexPhase phase) throws java.io.IOException
SSH_MSG_EXT_INFO message. Note: this method is
called only if isKexExtensionsAvailable returns true for the session.session - The Sessionphase - The phase at which the handler is invokedjava.io.IOException - If failed to handle the invocationdefault boolean handleKexExtensionsMessage(Session session, Buffer buffer) throws java.io.IOException
SSH_MSG_EXT_INFO message. Note: this method is called regardless of whether
isKexExtensionsAvailable returns true for the session.session - The Session through which the message was receivedbuffer - The message buffertrue if message handled - if false then SSH_MSG_UNIMPLEMENTED will be
generatedjava.io.IOException - If failed to handle the messagehandleKexExtensionRequest(Session, int, int, String, byte[])default boolean handleKexCompressionMessage(Session session, Buffer buffer) throws java.io.IOException
SSH_MSG_NEWCOMPRESS message. Note: this method is called regardless of whether
isKexExtensionsAvailable returns true for the session.session - The Session through which the message was receivedbuffer - The message buffertrue if message handled - if false then SSH_MSG_UNIMPLEMENTED will be
generatedjava.io.IOException - If failed to handle the messagedefault boolean handleKexExtensionRequest(Session session, int index, int count, java.lang.String name, byte[] data) throws java.io.IOException
handleKexExtensionsMessage(Session, Buffer) in order to handle a specific extension.session - The Session through which the message was receivedindex - The 0-based extension indexcount - The total extensions in the messagename - The extension namedata - The extension datatrue whether to proceed to the next extension or stop processing the restjava.io.IOException - If failed to handle the extension