Interface SshIdentHandler
public interface SshIdentHandler
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisServer()Tells whether thisSshIdentHandleris for a server.Provides this side's own SSH protocol version, following RFC 4253, section 4.2.readIdentification(org.apache.sshd.common.util.buffer.Buffer buffer) Attempts to read the peer's SSH protocol version from the given buffer, following RFC 4253, section 4.2.
-
Method Details
-
isServer
boolean isServer()Tells whether thisSshIdentHandleris for a server.- Returns:
trueif this handler is for a server,falseif it's for a client
-
readIdentification
Attempts to read the peer's SSH protocol version from the given buffer, following RFC 4253, section 4.2.On a client, the protocol version exchange may contain additional lines before the SSH protocol version is received. The method is supposed to read from the buffer until and including the protocol version, including the terminating CRLF.
If no protocol version is found, the method shall return an empty list or
null. It will be called again once more data has been received (again with the full buffer, including the data scanned previously) until it returns a non-empty list (i.e., it found a protocol version string).- Parameters:
buffer- to scan; upon returnBuffer.rpos()positioned after the last byte consumed- Returns:
- the full list of all lines scanned, the last one containing the protocol version, or an empty list
or
nullif no protocol version was found in the buffer. - See Also:
-
provideIdentification
Provides this side's own SSH protocol version, following RFC 4253, section 4.2.On a client, the list should contain only a single string in the format defined in RFC 4253. On a server, the list may contain additional preamble lines; the last line should be the protocol version identification.
- Returns:
- the protocol version lines; must not be empty or
null
-