public class DefaultClientKexExtensionHandler extends AbstractLoggingBean implements KexExtensionHandler
KexExtensionHandler.AvailabilityPhase, KexExtensionHandler.KexPhase
Modifier and Type | Field and Description |
---|---|
static AttributeRepository.AttributeKey<Map<KexProposalOption,String>> |
CLIENT_PROPOSAL_KEY
Session
AttributeRepository.AttributeKey used to store the client's proposal |
static NavigableSet<String> |
DEFAULT_EXTRA_SIGNATURES |
static DefaultClientKexExtensionHandler |
INSTANCE |
static AttributeRepository.AttributeKey<Map<KexProposalOption,String>> |
SERVER_PROPOSAL_KEY
Session
AttributeRepository.AttributeKey used to store the server's proposal |
log
Constructor and Description |
---|
DefaultClientKexExtensionHandler() |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleKexCompressionMessage, handleKexExtensionNegotiation, handleKexExtensionsMessage, sendKexExtensions
public static final AttributeRepository.AttributeKey<Map<KexProposalOption,String>> CLIENT_PROPOSAL_KEY
AttributeRepository.AttributeKey
used to store the client's proposalpublic static final AttributeRepository.AttributeKey<Map<KexProposalOption,String>> SERVER_PROPOSAL_KEY
AttributeRepository.AttributeKey
used to store the server's proposalpublic static final NavigableSet<String> DEFAULT_EXTRA_SIGNATURES
public static final DefaultClientKexExtensionHandler INSTANCE
public boolean isKexExtensionsAvailable(Session session, KexExtensionHandler.AvailabilityPhase phase) throws IOException
isKexExtensionsAvailable
in interface KexExtensionHandler
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 requestpublic void handleKexInitProposal(Session session, boolean initiator, Map<KexProposalOption,String> proposal) throws IOException
KexExtensionHandler
isKexExtensionsAvailable
returns false
for
the session.handleKexInitProposal
in interface KexExtensionHandler
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 requestpublic boolean handleKexExtensionRequest(Session session, int index, int count, String name, byte[] data) throws IOException
KexExtensionHandler
KexExtensionHandler.handleKexExtensionsMessage(Session, Buffer)
in order to handle a specific extension.handleKexExtensionRequest
in interface KexExtensionHandler
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 extensionpublic List<NamedFactory<Signature>> updateAvailableSignatureFactories(Session session, Collection<String> extraAlgos) throws IOException
IOException
public List<NamedFactory<Signature>> resolveUpdatedSignatureFactories(Session session, List<NamedFactory<Signature>> available, Collection<String> extraAlgos) throws IOException
session
- The Session
for which the resolution occursavailable
- The available signature factoriesextraAlgos
- The extra requested signatures - ignored if null
/emptyIOException
- If failed to resolve the factoriespublic List<NamedFactory<Signature>> updateAvailableSignatureFactories(Session session, List<NamedFactory<Signature>> available, Collection<? extends NamedFactory<Signature>> toAdd) throws IOException
IOException
public int resolvePreferredSignaturePosition(Session session, List<? extends NamedFactory<Signature>> factories, NamedFactory<Signature> factory) throws IOException
IOException
public List<NamedFactory<Signature>> resolveRequestedSignatureFactories(Session session, Collection<String> extraAlgos) throws IOException
IOException
public NamedFactory<Signature> resolveRequestedSignatureFactory(Session session, String name) throws IOException
IOException
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.