SSHServer class

Inheritance

Constructors

SSHServer(Identity hostkey, {Uri hostport, bool compress = false, List<Forward> forwardLocal, List<Forward> forwardRemote, VoidCallback disconnected, ResponseCallback response, StringCallback print, StringCallback debugPrint, StringCallback tracePrint, SocketInterface socket, Random random, SecureRandom secureRandom, UserAuthRequest userAuthRequest, ChannelRequest sessionChannelRequest, GexRequest gexRequest})

Properties

channels HashMap<int, Channel>
read / write, inherited
cipherIdC2s int
read / write, inherited
cipherIdS2c int
read / write, inherited
client bool
Whether we've initiated the connection.
read-only, inherited
compress bool
Whether compression is supported.
read / write, inherited
compressIdC2s int
read / write, inherited
compressIdS2c int
read / write, inherited
debugPrint StringCallback
Paramtgegr invoked with debug logging.
read / write, inherited
decrypt BlockCipher
read / write, inherited
decryptBlockSize int
read / write, inherited
decryptBuf Uint8List
read / write, inherited
dh DiffieHellman
read / write, inherited
disconnected VoidCallback
Parameter invoked on connection close.
read / write, inherited
ecdh EllipticCurveDiffieHellman
read / write, inherited
encrypt BlockCipher
read / write, inherited
encryptBlockSize int
read / write, inherited
exH Uint8List
read / write, inherited
forwardingRemote HashMap<int, Forward>
read / write, inherited
forwardLocal List<Forward>
Parameter describing local ports to forward over SSH tunnel.
read / write, inherited
forwardRemote List<Forward>
Parameter describing remote ports to forward over SSH tunnel.
read / write, inherited
gexRequest GexRequest
read / write
guessedC bool
read / write, inherited
guessedRightC bool
read / write, inherited
guessedRightS bool
read / write, inherited
guessedS bool
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
hostkeyType int
read / write, inherited
hostport Uri
Remote endpoint of SSH connection. Parameter on client-side.
read / write, inherited
identity Identity
Parameter for public key authentication
read / write, inherited
initialWindowSize int
read / write, inherited
integrityC2s Uint8List
read / write, inherited
integrityS2c Uint8List
read / write, inherited
K BigInt
read / write, inherited
kexHash Digest
read / write, inherited
kexInitC Uint8List
read / write, inherited
kexInitS Uint8List
read / write, inherited
kexMethod int
read / write, inherited
macAlgoC2s HMac
read / write, inherited
macAlgoS2c HMac
read / write, inherited
macHashLenC int
read / write, inherited
macHashLenS int
read / write, inherited
macIdC2s int
read / write, inherited
macIdS2c int
read / write, inherited
macPrefixC2s int
read / write, inherited
macPrefixS2c int
read / write, inherited
maxPacketSize int
read / write, inherited
nextChannelId int
read / write, inherited
packetId int
read / write, inherited
packetLen int
read / write, inherited
packetMacLen int
read / write, inherited
packetS SerializableInput
read / write, inherited
padding int
read / write, inherited
print StringCallback
Parameter invoked with ERROR and INFO loggging.
read / write, inherited
random Random
Source of randomness, e.g Random.secure().
read / write, inherited
readBuffer QueueBuffer
read / write, inherited
remoteForward RemoteForwardCallback
Paramter invoked upon connection to forwarded remote port.
read / write, inherited
response ResponseCallback
Parameter invoked with session channel data (and optionally UI prompts).
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
secureRandom SecureRandom
Pointycastle's random interface.
read / write, inherited
sequenceNumberC2s int
read / write, inherited
sequenceNumberS2c int
read / write, inherited
server bool
read / write, inherited
serverVersion num
read / write, inherited
sessionChannel Channel
read / write, inherited
sessionChannelRequest ChannelRequest
read / write
sessionId Uint8List
read / write, inherited
socket SocketInterface
read / write, inherited
state int
read / write, inherited
tracePrint StringCallback
Paramtger invoked with trace logging.
read / write, inherited
userAuthRequest UserAuthRequest
read / write
verC String
read / write, inherited
verS String
read / write, inherited
x25519dh X25519DiffieHellman
read / write, inherited
zreader ↔ dynamic
read / write, inherited
zwriter ↔ dynamic
read / write, inherited

Methods

acceptChannel(MSG_CHANNEL_OPEN msg) Channel
Accepts MSG_CHANNEL_OPEN request to open a new Channel.
inherited
closeChannel(Channel channel) → void
Send EOF and close for channel.
inherited
disconnect(String reason) → void
If anything goes wrong, disconnect with reason.
inherited
getSecureRandom() SecureRandom
PointyCastle random number generator interface.
inherited
handleChannelClose(Channel chan, [String description]) → void
override
handleChannelData(Channel chan, Uint8List data) → void
override
handleChannelOpenConfirmation(Channel chan) → void
override
handleConnected() → void
When the connection has been established, both sides MUST send an identification string. https://tools.ietf.org/html/rfc4253#section-4.2
inherited
handleDhMSG_KEXDH_INIT(int packetId, MSG_KEXDH_INIT msg) → void
handleEcDhMSG_KEX_ECDH_INIT(MSG_KEX_ECDH_INIT msg) → void
handleInitialState() → void
Consumes the initial Protocol Version Exchange. https://tools.ietf.org/html/rfc4253#section-4.2
inherited
handleMSG_CHANNEL_CLOSE(MSG_CHANNEL_CLOSE msg) → void
Upon receiving this message, a party MUST send back an SSH_MSG_CHANNEL_CLOSE unless it has already sent this message for the channel.
inherited
handleMSG_CHANNEL_DATA(MSG_CHANNEL_DATA msg) → void
Data transfer is done with messages of the type SSH_MSG_CHANNEL_DATA.
inherited
handleMSG_CHANNEL_EOF(MSG_CHANNEL_EOF msg) → void
No explicit response is sent to this message. However, the application may send EOF to whatever is at the other end of the channel.
inherited
handleMSG_CHANNEL_OPEN(MSG_CHANNEL_OPEN msg, SerializableInput packetS) → void
handleMSG_CHANNEL_OPEN_CONFIRMATION(MSG_CHANNEL_OPEN_CONFIRMATION msg) → void
If the remote side can open the channel, it responds with SSH_MSG_CHANNEL_OPEN_CONFIRMATION.
inherited
handleMSG_CHANNEL_OPEN_FAILURE(MSG_CHANNEL_OPEN_FAILURE msg) → void
If the remote side can't open the channel, it responds with SSH_MSG_CHANNEL_OPEN_FAILURE.
inherited
handleMSG_CHANNEL_REQUEST(MSG_CHANNEL_REQUEST msg) → void
handleMSG_CHANNEL_WINDOW_ADJUST(MSG_CHANNEL_WINDOW_ADJUST msg) → void
After receiving this message, the recipient MAY send the given number of bytes more than it was previously allowed to send; the window size is incremented.
inherited
handleMSG_DEBUG(MSG_DEBUG msg) → void
All implementations MUST understand MSG_DEBUG, but they are allowed to ignore it.
inherited
handleMSG_DISCONNECT(MSG_DISCONNECT msg) → void
The recipient MUST NOT accept any data after receiving MSG_DISCONNECT.
inherited
handleMSG_GLOBAL_REQUEST(MSG_GLOBAL_REQUEST msg) → void
https://tools.ietf.org/html/rfc4254#section-4
inherited
handleMSG_IGNORE(MSG_IGNORE msg) → void
MSG_IGNORE can be used as an additional protection measure against advanced traffic analysis techniques.
inherited
handleMSG_KEX_DH_GEX_REQUEST(MSG_KEX_DH_GEX_REQUEST msg) → void
handleMSG_KEXDH_INIT(int packetId, Uint8List packet) → void
handleMSG_KEXINIT(MSG_KEXINIT msg, Uint8List packet) → void
https://tools.ietf.org/html/rfc4253#section-7.1
inherited
handleMSG_NEWKEYS() → void
When MSG_NEWKEYS is received, the new keys and algorithms MUST be used for receiving.
inherited
handleMSG_SERVICE_REQUEST(MSG_SERVICE_REQUEST msg) → void
handleMSG_USERAUTH_REQUEST(MSG_USERAUTH_REQUEST msg) → void
handlePacket(Uint8List packet) → void
override
handleRead(Uint8List dataChunk) → void
Callback supplied to socket.listen.
inherited
handleX25519MSG_KEX_ECDH_INIT(MSG_KEX_ECDH_INIT msg) → void
initCipher(int cipherId, Uint8List IV, Uint8List key, bool dir) BlockCipher
Initializes the block cipher used for encrypted transport.
inherited
initializeDiffieHellman(int kexMethod, Random random) → void
inherited
initializeDiffieHellmanGroup(BigInt p, BigInt g, Random random) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onConnected() → void
Callback supplied to socket.connect.
inherited
openTcpChannel(String sourceHost, int sourcePort, String destHost, int destPort, ChannelCallback cb, {VoidCallback connected, StringCallback error}) Channel
Request remote opens a new TCP channel to destHost:destPort.
inherited
readCipher(Uint8List m) Uint8List
Decrypt data using the negotiated block cipher.
inherited
sendChannelData(Uint8List b) → void
override
sendDiffileHellmanInit() → void
Does nothing. The client initializes Diffie Hellman.
override
sendKeyExchangeInit(bool guess) → void
Key exchange begins by each side sending SSH_MSG_KEXINIT.
inherited
sendNewKeys() → void
inherited
sendToChannel(Channel channel, Uint8List data) → void
Sends data to channel.
inherited
toString() String
A string representation of this object. [...]
inherited
updateExchangeHash(Uint8List kS) → void
Computes a new exchange hash exH given the server key kS.
inherited
writeCipher(SSHMessage msg) → void
Encrypt Binary Packet data using the negotiated block cipher and MAC.
inherited
writeClearOrEncrypted(SSHMessage msg) → void
Send a Binary Packet (e.g. KEX_INIT) that is initially sent in the clear, but encryped when keys are being renegotiated.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited