dartssh2 library

Classes

EcKeyPair
Container for an elliptic curve private key in SEC1 ASN.1 format (BEGIN EC PRIVATE KEY).
OpenSSHBcryptKdfOptions
Bcrypt key derivation parameters used in OpenSSH private key format.
OpenSSHEcdsaKeyPair
An ECDSA (NIST P-256, P-384, P-521) private/public key pair encoded in OpenSSH format.
OpenSSHEd25519KeyPair
An Ed25519 private/public key pair encoded in OpenSSH format.
OpenSSHKdfOptions
Abstract base class for OpenSSH key derivation function options.
OpenSSHKeyPair
Mixin for OpenSSH format key pair implementations.
OpenSSHKeyPairs
Container for private keys encoded in OpenSSH format (openssh-key-v1).
OpenSSHRsaKeyPair
An RSA private/public key pair encoded in OpenSSH format.
RsaKeyPair
Container for an RSA private key encoded in PKCS#1 format (BEGIN RSA PRIVATE KEY).
RsaKeyPairDEKInfo
Represents the DEK-Info header in legacy PEM private keys (RFC 1421).
RsaPrivateKey
An RSA private key decoded from PKCS#1 ASN.1 DER format.
SftpAbortError
SftpClient
SftpError
SftpExtensionError
SftpExtensionUnsupportedError
SftpExtensionVersionMismatchError
SftpFile
Represents an opened file handle on the remote SFTP server.
SftpFileAttrs
SftpFileMode
SftpFileOpenMode
SftpFileWriter
Holds the state of a streaming write operation from stream to file.
SftpHandsake
Handshake information received from the SFTP server.
SftpName
SftpStatusCode
SftpStatusError
SSHAgentChannel
SSHAgentHandler
SSHAgentProtocol
SSHAlgorithms
SSHAuthAbortError
Errors that happen when the authentication failed due to other reasons. For example network errors.
SSHAuthError
Errors that happen when the library fails to authenticate.
SSHAuthFailError
Errors that happen when the library tried all the authentication methods and failed to authenticate.
SSHChangePasswordResponse
SSHChannelOpenError
Errors that happen when the library fails to open a channel.
SSHChannelRequestError
Errors that happen when the library fails to send a channel request.
SSHCipherType
SSHClient
SSHContentType
A MIME/IANA media type used as the value of the SSHHttpHeaders.contentTypeHeader header.
SSHDisconnectError
Thrown when the peer terminates the connection with SSH_MSG_DISCONNECT.
SSHDynamicForward
A local dynamic forwarding server (SOCKS5 CONNECT) managed by SSHClient.
SSHDynamicForwardOptions
Configuration options for dynamic SOCKS forwarding.
SSHError
Interface for all the exceptions thrown by the library.
SSHForwardChannel
Adapts an SSHChannel to behave as an SSHSocket.
SSHHandshakeError
Errors that happen when the library fails to connect to handshake.
SSHHostKey
Represents an SSH public host key or user public key in SSH wire format.
SSHHostkeyError
Errors that happen when the library fails to verify the host key.
SSHHostkeyType
SSHHttpClient
A HTTP client that works over SSH port forwarding.
SSHHttpClientRequest
HTTP request created on a SSHHttpClient.
SSHHttpClientResponse
HTTP response for a SSHHttpClientRequest.
SSHHttpHeaders
Headers for HTTP requests and responses.
SSHIdentity
Represents an identity capable of authenticating an SSH session.
SSHInternalError
Errors that are not expected to occur. Most of the time, these are caused by bugs in the library.
SSHKexPseudoAlgorithm
Pseudo algorithm names that are advertised inside the key exchange name-list without being key exchange algorithms themselves.
SSHKexType
SSHKeyDecodeError
Errors that happen when the library fails to decode a key.
SSHKeyDecryptError
Errors that happen when the library fails to decrypt the host key.
SSHKeyPair
Base interface for in-memory SSH cryptographic key pairs.
SSHKeyPairAgent
SSHMacType
SSHPacketError
Errors that happen when the library receives an malformed packet.
SSHPem
SSHPtyConfig
SSHRawHostKey
An SSHHostKey backed by pre-encoded raw binary wire bytes.
SSHRawSignature
An SSHSignature backed by pre-encoded raw binary wire bytes.
SSHRemoteForward
SSHRunResult
SSHSession
A SSHSession represents a remote execution of a program.
SSHSessionExitSignal
Information about the exit signal of a remote process.
SSHSignature
Represents an SSH digital signature in SSH wire format.
SSHSocket
SSHSocketError
Errors related to the underlying socket.
SSHStateError
Errors that happen when the library receives an unexpected packet.
SSHTransport
SSHUserInfoPrompt
SSHUserInfoRequest
SSHX11Channel
An SSHForwardChannel specifically representing an incoming X11 forwarded channel.
SSHX11Config

Enums

SftpFileType
SSHAuthMethod
SSHHttpProtocolVersion
Version of HTTP to use for the request.
SSHSignal

Mixins

DoneFuture
Implements Future interface for SftpFileWriter.
SSHMessageError
Errors with a message.

Constants

chunkSize → const int
The amount of data to send in a single SFTP packet.
maxBytesOnTheWire → const int
The maximum amount of data that can be sent to the remote host without receiving an acknowledgement.

Functions

digestSha1() → Digest
digestSha256() → Digest
digestSha384() → Digest
digestSha512() → Digest
startDynamicForward({required String bindHost, required int? bindPort, required SSHDynamicForwardOptions options, SSHDynamicConnectionFilter? filter, required SSHDynamicDial dial}) Future<SSHDynamicForward>
Starts a local SOCKS5 dynamic port forwarding proxy server.

Typedefs

SSHAuthenticatedHandler = void Function()
SSHChangePasswordRequestHandler = FutureOr<SSHChangePasswordResponse?> Function(String prompt)
SSHDynamicConnectionFilter = bool Function(String host, int port)
Filters outbound targets requested through a dynamic forward (SOCKS proxy).
SSHDynamicDial = Future<SSHForwardChannel> Function(String host, int port)
Callback invoked to dial an SSH forwarded channel to a target host and port.
SSHHostkeyVerifyHandler = FutureOr<bool> Function(String type, Uint8List fingerprint)
Function called when host key is received. type is the type of the host key, For example 'ssh-rsa', fingerprint OpenSSH-style SHA256 fingerprint of the host key, UTF-8 encoded as SHA256:<base64>.
SSHMessageHandler = bool Function(Uint8List payload)
Handles a packet and returns whether its message type is recognized.
SSHPacketHandler = void Function(Uint8List payload)
SSHPasswordRequestHandler = FutureOr<String?> Function()
https://datatracker.ietf.org/doc/html/rfc4252#section-8
SSHPrintHandler = void Function(String?)
SSHRemoteConnectionFilter = bool Function(String host, int port)
SSHTransportReadyHandler = void Function()
SSHUserauthBannerHandler = void Function(String banner)
https://datatracker.ietf.org/doc/html/rfc4252#section-5.4
SSHUserInfoRequestHandler = FutureOr<List<String>?> Function(SSHUserInfoRequest request)
https://datatracker.ietf.org/doc/html/rfc4256#section-3.3
SSHX11ForwardHandler = void Function(SSHX11Channel channel)

Exceptions / Errors

SSHHttpException
Exception thrown when an SSH HTTP request fails.