Package org.apache.sshd.server.session
Class AbstractServerSession
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.util.closeable.IoBaseCloseable
org.apache.sshd.common.util.closeable.AbstractCloseable
org.apache.sshd.common.util.closeable.AbstractInnerCloseable
org.apache.sshd.common.kex.AbstractKexFactoryManager
org.apache.sshd.common.session.helpers.SessionHelper
org.apache.sshd.common.session.helpers.AbstractSession
org.apache.sshd.server.session.AbstractServerSession
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,AttributeRepository
,AttributeStore
,MutableUserHolder
,UserAuthFactoriesManager<ServerSession,
,UserAuth, UserAuthFactory> UsernameHolder
,ChannelListenerManager
,ChannelStreamWriterResolver
,ChannelStreamWriterResolverManager
,Closeable
,FactoryManagerHolder
,PortForwardingEventListenerManager
,PortForwardingInformationProvider
,KexExtensionHandlerManager
,KexFactoryManager
,KeyPairProviderHolder
,PropertyResolver
,ReservedSessionMessagesManager
,Session
,SessionContext
,SessionDisconnectHandlerManager
,SessionHeartbeatController
,SessionListenerManager
,UnknownChannelReferenceHandlerManager
,SignatureFactoriesHolder
,SignatureFactoriesManager
,ConnectionEndpointsIndicator
,ServerAuthenticationManager
,ServerProxyAcceptorHolder
,ServerSession
- Direct Known Subclasses:
ServerSessionImpl
Provides default implementations for
ServerSession
related methods- Author:
- Apache MINA SSHD Project
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.session.helpers.AbstractSession
AbstractSession.MessageCodingSettings
Nested classes/interfaces inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
AbstractCloseable.State
Nested classes/interfaces inherited from interface org.apache.sshd.common.AttributeRepository
AttributeRepository.AttributeKey<T extends Object>
Nested classes/interfaces inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
SessionHeartbeatController.HeartbeatType
-
Field Summary
Fields inherited from class org.apache.sshd.common.session.helpers.AbstractSession
channelListenerProxy, channelListeners, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, firstKexPacketFollows, ignorePacketDataLength, ignorePacketsCount, ignorePacketsFrequency, ignorePacketsVariance, inBlocksCount, inBytesCount, inCipher, inCipherSize, inCompression, initialKexDone, initialKexInitSequenceNumber, inMac, inMacResult, inMacSize, inPacketsCount, inSettings, kex, kexFutureHolder, kexHandler, kexInitializedFuture, kexState, lastKeyTimeValue, maxRekeyBlocks, maxRekeyBytes, maxRekeyInterval, maxRekyPackets, negotiationResult, outBlocksCount, outBytesCount, outCipher, outCipherSize, outCompression, outMac, outMacSize, outPacketsCount, outSettings, random, requestLock, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, sessionListenerProxy, sessionListeners, strictKex, tunnelListenerProxy, tunnelListeners, uncompressBuffer, unmodClientProposal, unmodNegotiationResult, unmodServerProposal
Fields inherited from class org.apache.sshd.common.session.helpers.SessionHelper
authStart, idleStart, initialKexProposal
Fields inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
closeFuture, futureLock, state
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
Fields inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolver
NONE
Fields inherited from interface org.apache.sshd.common.PropertyResolver
EMPTY
Fields inherited from interface org.apache.sshd.server.ServerAuthenticationManager
DEFAULT_USER_AUTH_GSS_FACTORY, DEFAULT_USER_AUTH_KB_INTERACTIVE_FACTORY, DEFAULT_USER_AUTH_PASSWORD_FACTORY, DEFAULT_USER_AUTH_PUBLIC_KEY_FACTORY
Fields inherited from interface org.apache.sshd.common.session.SessionContext
DEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTH
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractServerSession
(ServerFactoryManager factoryManager, IoSession ioSession) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Indicates the the key exchange is completed and the exchanged keys can now be verified - e.g., client can verify the server's keyint
getActiveSessionCountForUser
(String userName) Retrieve the current number of sessions active for a given username.protected ConnectionService
Retrieve theGSSAuthenticator
to be used by the SSH server.Retrieve theHostBasedAuthenticator
to be used by the SSH server.long
getId()
Retrieve theKeyboardInteractiveAuthenticator
to be used by the SSH server.Retrieve thePasswordAuthenticator
to be used by the SSH server.Retrieve thePublickeyAuthenticator
to be used by SSH server.protected void
handleServiceAccept
(String serviceName, Buffer buffer) protected boolean
handleServiceRequest
(String serviceName, Buffer buffer) protected boolean
readIdentification
(Buffer buffer) Read the other side identification.protected void
receiveKexInit
(Map<KexProposalOption, String> proposal, byte[] seed) protected String
resolveAvailableSignaturesProposal
(FactoryManager proposedManager) Computes the list of available host key signature algorithms supported.protected String
resolveEmptySignaturesProposal
(Iterable<String> supported, Iterable<String> provided) Called byresolveAvailableSignaturesProposal(FactoryManager)
if none of the provided keys is supported - last chance for the derived implementation to do somethingprotected byte[]
sendKexInit
(Map<KexProposalOption, String> proposal) Send the key exchange initialization packet.protected IoWriteFuture
sendServerIdentification
(List<String> headerLines) Sends the server identification + any extra header linesvoid
setClientAddress
(SocketAddress clientAddress) void
setGSSAuthenticator
(GSSAuthenticator gssAuthenticator) void
setHostBasedAuthenticator
(HostBasedAuthenticator hostBasedAuthenticator) void
setHostKeyCertificateProvider
(HostKeyCertificateProvider hostKeyCertificateProvider) protected void
setKexSeed
(byte... seed) void
setKeyboardInteractiveAuthenticator
(KeyboardInteractiveAuthenticator interactiveAuthenticator) void
setKeyPairProvider
(KeyPairProvider keyPairProvider) void
setPasswordAuthenticator
(PasswordAuthenticator passwordAuthenticator) void
setPublickeyAuthenticator
(PublickeyAuthenticator publickeyAuthenticator) void
setServerProxyAcceptor
(ServerProxyAcceptor proxyAcceptor) void
setUserAuthFactories
(List<UserAuthFactory> userAuthFactories) signalAuthenticationSuccess
(String username, String authService, Buffer buffer) void
startService
(String name, Buffer buffer) Methods inherited from class org.apache.sshd.common.session.helpers.AbstractSession
addChannelListener, addPortForwardingEventListener, addSessionListener, aeadOutgoingBuffer, appendOutgoingMac, attachSession, calculatePadLength, checkRekey, comparePreferredKexProposalOption, createBuffer, decode, determineRekeyBlockLimit, doHandleMessage, doInvokeUnimplementedMessageHandler, doKexNegotiation, doStrictKexProposal, doWritePacket, encode, encryptOutgoingBuffer, failStrictKex, getChannelListenerProxy, getCipherInformation, getClientKexData, getClientKexProposals, getClientVersion, getCompressionInformation, getInnerCloseable, getKex, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getPortForwardingEventListenerProxy, getServerKexData, getServerKexProposals, getServerVersion, getService, getServices, getSession, getSession, getSessionId, getSessionListenerProxy, handleFirstKexPacketFollows, handleKexExtension, handleKexInit, handleKexMessage, handleMessage, handleNewCompression, handleNewKeys, handleServiceAccept, handleServiceRequest, initializeCurrentService, initializeKeyExchangeMessageHandler, isRekeyBlocksCountExceeded, isRekeyDataSizeExceeded, isRekeyPacketCountsExceeded, isRekeyRequired, isRekeyTimeIntervalExceeded, messageReceived, negotiate, notImplemented, preClose, prepareBuffer, prepareNewKeys, preProcessEncodeBuffer, receiveKexInit, receiveKexInit, reExchangeKeys, refreshConfiguration, removeChannelListener, removePortForwardingEventListener, removeSessionListener, removeValue, request, request, requestFailure, requestNewKeysExchange, requestSuccess, resolveIgnoreBufferDataLength, resolveOutputPacket, resolveSessionKexProposal, sendKexInit, sendNewKeys, setClientKexData, setInputEncoding, setNegotiationResult, setOutputEncoding, setServerKexData, validateIncomingMac, validateKexState, validateServiceKexState, validateTargetBuffer, writePacket, writePacket
Methods inherited from class org.apache.sshd.common.session.helpers.SessionHelper
attributeKeys, calculateNextIgnorePacketCount, checkAuthenticationTimeout, checkForTimeouts, checkIdleTimeout, clearAttributes, computeAttributeIfAbsent, createProposal, disconnect, doInvokeDebugMessageHandler, doInvokeIgnoreMessageHandler, doReadIdentification, exceptionCaught, getAttribute, getAttributesCount, getAuthTimeout, getAuthTimeoutStart, getBoundLocalPortForwards, getBoundRemotePortForward, getChannelStreamWriterResolver, getForwarder, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKexProposal, getLocalForwardsBindings, getParentPropertyResolver, getProperties, getRemoteForwardsBindings, getReservedSessionMessagesHandler, getSessionDisconnectHandler, getStartedLocalPortForwards, getStartedRemotePortForwards, getTimeoutStatus, getUnknownChannelReferenceHandler, getUsername, handleDebug, handleDisconnect, handleDisconnect, handleIgnore, handleUnimplemented, invokeSessionSignaller, isAuthenticated, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort, isServerSession, mergeProposals, removeAttribute, resetAuthTimeout, resetIdleTimeout, resizeKey, resolveAvailableSignaturesProposal, resolveChannelStreamWriterResolver, resolveIdentificationString, resolvePeerAddress, resolveReservedSessionMessagesHandler, resolveUnknownChannelReferenceHandler, sendDebugMessage, sendIdentification, sendIgnoreMessage, sendNotImplemented, setAttribute, setAuthenticated, setChannelStreamWriterResolver, setReservedSessionMessagesHandler, setSessionDisconnectHandler, setUnknownChannelReferenceHandler, setUsername, signalDisconnect, signalDisconnect, signalExceptionCaught, signalExceptionCaught, signalNegotiationEnd, signalNegotiationEnd, signalNegotiationOptionsCreated, signalNegotiationOptionsCreated, signalNegotiationStart, signalNegotiationStart, signalPeerIdentificationReceived, signalPeerIdentificationReceived, signalReadPeerIdentificationLine, signalReadPeerIdentificationLine, signalSendIdentification, signalSendIdentification, signalSessionClosed, signalSessionClosed, signalSessionCreated, signalSessionCreated, signalSessionEstablished, signalSessionEstablished, signalSessionEvent, signalSessionEvent, toString
Methods inherited from class org.apache.sshd.common.kex.AbstractKexFactoryManager
getCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactories
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractInnerCloseable
doCloseGracefully, doCloseImmediately
Methods inherited from class org.apache.sshd.common.util.closeable.AbstractCloseable
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListener
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sshd.common.AttributeRepository
attributeKeys, getAttribute, getAttributesCount
Methods inherited from interface org.apache.sshd.common.AttributeStore
clearAttributes, computeAttributeIfAbsent, removeAttribute, setAttribute
Methods inherited from interface org.apache.sshd.common.channel.ChannelListenerManager
addChannelListener, getChannelListenerProxy, removeChannelListener
Methods inherited from interface org.apache.sshd.common.channel.throttle.ChannelStreamWriterResolverManager
getChannelStreamWriterResolver, resolveChannelStreamWriter, resolveChannelStreamWriterResolver, setChannelStreamWriterResolver
Methods inherited from interface org.apache.sshd.common.Closeable
addCloseFutureListener, close, close, isClosed, isClosing, isOpen, removeCloseFutureListener
Methods inherited from interface org.apache.sshd.common.kex.extension.KexExtensionHandlerManager
getKexExtensionHandler, setKexExtensionHandler
Methods inherited from interface org.apache.sshd.common.kex.KexFactoryManager
getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNames
Methods inherited from interface org.apache.sshd.common.auth.MutableUserHolder
setUsername
Methods inherited from interface org.apache.sshd.common.forward.PortForwardingEventListenerManager
addPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListener
Methods inherited from interface org.apache.sshd.common.forward.PortForwardingInformationProvider
getBoundLocalPortForwards, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort
Methods inherited from interface org.apache.sshd.common.PropertyResolver
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringProperty, isEmpty
Methods inherited from interface org.apache.sshd.common.session.ReservedSessionMessagesManager
getReservedSessionMessagesHandler, setReservedSessionMessagesHandler
Methods inherited from interface org.apache.sshd.server.ServerAuthenticationManager
setUserAuthFactoriesNames
Methods inherited from interface org.apache.sshd.common.session.Session
createBuffer, createBuffer, disconnect, exceptionCaught, getAuthTimeout, getAuthTimeoutStart, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKex, getLocalAddress, getRemoteAddress, getService, getTimeoutStatus, prepareBuffer, reExchangeKeys, request, request, request, request, resetAuthTimeout, resetIdleTimeout, resolveAttribute, sendDebugMessage, sendIgnoreMessage, setAuthenticated, writePacket, writePacket, writePacket, writePacket
Methods inherited from interface org.apache.sshd.common.session.SessionContext
getCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isServerSession
Methods inherited from interface org.apache.sshd.common.session.SessionDisconnectHandlerManager
getSessionDisconnectHandler, setSessionDisconnectHandler
Methods inherited from interface org.apache.sshd.common.session.SessionHeartbeatController
disableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat, setSessionHeartbeat
Methods inherited from interface org.apache.sshd.common.session.SessionListenerManager
addSessionListener, getSessionListenerProxy, removeSessionListener
Methods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesHolder
getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames
Methods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesManager
setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
Methods inherited from interface org.apache.sshd.common.session.UnknownChannelReferenceHandlerManager
getUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandler
Methods inherited from interface org.apache.sshd.common.auth.UserAuthFactoriesManager
getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNames
Methods inherited from interface org.apache.sshd.common.auth.UsernameHolder
getUsername
-
Constructor Details
-
AbstractServerSession
-
-
Method Details
-
getFactoryManager
- Specified by:
getFactoryManager
in interfaceFactoryManagerHolder
- Specified by:
getFactoryManager
in interfaceServerSession
- Overrides:
getFactoryManager
in classSessionHelper
- Returns:
- The currently associated
FactoryManager
-
getServerProxyAcceptor
- Specified by:
getServerProxyAcceptor
in interfaceServerProxyAcceptorHolder
-
setServerProxyAcceptor
- Specified by:
setServerProxyAcceptor
in interfaceServerProxyAcceptorHolder
-
getClientAddress
- Specified by:
getClientAddress
in interfaceServerSession
- Returns:
- The
SocketAddress
of the remote client. If no proxy wrapping was used then this is the same as theIoSession#getRemoteAddress()
. Otherwise, it indicates the real client's address that was somehow transmitted via the proxy meta-data
-
setClientAddress
-
getPasswordAuthenticator
Description copied from interface:ServerAuthenticationManager
Retrieve thePasswordAuthenticator
to be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull
), then client authentication requests based on passwords will be rejected.- Specified by:
getPasswordAuthenticator
in interfaceServerAuthenticationManager
- Returns:
- the
PasswordAuthenticator
ornull
-
setPasswordAuthenticator
- Specified by:
setPasswordAuthenticator
in interfaceServerAuthenticationManager
-
getPublickeyAuthenticator
Description copied from interface:ServerAuthenticationManager
Retrieve thePublickeyAuthenticator
to be used by SSH server. If no authenticator has been configured (i.e. this method returnsnull
), then client authentication requests based on keys will be rejected.- Specified by:
getPublickeyAuthenticator
in interfaceServerAuthenticationManager
- Returns:
- the
PublickeyAuthenticator
ornull
-
setPublickeyAuthenticator
- Specified by:
setPublickeyAuthenticator
in interfaceServerAuthenticationManager
-
getKeyboardInteractiveAuthenticator
Description copied from interface:ServerAuthenticationManager
Retrieve theKeyboardInteractiveAuthenticator
to be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull
), then client authentication requests based on this method will be rejected.- Specified by:
getKeyboardInteractiveAuthenticator
in interfaceServerAuthenticationManager
- Returns:
- The
KeyboardInteractiveAuthenticator
ornull
-
setKeyboardInteractiveAuthenticator
public void setKeyboardInteractiveAuthenticator(KeyboardInteractiveAuthenticator interactiveAuthenticator) - Specified by:
setKeyboardInteractiveAuthenticator
in interfaceServerAuthenticationManager
-
getGSSAuthenticator
Description copied from interface:ServerAuthenticationManager
Retrieve theGSSAuthenticator
to be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull
), then client authentication requests based on gssapi will be rejected.- Specified by:
getGSSAuthenticator
in interfaceServerAuthenticationManager
- Returns:
- the
GSSAuthenticator
ornull
-
setGSSAuthenticator
- Specified by:
setGSSAuthenticator
in interfaceServerAuthenticationManager
-
getHostBasedAuthenticator
Description copied from interface:ServerAuthenticationManager
Retrieve theHostBasedAuthenticator
to be used by the SSH server. If no authenticator has been configured (i.e. this method returnsnull
), then client authentication requests based on this method will be rejected.- Specified by:
getHostBasedAuthenticator
in interfaceServerAuthenticationManager
- Returns:
- the
HostBasedAuthenticator
ornull
-
setHostBasedAuthenticator
- Specified by:
setHostBasedAuthenticator
in interfaceServerAuthenticationManager
-
getUserAuthFactories
- Specified by:
getUserAuthFactories
in interfaceUserAuthFactoriesManager<ServerSession,
UserAuth, UserAuthFactory>
-
setUserAuthFactories
- Specified by:
setUserAuthFactories
in interfaceUserAuthFactoriesManager<ServerSession,
UserAuth, UserAuthFactory>
-
getKeyPairProvider
- Specified by:
getKeyPairProvider
in interfaceKeyPairProviderHolder
-
getHostKeyCertificateProvider
- Specified by:
getHostKeyCertificateProvider
in interfaceServerAuthenticationManager
- Returns:
- a
HostKeyCertificateProvider
if available, null as default
-
setHostKeyCertificateProvider
- Specified by:
setHostKeyCertificateProvider
in interfaceServerAuthenticationManager
-
setKeyPairProvider
- Specified by:
setKeyPairProvider
in interfaceKeyPairProviderHolder
-
sendServerIdentification
Sends the server identification + any extra header lines- Parameters:
headerLines
- Extra header lines to be prepended to the actual identification string - ignored ifnull
/empty- Returns:
- An
IoWriteFuture
that can be used to be notified of identification data being written successfully or failing - Throws:
Exception
- If failed to send identification- See Also:
-
checkKeys
protected void checkKeys()Description copied from class:AbstractSession
Indicates the the key exchange is completed and the exchanged keys can now be verified - e.g., client can verify the server's key- Specified by:
checkKeys
in classAbstractSession
-
handleServiceRequest
- Overrides:
handleServiceRequest
in classAbstractSession
- Throws:
Exception
-
startService
- Specified by:
startService
in interfaceSession
- Parameters:
name
- Service namebuffer
- Extra information provided when the service start request was received- Throws:
Exception
- If failed to start it
-
signalAuthenticationSuccess
public IoWriteFuture signalAuthenticationSuccess(String username, String authService, Buffer buffer) throws Exception Description copied from interface:ServerSession
- Marks the session as authenticated.
- Starts the specified service.
- Sends the
SSH_MSG_USERAUTH_SUCCESS
message.
- Specified by:
signalAuthenticationSuccess
in interfaceServerSession
- Parameters:
username
- The authenticated usernameauthService
- The service to startbuffer
- Any extra data received to use to start the service- Returns:
- An
IoWriteFuture
that can be used to wait for theSSH_MSG_USERAUTH_SUCCESS
message send result - Throws:
Exception
- if cannot handle the request
-
handleServiceAccept
- Overrides:
handleServiceAccept
in classAbstractSession
- Throws:
Exception
-
sendKexInit
Description copied from class:AbstractSession
Send the key exchange initialization packet. This packet contains random data along with our proposal.- Overrides:
sendKexInit
in classAbstractSession
- Parameters:
proposal
- our proposal for key exchange negotiation- Returns:
- the sent packet data which must be kept for later use when deriving the session keys
- Throws:
Exception
- if an error occurred sending the packet
-
setKexSeed
protected void setKexSeed(byte... seed) - Specified by:
setKexSeed
in classAbstractSession
- Parameters:
seed
- The result of the KEXINIT handshake - required for correct session key establishment
-
resolveAvailableSignaturesProposal
protected String resolveAvailableSignaturesProposal(FactoryManager proposedManager) throws IOException, GeneralSecurityException Description copied from class:SessionHelper
Computes the list of available host key signature algorithms supported.- Specified by:
resolveAvailableSignaturesProposal
in classSessionHelper
- Parameters:
proposedManager
- TheFactoryManager
- Returns:
- A comma-separated list of all the signature protocols to be included in the
proposal -
null
/empty if no proposal - Throws:
IOException
- If failed to read/parse the keys dataGeneralSecurityException
- If failed to generate the keys
-
resolveEmptySignaturesProposal
protected String resolveEmptySignaturesProposal(Iterable<String> supported, Iterable<String> provided) Called byresolveAvailableSignaturesProposal(FactoryManager)
if none of the provided keys is supported - last chance for the derived implementation to do something- Parameters:
supported
- The supported key types - may benull
/emptyprovided
- The available signature types - may benull
/empty- Returns:
- The resolved proposal -
null
by default
-
readIdentification
Description copied from class:AbstractSession
Read the other side identification. This method is specific to the client or server side, but both should callSessionHelper.doReadIdentification(Buffer, boolean)
and store the result in the needed property.- Specified by:
readIdentification
in classAbstractSession
- Parameters:
buffer
- TheBuffer
containing the remote identification- Returns:
true
if the identification has been fully read orfalse
if more data is needed- Throws:
Exception
- if an error occurs such as a bad protocol version or unsuccessful KEX was involved
-
receiveKexInit
protected void receiveKexInit(Map<KexProposalOption, String> proposal, byte[] seed) throws IOException- Specified by:
receiveKexInit
in classAbstractSession
- Throws:
IOException
-
getHostKey
- Specified by:
getHostKey
in interfaceServerSession
- Returns:
- The
KeyPair
representing the current session's used keys on KEX -null
if not negotiated yet
-
getActiveSessionCountForUser
Description copied from interface:ServerSession
Retrieve the current number of sessions active for a given username.- Specified by:
getActiveSessionCountForUser
in interfaceServerSession
- Parameters:
userName
- The name of the user - ignored ifnull
/empty- Returns:
- The current number of live
SshSession
objects associated with the user
-
getId
public long getId()- Returns:
- The underlying
IoSession
id.
-
getConnectionService
- Specified by:
getConnectionService
in classSessionHelper
-