SSHClient constructor
SSHClient(
- SSHSocket socket, {
- required String username,
- SSHPrintHandler? printDebug,
- SSHPrintHandler? printTrace,
- SSHAlgorithms algorithms = const SSHAlgorithms(),
- SSHHostkeyVerifyHandler? onVerifyHostKey,
- List<
SSHKeyPair> ? identities, - SSHPasswordRequestHandler? onPasswordRequest,
- SSHChangePasswordRequestHandler? onChangePasswordRequest,
- SSHUserInfoRequestHandler? onUserInfoRequest,
- SSHUserauthBannerHandler? onUserauthBanner,
- SSHAuthenticatedHandler? onAuthenticated,
- Duration? keepAliveInterval = const Duration(seconds: 10),
Implementation
SSHClient(
this.socket, {
required this.username,
this.printDebug,
this.printTrace,
this.algorithms = const SSHAlgorithms(),
this.onVerifyHostKey,
this.identities,
this.onPasswordRequest,
this.onChangePasswordRequest,
this.onUserInfoRequest,
this.onUserauthBanner,
this.onAuthenticated,
this.keepAliveInterval = const Duration(seconds: 10),
}) {
_transport = SSHTransport(
socket,
isServer: false,
printDebug: printDebug,
printTrace: printTrace,
algorithms: algorithms,
onVerifyHostKey: onVerifyHostKey,
onReady: _handleTransportReady,
onPacket: _handlePacket,
);
_transport.done.then(
(_) => _handleTransportClosed(),
onError: (_) => _handleTransportClosed(),
);
_authenticated.future.catchError(
(error, stackTrace) => _transport.closeWithError(error, stackTrace),
);
if (identities != null) {
_keyPairsLeft.addAll(identities!);
}
}