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,
String nValue,
Map<KexProposalOption,String> c2sOptions,
String cValue,
Map<KexProposalOption,String> s2cOptions,
String sValue)
Invoked during the KEX negotiation phase to inform about option
being negotiated.
|
default boolean |
handleKexExtensionRequest(Session session,
int index,
int count,
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,
Map<KexProposalOption,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 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 sessionIOException - If failed to process the requestdefault void handleKexInitProposal(Session session, boolean initiator, Map<KexProposalOption,String> proposal) throws 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)IOException - If failed to handle the requestdefault void handleKexExtensionNegotiation(Session session, KexProposalOption option, String nValue, Map<KexProposalOption,String> c2sOptions, String cValue, Map<KexProposalOption,String> s2cOptions, String sValue) throws 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).IOException - If failed to handle the invocationdefault void sendKexExtensions(Session session, KexExtensionHandler.KexPhase phase) throws 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 invokedIOException - If failed to handle the invocationdefault boolean handleKexExtensionsMessage(Session session, Buffer buffer) throws 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 generatedIOException - If failed to handle the messagehandleKexExtensionRequest(Session, int, int, String, byte[])default boolean handleKexCompressionMessage(Session session, Buffer buffer) throws 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 generatedIOException - If failed to handle the messagedefault boolean handleKexExtensionRequest(Session session, int index, int count, String name, byte[] data) throws 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 restIOException - If failed to handle the extensionCopyright © 2008–2020 The Apache Software Foundation. All rights reserved.