Top Description Fields Constructors Methods
org.apache.sshd.common.kex.extension

public Class DefaultClientKexExtensionHandler

extends AbstractLoggingBean
implements KexExtensionHandler
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.kex.extension.KexExtensionHandler
Imports
java.io.IOException, java.util.ArrayList, .Collection, .Iterator, .List, .Set, .TreeSet, org.apache.sshd.common.AttributeRepository.AttributeKey, .NamedFactory, org.apache.sshd.common.kex.extension.parser.HostBoundPubkeyAuthentication, .ServerSignatureAlgorithms, org.apache.sshd.common.session.Session, org.apache.sshd.common.signature.Signature, org.apache.sshd.common.util.logging.AbstractLoggingBean

Detects if the server sends a "server-sig-algs" and updates the client session by adding the "rsa-sha2-256/512" signature factories (if not already added).
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final AttributeRepository.AttributeKey<Integer>
HOSTBOUND_AUTHENTICATION

Session AttributeKey storing the version if the server supports host-bound public key authentication.

public static final DefaultClientKexExtensionHandler
INSTANCE

Default singleton instance.

public static final AttributeRepository.AttributeKey<Set<String>>
SERVER_ALGORITHMS

Session AttributeKey storing the algorithms announced by the server as known.

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
handleKexExtensionRequest(Session
The Session through which the message was received
session
,
int
The 0-based extension index
index
,
int
The total extensions in the message
count
,
String
The extension name
name
,
byte[]
The extension data
data
)

Overrides default org.apache.sshd.common.kex.extension.KexExtensionHandler.handleKexExtensionRequest.

Invoked by handleKexExtensionsMessage(Session, Buffer) in order to handle a specific extension.

protected void
handleServerSignatureAlgorithms(Session
the message was received for
session
,
Collection<String>
signature algorithm names announced by the server
serverAlgorithms
)

Perform updates after a server-sig-algs extension has been received.

public boolean
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

HOSTBOUND_AUTHENTICATIONback to summary
public static final AttributeRepository.AttributeKey<Integer> HOSTBOUND_AUTHENTICATION

Session AttributeKey storing the version if the server supports host-bound public key authentication.

INSTANCEback to summary
public static final DefaultClientKexExtensionHandler INSTANCE

Default singleton instance.

SERVER_ALGORITHMSback to summary
public static final AttributeRepository.AttributeKey<Set<String>> SERVER_ALGORITHMS

Session AttributeKey storing the algorithms announced by the server as known.

Constructor Detail

DefaultClientKexExtensionHandlerback to summary
public DefaultClientKexExtensionHandler()

Method Detail

handleKexExtensionRequestback to summary
public boolean handleKexExtensionRequest(Session session, int index, int count, String name, byte[] data) throws IOException

Overrides default org.apache.sshd.common.kex.extension.KexExtensionHandler.handleKexExtensionRequest.

Doc from org.apache.sshd.common.kex.extension.KexExtensionHandler.handleKexExtensionRequest.

Invoked by handleKexExtensionsMessage(Session, Buffer) in order to handle a specific extension.

Parameters
session:Session

The Session through which the message was received

index:int

The 0-based extension index

count:int

The total extensions in the message

name:String

The extension name

data:byte[]

The extension data

Returns:boolean

true whether to proceed to the next extension or stop processing the rest

Annotations
@Override
handleServerSignatureAlgorithmsback to summary
protected void handleServerSignatureAlgorithms(Session session, Collection<String> serverAlgorithms)

Perform updates after a server-sig-algs extension has been received. The set of algorithms announced by the server is set as attribute SERVER_ALGORITHMS of the session.

Parameters
session:Session

the message was received for

serverAlgorithms:Collection<String>

signature algorithm names announced by the server

isKexExtensionsAvailableback to summary
public boolean isKexExtensionsAvailable(Session session, KexExtensionHandler.AvailabilityPhase phase) throws IOException

Overrides default org.apache.sshd.common.kex.extension.KexExtensionHandler.isKexExtensionsAvailable.

Parameters
session:Session

Doc from org.apache.sshd.common.kex.extension.KexExtensionHandler.isKexExtensionsAvailable.

The Session about to execute KEX

phase:KexExtensionHandler.AvailabilityPhase

Doc from org.apache.sshd.common.kex.extension.KexExtensionHandler.isKexExtensionsAvailable.

The AvailabilityPhase hint as to why the query is being made

Returns:boolean

Doc from org.apache.sshd.common.kex.extension.KexExtensionHandler.isKexExtensionsAvailable.

true whether to KEX extensions are supported/allowed for the session

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.common.kex.extension.KexExtensionHandler.isKexExtensionsAvailable.

If failed to process the request