SFTPClient Component

Properties   Methods   Events   Config Settings   Errors  

The SFTPClient component provides client-side functionality for SFTP (Secure File Transfer Protocol).

Syntax

nsoftware.SecureBlackbox.Sftpclient

Remarks

SFTP is a file transfer subsystem that runs on top of secure shell (SSH) connection. This means that SFTP uses the whole strength of security provided by the SSH protocol, at the same time providing strong file transfer capabilities.

Please do keep in mind that there exist two protocols that offer similar secure file transfer features. SFTP works on top of SSH and normally uses port 22. FTPS works on top of TLS (or SSL) and normally uses ports 21 and 990. The protocols are very different, so please make sure you are after the right component. This component works with SFTP. Use the FTPClient component to connect to FTPS servers.

Below are the typical steps that let you integrate SFTPClient to your project:

  • Set up your Username and Password. SSH uses mandatory client-side authentication, so in most cases you need to provide your username, your password, or, sometimes, your private key. Use Key property to provide your key, if needed.
  • Be ready to handle server authentication, which is also mandatory in SSH. SSH operates a concept of a trusted keys file, where keys of known servers are stored. You can assign a path to your own trusted keys file to the TrustedKeysFile property. When a client receives a server key, it reports it to your code via its KnownKeyReceived or UnknownKeyReceived event, depending on whether the key was found in the trusted list. If you leave TrustedKeysFile empty, SFTPClient will only be able to fire the UnknownKeyReceived event, since there will be no known keys to report.
  • If needed, customize Proxy parameters and SSHSettings.
  • Consider interacting more with SFTPClient by subscribing to AuthAttempt, AuthFailed, and AuthSucceeded events to be notified about the client authentication progress.
  • When you are ready to connect, call Connect, passing the details of the server as parameters. During the initial handshake, the following events will fire: UnknownKeyReceived (or KnownKeyReceived), and then one or more AuthAttempt, AuthFailed and AuthSucceeded.
  • Upon completion of the Connect method, the component is ready for file operations. Use DownloadFile, UploadFile, ListDir, DeleteFile and other file transfer methods to work with the server file system.
  • When you are done with your work, call Disconnect to close the connection.

Some SFTP servers, primarily older ones, may expose various transfer issues. If you come across a weird issue that you believe should not be happening (such as repeated connection closures in the middle of the transfer), please try adjusting the following properties:

These adjustments will put SFTPClient in very conservative transfer setup. While this setup may be quite sluggish with modern servers, it should make SFTPClient interoperable with most older servers.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

AuthAttemptsSpecifies the number of SSH authentication attempts.
AutoAdjustTransferBlockSpecifies whether to adjust the send and receive buffer sizes automatically.
ConnectedIndicates if the client is connected to the SFTP server.
ConnectionInfoContains the secure connection info.
CurrentListEntryContains the current entry returned by ListDir .
DownloadBlockSizeThe download block size in bytes.
ExternalCryptoProvides access to external signing and DC parameters.
FIPSModeReserved.
ForceCompressionEnforces compression for the SSH layer.
KeyContains the client's SSH key.
MaxSFTPVersionHigher SFTP version to support.
MinSFTPVersionLower SFTP version to support.
PasswordSpecifies user's authentication password.
PipelineLengthThe number of parallelized transfer requests.
ProxyThe proxy server settings.
ServerKeyReturns the server's public key.
SocketSettingsManages network connection settings.
SSHSettingsThe SSH connection settings.
TrustedKeysFileA file containing the keys of authorized servers.
UploadBlockSizeThe upload block size in bytes.
UsernameThe client's username to authenticate to the server.
UseUTF8Enables UTF8 for all string content.
VersionThe SFTP version negotiated.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

AbsolutePathRequests the absolute path for a relative path.
ChangeDirChanges current working directory on the server.
ConfigSets or retrieves a configuration setting.
ConnectConnects to an SFTP server.
CreateLinkCreates a symbolic or hard link to a remote file.
DeleteDirRemoves directory from the SFTP server.
DeleteFileDeletes a file from the SFTP server.
DeleteFilesDeletes a group of files from the SFTP server.
DirExistsChecks if a directory exists on the SFTP server.
DisconnectDisconnects from the SFTP server.
DoActionPerforms an additional action.
DownloadBytesDownloads a file from the server into an array of bytes.
DownloadFileDownloads a file from the SFTP server.
DownloadFilesDownloads multiple files from the SFTP server.
DownloadStreamDownloads a file from the SFTP server.
ExecuteSSHCommandSends an SSH command to the server in the middle of SFTP session.
ExtensionCmdSends an extension command to the server.
FileExistsChecks whether a file exists on the server.
GetCurrentDirReturns the current directory on the SFTP server.
GetFileSizeChecks the size of a remote file.
ListDirLists the content of the current remote directory.
MakeDirCreates a new directory on the server.
RenameFileRenames a file.
RequestAttributesRequests attributes of the remote file.
SetAttributesSets the attributes upon a remote file.
UploadBytesUploads a byte array to the server.
UploadFileUploads a file to the server.
UploadFilesUploads multiple files to the server.
UploadStreamUploads a file to the server.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

AuthAttemptFires when an authentication attempt is performed.
AuthFailedFires if an authentication attempt fails.
AuthSucceededReports a successful authentication.
BannerReports the receipt of the Welcome message from the server.
DisconnectReports SFTP connection closure.
ErrorInformation about errors during SFTP connection.
ExternalSignHandles remote or external signing initiated by the SignExternal method or other source.
FileOperationSignifies the start of a file transfer operation.
FileOperationResultSignifies the completion of a file transfer operation.
KnownKeyReceivedSignals that the server has introduced itself with a known key.
ListEntryReports a directory listing entry to the application.
NotificationThis event notifies the application about an underlying control flow event.
PasswordChangeRequestSignals that the server requests a password change.
PrivateKeyNeededAsks the application for the client's private key.
ProgressFires periodically during the data transfer.
UnknownKeyReceivedSignals that the server has introduced itself with an unknown key.

Config Settings


The following is a list of config settings for the component with short descriptions. Click on the links for further details.

AdjustFileTimesWhether file times should be adjusted after upload/download.
ASCIIModeWhether ASCII transfer mode is used.
AvailableSpaceReturns details of server disk space availability. This protocol extension must be supported by the server for this request to work.
CaseConversionWhether case conversion must be applied to file names as they are downloaded.
CaseSensitiveSpecifies if file paths are case-sensitive.
CopyModeDefines what to do with each successfully copied file.
DefOutboundBlockSizeThe default outbound block size.
DisablePacketFragmentationEnables or disables SSH packet fragmentation.
ErrorOriginSpecifies whether the error is local or remote.
ErrorSeveritySpecifies whether the error is fatal.
FileHashReturns the hash of the specified file. This protocol extension must be supported by the server for this request to work.
HashAlgorithmThe hash algorithm to use for the protocol operations.
HomeDirReturns a user's home directory. This protocol extension must be supported by the server for this request to work.
IncomingSpeedLimitSpecifies incoming speed limit.
KeepAlivePeriodThe inactivity period after which a keep-alive signal will be sent.
LocalCharsetCharset used on the client machine.
LocalNewLineConventionA character string for the end of line (EOL) indication on the local machine.
ModeThe file open mode to use.
NewLineConventionA character string for the end of line (EOL) indication on the server.
OutgoingSpeedLimitSpecifies incoming speed limit.
PreserveExistingFileTimesWhether original file times should be restored upon transfer.
RecursiveWhether subdirectories should also be scanned for matching files.
RedirectStdErrWhether to redirect output to StdErr.
RemoteCharsetCharset used on the server.
SFTPBufferSizeThe size of internal buffer used for data transfer.
SFTPServerExecutableLocationsLocation of the SFTP server executable.
StatVFSReturns VFS details. This protocol extension must be supported by the server for this request to work.
StdErrDataThe buffer for writing StdErr data.
TempFolderReturns the temporary directory offered by the server. This protocol extension must be supported by the server for this request to work.
TempPathLocation where the temporary files are stored.
TreatZeroSizeAsUndefinedWhether zero size returned by STAT should be considered as undefined.
UseStrictKeyExchangeSpecifies how strict key exchange is supported.
UseTruncateFlagOnUploadwhether to use the 'truncate' flag on file upload.
UseUTF8OnV3Whether to apply UTF-8 conversion for SFTP protocol versions 3 and lower.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the component.
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
StaticDNSSpecifies whether static DNS rules should be used.
StaticIPAddress[domain]Gets or sets an IP address for the specified domain name.
StaticIPAddressesGets or sets all the static DNS rules.
TagAllows to store any custom data.
TLSSessionGroupSpecifies the group name of TLS sessions to be used for session resumption.
TLSSessionLifetimeSpecifies lifetime in seconds of the cached TLS session.
TLSSessionPurgeIntervalSpecifies how often the session cache should remove the expired TLS sessions.
UseOwnDNSResolverSpecifies whether the client components should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

AuthAttempts Property (SFTPClient Component)

Specifies the number of SSH authentication attempts.

Syntax

public int AuthAttempts { get; set; }
Public Property AuthAttempts As Integer

Default Value

1

Remarks

Use this property to specify the number of authentication attempts to try. The AuthFailed event is fired for every failed attempt.

AutoAdjustTransferBlock Property (SFTPClient Component)

Specifies whether to adjust the send and receive buffer sizes automatically.

Syntax

public bool AutoAdjustTransferBlock { get; set; }
Public Property AutoAdjustTransferBlock As Boolean

Default Value

True

Remarks

Automatic transfer block size adjustment may be beneficial for maximizing interoperability and achieving the best transfer speeds.

Use DownloadBlockSize, UploadBlockSize, and PipelineLength properties to adjust the transfer settings manually.

Connected Property (SFTPClient Component)

Indicates if the client is connected to the SFTP server.

Syntax

public bool Connected { get; }
Public ReadOnly Property Connected As Boolean

Default Value

False

Remarks

Use this read-only property to check whether the client is connected to the server.

This property is read-only and not available at design time.

ConnectionInfo Property (SFTPClient Component)

Contains the secure connection info.

Syntax

public SSHInfo ConnectionInfo { get; }
Public ReadOnly Property ConnectionInfo As SSHInfo

Remarks

This property contains various information about the secure connection.

This property is read-only.

Please refer to the SSHInfo type for a complete list of fields.

CurrentListEntry Property (SFTPClient Component)

Contains the current entry returned by ListDir .

Syntax

public SFTPListEntry CurrentListEntry { get; }
Public ReadOnly Property CurrentListEntry As SFTPListEntry

Remarks

Use this property to access the current list entry as returned by ListDir call. Entries are passed back to the application one by one, with ListEntry thrown for each entry.

This property is read-only and not available at design time.

Please refer to the SFTPListEntry type for a complete list of fields.

DownloadBlockSize Property (SFTPClient Component)

The download block size in bytes.

Syntax

public int DownloadBlockSize { get; set; }
Public Property DownloadBlockSize As Integer

Default Value

65536

Remarks

Use this property to manually control the size of download blocks. Typically you will only need to adjust this property if the default transfer settings (AutoAdjustTransferBlock) don't work.

ExternalCrypto Property (SFTPClient Component)

Provides access to external signing and DC parameters.

Syntax

public ExternalCrypto ExternalCrypto { get; }
Public ReadOnly Property ExternalCrypto As ExternalCrypto

Remarks

Use this property to tune-up remote cryptography settings. SecureBlackbox supports two independent types of external cryptography: synchronous (based on the ExternalSign event) and asynchronous (based on the DC protocol and the DCAuth signing component).

This property is read-only.

Please refer to the ExternalCrypto type for a complete list of fields.

FIPSMode Property (SFTPClient Component)

Reserved.

Syntax

public bool FIPSMode { get; set; }
Public Property FIPSMode As Boolean

Default Value

False

Remarks

This property is reserved for future use.

ForceCompression Property (SFTPClient Component)

Enforces compression for the SSH layer.

Syntax

public bool ForceCompression { get; set; }
Public Property ForceCompression As Boolean

Default Value

False

Remarks

Set this property before opening a connection to enforce compression of the SSH packets.

Key Property (SFTPClient Component)

Contains the client's SSH key.

Syntax

public SSHKey Key { get; set; }
Public Property Key As SSHKey

Remarks

Use this property to provide the client's SSH key for authentication. Note that you may start with providing the public part of the key, and only complete it with the private part in response to PrivateKeyNeeded event.

Alternative, you may load the private key straightaway.

This property is not available at design time.

Please refer to the SSHKey type for a complete list of fields.

MaxSFTPVersion Property (SFTPClient Component)

Higher SFTP version to support.

Syntax

public int MaxSFTPVersion { get; set; }
Public Property MaxSFTPVersion As Integer

Default Value

6

Remarks

MaxSFTPVersion and MinSFTPVersion properties control the range of SFTP protocol versions supported by this client.

MinSFTPVersion Property (SFTPClient Component)

Lower SFTP version to support.

Syntax

public int MinSFTPVersion { get; set; }
Public Property MinSFTPVersion As Integer

Default Value

0

Remarks

MaxSFTPVersion and MinSFTPVersion properties control the range of SFTP protocol versions to be supported by this client.

Password Property (SFTPClient Component)

Specifies user's authentication password.

Syntax

public string Password { get; set; }
Public Property Password As String

Default Value

""

Remarks

Use this property to provide an authentication password. This property is only applicable for password-based and keyboard-interactive authentication types.

PipelineLength Property (SFTPClient Component)

The number of parallelized transfer requests.

Syntax

public int PipelineLength { get; set; }
Public Property PipelineLength As Integer

Default Value

32

Remarks

This property controls the number of upload/download requests sent simultaneously. This speeds the transfer up, but may lead to issues with older/immature servers.

Typically you will only need to adjust this property if the default transfer settings (AutoAdjustTransferBlock) don't work.

Proxy Property (SFTPClient Component)

The proxy server settings.

Syntax

public ProxySettings Proxy { get; }
Public ReadOnly Property Proxy As ProxySettings

Remarks

Use this property to tune up the proxy server settings.

This property is read-only.

Please refer to the ProxySettings type for a complete list of fields.

ServerKey Property (SFTPClient Component)

Returns the server's public key.

Syntax

public SSHKey ServerKey { get; }
Public ReadOnly Property ServerKey As SSHKey

Remarks

Use this property to check the details of the server public key.

This property is read-only and not available at design time.

Please refer to the SSHKey type for a complete list of fields.

SocketSettings Property (SFTPClient Component)

Manages network connection settings.

Syntax

public SocketSettings SocketSettings { get; }
Public ReadOnly Property SocketSettings As SocketSettings

Remarks

Use this property to tune up network connection parameters.

This property is read-only.

Please refer to the SocketSettings type for a complete list of fields.

SSHSettings Property (SFTPClient Component)

The SSH connection settings.

Syntax

public SSHSettings SSHSettings { get; }
Public ReadOnly Property SSHSettings As SSHSettings

Remarks

Use this property to access and tune-up the SSH layer settings.

This property is read-only.

Please refer to the SSHSettings type for a complete list of fields.

TrustedKeysFile Property (SFTPClient Component)

A file containing the keys of authorized servers.

Syntax

public string TrustedKeysFile { get; set; }
Public Property TrustedKeysFile As String

Default Value

""

Remarks

Use this property to provide a path to the 'authorized_keys' file to be used by the client.

UploadBlockSize Property (SFTPClient Component)

The upload block size in bytes.

Syntax

public int UploadBlockSize { get; set; }
Public Property UploadBlockSize As Integer

Default Value

32256

Remarks

Use this property to manually control the size of upload blocks. Typically you will only need to adjust this property if the default transfer settings (AutoAdjustTransferBlock) don't work.

Username Property (SFTPClient Component)

The client's username to authenticate to the server.

Syntax

public string Username { get; set; }
Public Property Username As String

Default Value

""

Remarks

Use this property to provide an authentication username (login). This property is only applicable for password-based and keyboard-interactive authentication types.

UseUTF8 Property (SFTPClient Component)

Enables UTF8 for all string content.

Syntax

public bool UseUTF8 { get; set; }
Public Property UseUTF8 As Boolean

Default Value

False

Remarks

If UseUTF8 is true, the component expects all downloaded filenames to be encoded in UTF-8. Set UseUTF8 to false if you connect to a server that does not support UTF8 (e.g., OpenSSH). In this case the file names will be interpreted in the default character set.

Version Property (SFTPClient Component)

The SFTP version negotiated.

Syntax

public int Version { get; }
Public ReadOnly Property Version As Integer

Default Value

0

Remarks

Use this property to get the negotiated SFTP version.

This property is read-only.

AbsolutePath Method (SFTPClient Component)

Requests the absolute path for a relative path.

Syntax

public string AbsolutePath(string remotePath);
Public Function AbsolutePath(ByVal RemotePath As String) As String

Remarks

Use this method to ask the SFTP server to convert a relative path to an absolute.

ChangeDir Method (SFTPClient Component)

Changes current working directory on the server.

Syntax

public void ChangeDir(string remoteDir);
Public Sub ChangeDir(ByVal RemoteDir As String)

Remarks

Changes current working directory on the server to RemoteDir.

Config Method (SFTPClient Component)

Sets or retrieves a configuration setting.

Syntax

public string Config(string configurationString);
Public Function Config(ByVal ConfigurationString As String) As String

Remarks

Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.

Connect Method (SFTPClient Component)

Connects to an SFTP server.

Syntax

public void Connect(string address, int port);
Public Sub Connect(ByVal Address As String, ByVal Port As Integer)

Remarks

Use this method to connect to the SFTP server identified via its Address and Port.

CreateLink Method (SFTPClient Component)

Creates a symbolic or hard link to a remote file.

Syntax

Remarks

Use this method to create a symbolic or hard link on the server. Provide the name of the new link object via the LinkPath parameter, and the destinating file or directory path via the TargetPath parameter. HardLink specifies whether the new link should be hard (true) or symbolic (false).

DeleteDir Method (SFTPClient Component)

Removes directory from the SFTP server.

Syntax

public void DeleteDir(string remoteDir);
Public Sub DeleteDir(ByVal RemoteDir As String)

Remarks

Use RemoteDir to provide a path to the directory to be deleted.

DeleteFile Method (SFTPClient Component)

Deletes a file from the SFTP server.

Syntax

public void DeleteFile(string remoteFile);
Public Sub DeleteFile(ByVal RemoteFile As String)

Remarks

Use the RemoteFile parameter to specify the name of the file to delete.

DeleteFiles Method (SFTPClient Component)

Deletes a group of files from the SFTP server.

Syntax

public void DeleteFiles(string remotePath, string mask, bool caseSensitive, bool recursive);
Public Sub DeleteFiles(ByVal RemotePath As String, ByVal Mask As String, ByVal CaseSensitive As Boolean, ByVal Recursive As Boolean)

Remarks

Use this method to delete a group of files from the SFTP server. Specify the files to be deleted via RemotePath and Mask parameters. Use CaseSensitive and Recursive parameters to tune up the operation.

This method is a more efficient way to delete a group of files than deleting them one by one.

DirExists Method (SFTPClient Component)

Checks if a directory exists on the SFTP server.

Syntax

public bool DirExists(string remoteDir);
Public Function DirExists(ByVal RemoteDir As String) As Boolean

Remarks

RemoteDir specifies the name of the remote directory to check for existence.

Disconnect Method (SFTPClient Component)

Disconnects from the SFTP server.

Syntax

public void Disconnect();
Public Sub Disconnect()

Remarks

Call this method to disconnect from the SFTP server.

DoAction Method (SFTPClient Component)

Performs an additional action.

Syntax

public string DoAction(string actionID, string actionParams);
Public Function DoAction(ByVal ActionID As String, ByVal ActionParams As String) As String

Remarks

DoAction is a generic method available in every component. It is used to perform an additional action introduced after the product major release. The list of actions is not fixed, and may be flexibly extended over time.

The unique identifier (case insensitive) of the action is provided in the ActionID parameter.

ActionParams contains the value of a single parameter, or a list of multiple parameters for the action in the form of PARAM1=VALUE1;PARAM2=VALUE2;....

DownloadBytes Method (SFTPClient Component)

Downloads a file from the server into an array of bytes.

Syntax

public byte[] DownloadBytes(string remoteFile);
Public Function DownloadBytes(ByVal RemoteFile As String) As String

Remarks

Use this method to download RemoteFile into a byte array.

DownloadFile Method (SFTPClient Component)

Downloads a file from the SFTP server.

Syntax

public void DownloadFile(string remoteFile, string localFile);
Public Sub DownloadFile(ByVal RemoteFile As String, ByVal LocalFile As String)

Remarks

Use this method to download RemoteFile into the location specified by LocalFile.

DownloadFiles Method (SFTPClient Component)

Downloads multiple files from the SFTP server.

Syntax

public void DownloadFiles(string remotePath, string localDir);
Public Sub DownloadFiles(ByVal RemotePath As String, ByVal LocalDir As String)

Remarks

RemotePath contains a file mask or regular expression by which the files are selected for download.

LocalDir specifies the local folder where the files should be saved.

DownloadStream Method (SFTPClient Component)

Downloads a file from the SFTP server.

Syntax

public void DownloadStream(string remoteFile, System.IO.Stream localStream);
Public Sub DownloadStream(ByVal RemoteFile As String, ByVal LocalStream As System.IO.Stream)

Remarks

Use this method to download RemoteFile into a LocalStream object.

ExecuteSSHCommand Method (SFTPClient Component)

Sends an SSH command to the server in the middle of SFTP session.

Syntax

public byte[] ExecuteSSHCommand(string command);
Public Function ExecuteSSHCommand(ByVal Command As String) As Byte()

Remarks

Use this command to send an SSH command to the server in the middle of an SFTP session. The command is executed in a secondary channel, so the SFTP connection is not affected.

This method is suitable for simple commands that do not require interaction with the user. The call returns the command output.

ExtensionCmd Method (SFTPClient Component)

Sends an extension command to the server.

Syntax

public byte[] ExtensionCmd(string extn, byte[] dataBuffer);
Public Function ExtensionCmd(ByVal Extn As String, ByVal DataBuffer As Byte()) As Byte()

Remarks

Use this method to send an extension command to the SFTP server. Provide the extension type via the Extn parameter, and the request body via the DataBuffer parameter.

Upon completion of the command, the method returns the response as received from the server.

FileExists Method (SFTPClient Component)

Checks whether a file exists on the server.

Syntax

public bool FileExists(string remoteFile);
Public Function FileExists(ByVal RemoteFile As String) As Boolean

Remarks

Use this method to check if a RemoteFile exists on the server.

GetCurrentDir Method (SFTPClient Component)

Returns the current directory on the SFTP server.

Syntax

public string GetCurrentDir();
Public Function GetCurrentDir() As String

Remarks

Use this method to retrieve the current directory as stored by the component. This is a virtualized current directory, as SFTP protocol does not maintain a concept of the current directory.

GetFileSize Method (SFTPClient Component)

Checks the size of a remote file.

Syntax

public long GetFileSize(string remoteFile);
Public Function GetFileSize(ByVal RemoteFile As String) As Long

Remarks

Returns the size of the RemoteFile.

ListDir Method (SFTPClient Component)

Lists the content of the current remote directory.

Syntax

public string ListDir(bool includeFiles, bool includeDirectories);
Public Function ListDir(ByVal IncludeFiles As Boolean, ByVal IncludeDirectories As Boolean) As String

Remarks

IncludeFiles specifies whether file names and symlinks should be included in the results. IncludeDirectories specifies whether directory names should be included in the result.

Upon receiving the listing, the component will report each entry in it via ListEntry event.

MakeDir Method (SFTPClient Component)

Creates a new directory on the server.

Syntax

public void MakeDir(string remoteDir);
Public Sub MakeDir(ByVal RemoteDir As String)

Remarks

RemoteDir specifies the name of the new directory.

RenameFile Method (SFTPClient Component)

Renames a file.

Syntax

public void RenameFile(string sourceFile, string destFile);
Public Sub RenameFile(ByVal SourceFile As String, ByVal DestFile As String)

Remarks

Use this method to rename a remote file. Provide the old and the new name via SourceFile and DestFile parameters.

RequestAttributes Method (SFTPClient Component)

Requests attributes of the remote file.

Syntax

public string RequestAttributes(string remotePath, bool followSymLinks);
Public Function RequestAttributes(ByVal RemotePath As String, ByVal FollowSymLinks As Boolean) As String

Remarks

Use this method to request attributes of a remote file. Pass the name of the file via the RemotePath parameter, and use FollowSymLinks to specify whether symbolic links should be resolved.

The method returns the list of attributes as a line of semicolon-separated entries: Size=78220;Owner=user@system;Group=none@system;Permissions=432;ATime=2020-04-28 08:21:00.295;MTime=2020-04-28 08:21:00.302;CTime=2020-04-28 08:21:00.295;AttribBits=24;LinkCount=1.

SetAttributes Method (SFTPClient Component)

Sets the attributes upon a remote file.

Syntax

public void SetAttributes(string remotePath, string attributes);
Public Sub SetAttributes(ByVal RemotePath As String, ByVal Attributes As String)

Remarks

Use this method to set the attributes of a remote file.

UploadBytes Method (SFTPClient Component)

Uploads a byte array to the server.

Syntax

public void UploadBytes(byte[] bytes, string remoteFile);
Public Sub UploadBytes(ByVal Bytes As String, ByVal RemoteFile As String)

Remarks

Use this method to upload Bytes or its part to RemoteFile on the server.

UploadFile Method (SFTPClient Component)

Uploads a file to the server.

Syntax

public void UploadFile(string localFile, string remoteFile);
Public Sub UploadFile(ByVal LocalFile As String, ByVal RemoteFile As String)

Remarks

Use this method to upload LocalFile to the RemoteFile location on the server.

UploadFiles Method (SFTPClient Component)

Uploads multiple files to the server.

Syntax

public void UploadFiles(string localPath, string remoteDir);
Public Sub UploadFiles(ByVal LocalPath As String, ByVal RemoteDir As String)

Remarks

Use this property to upload a batch of files to the server.

LocalPath specifies a wildcard or regular expression by which the local files are picked for uploading. RemoteDir specifies the location on the server where these files should be saved.

UploadStream Method (SFTPClient Component)

Uploads a file to the server.

Syntax

public void UploadStream(System.IO.Stream localStream, string remoteFile);
Public Sub UploadStream(ByVal LocalStream As System.IO.Stream, ByVal RemoteFile As String)

Remarks

Use this method to upload the contents of LocalStream to the RemoteFile location on the server.

AuthAttempt Event (SFTPClient Component)

Fires when an authentication attempt is performed.

Syntax

public event OnAuthAttemptHandler OnAuthAttempt;

public delegate void OnAuthAttemptHandler(object sender, SftpclientAuthAttemptEventArgs e);

public class SftpclientAuthAttemptEventArgs : EventArgs {
  public int AuthType { get; }
}
Public Event OnAuthAttempt As OnAuthAttemptHandler

Public Delegate Sub OnAuthAttemptHandler(sender As Object, e As SftpclientAuthAttemptEventArgs)

Public Class SftpclientAuthAttemptEventArgs Inherits EventArgs
  Public ReadOnly Property AuthType As Integer
End Class

Remarks

This event signals the start of an authentication attempt. The AuthType parameter specifies the authentication type. This event may be fired more than once if the client tries different authentication methods one after another.

Supported authentication types:

atRhosts0x01RHOSTS file authentication. Rarely used today.

atPublicKey0x02Public key (sometimes called private key) authentication

atPassword0x04Password-based authentication

atHostbased0x08Hostbased authentication

atKeyboard0x10Keyboard-interactive authentication. This is often used in place of generic password authentication.

atGssWithMic0x20GSS authentication

atGssKeyex0x40GSS authentication with key exchange

atPublicKeyAgent0x80Public key agent authentication

AuthFailed Event (SFTPClient Component)

Fires if an authentication attempt fails.

Syntax

public event OnAuthFailedHandler OnAuthFailed;

public delegate void OnAuthFailedHandler(object sender, SftpclientAuthFailedEventArgs e);

public class SftpclientAuthFailedEventArgs : EventArgs {
  public int AuthType { get; }
}
Public Event OnAuthFailed As OnAuthFailedHandler

Public Delegate Sub OnAuthFailedHandler(sender As Object, e As SftpclientAuthFailedEventArgs)

Public Class SftpclientAuthFailedEventArgs Inherits EventArgs
  Public ReadOnly Property AuthType As Integer
End Class

Remarks

This event fires if an authentication attempt fails (for example, if a bad password had been provided). AuthType parameter indicates the authentication type.

AuthFailed may be fired more than once, depending on the configured authentication parameters and the value assigned to the AuthAttempts property.

This event does not necessarily lead to connection abortion, as the client may still have a chance of authenticating with a different method.

Supported authentication types:

atRhosts0x01RHOSTS file authentication. Rarely used today.

atPublicKey0x02Public key (sometimes called private key) authentication

atPassword0x04Password-based authentication

atHostbased0x08Hostbased authentication

atKeyboard0x10Keyboard-interactive authentication. This is often used in place of generic password authentication.

atGssWithMic0x20GSS authentication

atGssKeyex0x40GSS authentication with key exchange

atPublicKeyAgent0x80Public key agent authentication

AuthSucceeded Event (SFTPClient Component)

Reports a successful authentication.

Syntax

public event OnAuthSucceededHandler OnAuthSucceeded;

public delegate void OnAuthSucceededHandler(object sender, SftpclientAuthSucceededEventArgs e);

public class SftpclientAuthSucceededEventArgs : EventArgs {
}
Public Event OnAuthSucceeded As OnAuthSucceededHandler

Public Delegate Sub OnAuthSucceededHandler(sender As Object, e As SftpclientAuthSucceededEventArgs)

Public Class SftpclientAuthSucceededEventArgs Inherits EventArgs
End Class

Remarks

This event marks the completion of the authentication procedure, and signifies transition to the SSH connection subprotocol.

Banner Event (SFTPClient Component)

Reports the receipt of the Welcome message from the server.

Syntax

public event OnBannerHandler OnBanner;

public delegate void OnBannerHandler(object sender, SftpclientBannerEventArgs e);

public class SftpclientBannerEventArgs : EventArgs {
  public byte[] Text { get; }
  public byte[] Language { get; }
}
Public Event OnBanner As OnBannerHandler

Public Delegate Sub OnBannerHandler(sender As Object, e As SftpclientBannerEventArgs)

Public Class SftpclientBannerEventArgs Inherits EventArgs
  Public ReadOnly Property Text As Byte()
  Public ReadOnly Property Language As Byte()
End Class

Remarks

The component fires this event when it receives a welcome message from the server. Use the Text parameter to access the encoded message.

Disconnect Event (SFTPClient Component)

Reports SFTP connection closure.

Syntax

public event OnDisconnectHandler OnDisconnect;

public delegate void OnDisconnectHandler(object sender, SftpclientDisconnectEventArgs e);

public class SftpclientDisconnectEventArgs : EventArgs {
  public int CloseReason { get; }
}
Public Event OnDisconnect As OnDisconnectHandler

Public Delegate Sub OnDisconnectHandler(sender As Object, e As SftpclientDisconnectEventArgs)

Public Class SftpclientDisconnectEventArgs Inherits EventArgs
  Public ReadOnly Property CloseReason As Integer
End Class

Remarks

The component fires this event to report connection closure. No more SFTP activity could be done after the disconnect.

Error Event (SFTPClient Component)

Information about errors during SFTP connection.

Syntax

public event OnErrorHandler OnError;

public delegate void OnErrorHandler(object sender, SftpclientErrorEventArgs e);

public class SftpclientErrorEventArgs : EventArgs {
  public int ErrorCode { get; }
  public string Description { get; }
}
Public Event OnError As OnErrorHandler

Public Delegate Sub OnErrorHandler(sender As Object, e As SftpclientErrorEventArgs)

Public Class SftpclientErrorEventArgs Inherits EventArgs
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Description As String
End Class

Remarks

The event is fired in case of exceptional conditions during data transfer.

ErrorCode contains an error code and Description contains a textual description of the error. For a list of error codes please refer to SFTP.

ExternalSign Event (SFTPClient Component)

Handles remote or external signing initiated by the SignExternal method or other source.

Syntax

public event OnExternalSignHandler OnExternalSign;

public delegate void OnExternalSignHandler(object sender, SftpclientExternalSignEventArgs e);

public class SftpclientExternalSignEventArgs : EventArgs {
  public string OperationId { get; }
  public string HashAlgorithm { get; }
  public string Pars { get; }
  public string Data { get; }
  public string SignedData { get; set; }
}
Public Event OnExternalSign As OnExternalSignHandler

Public Delegate Sub OnExternalSignHandler(sender As Object, e As SftpclientExternalSignEventArgs)

Public Class SftpclientExternalSignEventArgs Inherits EventArgs
  Public ReadOnly Property OperationId As String
  Public ReadOnly Property HashAlgorithm As String
  Public ReadOnly Property Pars As String
  Public ReadOnly Property Data As String
  Public Property SignedData As String
End Class

Remarks

Assign a handler to this event if you need to delegate a low-level signing operation to an external, remote, or custom signing engine. Depending on the settings, the handler will receive a hashed or unhashed value to be signed.

The event handler must pass the value of Data to the signer, obtain the signature, and pass it back to the component via the SignedData parameter.

OperationId provides a comment about the operation and its origin. It depends on the exact component being used, and may be empty. HashAlgorithm specifies the hash algorithm being used for the operation, and Pars contains algorithm-dependent parameters.

The component uses base16 (hex) encoding for the Data, SignedData, and Pars parameters. If your signing engine uses a different input and output encoding, you may need to decode and/or encode the data before and/or after the signing.

A sample MD5 hash encoded in base16: a0dee2a0382afbb09120ffa7ccd8a152 - lower case base16 A0DEE2A0382AFBB09120FFA7CCD8A152 - upper case base16

A sample event handler that uses the .NET RSACryptoServiceProvider class may look like the following: signer.OnExternalSign += (s, e) => { var cert = new X509Certificate2("cert.pfx", "", X509KeyStorageFlags.Exportable); var key = (RSACryptoServiceProvider)cert.PrivateKey; var dataToSign = e.Data.FromBase16String(); var signedData = key.SignHash(dataToSign, "2.16.840.1.101.3.4.2.1"); e.SignedData = signedData.ToBase16String(); };

FileOperation Event (SFTPClient Component)

Signifies the start of a file transfer operation.

Syntax

public event OnFileOperationHandler OnFileOperation;

public delegate void OnFileOperationHandler(object sender, SftpclientFileOperationEventArgs e);

public class SftpclientFileOperationEventArgs : EventArgs {
  public int Operation { get; }
  public string RemotePath { get; }
  public string LocalPath { get; }
  public bool Skip { get; set; }
  public bool Cancel { get; set; }
}
Public Event OnFileOperation As OnFileOperationHandler

Public Delegate Sub OnFileOperationHandler(sender As Object, e As SftpclientFileOperationEventArgs)

Public Class SftpclientFileOperationEventArgs Inherits EventArgs
  Public ReadOnly Property Operation As Integer
  Public ReadOnly Property RemotePath As String
  Public ReadOnly Property LocalPath As String
  Public Property Skip As Boolean
  Public Property Cancel As Boolean
End Class

Remarks

This event is fired each time the component starts an upload or download operation within a multi-file call. Operation defines the operation about to start, RemotePath specifies the name and path to the remote file, and LocalPath specifies the name and path to the local file.

If needed, set Skip to true to ignore the current file, or Cancel to abort the whole batch.

Supported operations:

csfoDownloadFile0Download file

csfoUploadFile1Upload file

csfoDeleteFile2Delete file

csfoMakeDir3Make directory

FileOperationResult Event (SFTPClient Component)

Signifies the completion of a file transfer operation.

Syntax

public event OnFileOperationResultHandler OnFileOperationResult;

public delegate void OnFileOperationResultHandler(object sender, SftpclientFileOperationResultEventArgs e);

public class SftpclientFileOperationResultEventArgs : EventArgs {
  public int Operation { get; }
  public string RemotePath { get; }
  public string LocalPath { get; }
  public int ErrorCode { get; }
  public string Comment { get; }
  public bool Cancel { get; set; }
}
Public Event OnFileOperationResult As OnFileOperationResultHandler

Public Delegate Sub OnFileOperationResultHandler(sender As Object, e As SftpclientFileOperationResultEventArgs)

Public Class SftpclientFileOperationResultEventArgs Inherits EventArgs
  Public ReadOnly Property Operation As Integer
  Public ReadOnly Property RemotePath As String
  Public ReadOnly Property LocalPath As String
  Public ReadOnly Property ErrorCode As Integer
  Public ReadOnly Property Comment As String
  Public Property Cancel As Boolean
End Class

Remarks

This event is fired each time the component completes a file transfer within a multi-file call. Operation defines the operation performed on the file, RemotePath specifies the name and path to the remote file, and LocalPath specifies the name and path to the local file.

ErrorCode and Comment return the code and textual description of the error, if it was encountered.

Set Cancel to True to cancel the multi-file operation.

Supported operations:

csfoDownloadFile0Download file

csfoUploadFile1Upload file

csfoDeleteFile2Delete file

csfoMakeDir3Make directory

KnownKeyReceived Event (SFTPClient Component)

Signals that the server has introduced itself with a known key.

Syntax

public event OnKnownKeyReceivedHandler OnKnownKeyReceived;

public delegate void OnKnownKeyReceivedHandler(object sender, SftpclientKnownKeyReceivedEventArgs e);

public class SftpclientKnownKeyReceivedEventArgs : EventArgs {
  public string Algorithm { get; }
  public int Bits { get; }
  public string FingerprintSHA256 { get; }
}
Public Event OnKnownKeyReceived As OnKnownKeyReceivedHandler

Public Delegate Sub OnKnownKeyReceivedHandler(sender As Object, e As SftpclientKnownKeyReceivedEventArgs)

Public Class SftpclientKnownKeyReceivedEventArgs Inherits EventArgs
  Public ReadOnly Property Algorithm As String
  Public ReadOnly Property Bits As Integer
  Public ReadOnly Property FingerprintSHA256 As String
End Class

Remarks

The component fires this event to tell the application that the server has introduced itself with a known key from TrustedKeysFile.

The details of the key are provided: Algorithm and Bits specify the key algorithm and the number of bits. FingerprintSHA256 contains the key's fingerprint.

Use ServerKey to access more key details.

ListEntry Event (SFTPClient Component)

Reports a directory listing entry to the application.

Syntax

public event OnListEntryHandler OnListEntry;

public delegate void OnListEntryHandler(object sender, SftpclientListEntryEventArgs e);

public class SftpclientListEntryEventArgs : EventArgs {
  public string Filename { get; }
}
Public Event OnListEntry As OnListEntryHandler

Public Delegate Sub OnListEntryHandler(sender As Object, e As SftpclientListEntryEventArgs)

Public Class SftpclientListEntryEventArgs Inherits EventArgs
  Public ReadOnly Property Filename As String
End Class

Remarks

The component fires this event to report a directory listing entry to the application. FileName contains the entry name.

Use CurrentListEntry to access the details of the entry.

Notification Event (SFTPClient Component)

This event notifies the application about an underlying control flow event.

Syntax

public event OnNotificationHandler OnNotification;

public delegate void OnNotificationHandler(object sender, SftpclientNotificationEventArgs e);

public class SftpclientNotificationEventArgs : EventArgs {
  public string EventID { get; }
  public string EventParam { get; }
}
Public Event OnNotification As OnNotificationHandler

Public Delegate Sub OnNotificationHandler(sender As Object, e As SftpclientNotificationEventArgs)

Public Class SftpclientNotificationEventArgs Inherits EventArgs
  Public ReadOnly Property EventID As String
  Public ReadOnly Property EventParam As String
End Class

Remarks

The component fires this event to let the application know about some event, occurrence, or milestone in the component. For example, it may fire to report completion of the document processing. The list of events being reported is not fixed, and may be flexibly extended over time.

The unique identifier of the event is provided in the EventID parameter. EventParam contains any parameters accompanying the occurrence. Depending on the type of the component, the exact action it is performing, or the document being processed, one or both may be omitted.

PasswordChangeRequest Event (SFTPClient Component)

Signals that the server requests a password change.

Syntax

public event OnPasswordChangeRequestHandler OnPasswordChangeRequest;

public delegate void OnPasswordChangeRequestHandler(object sender, SftpclientPasswordChangeRequestEventArgs e);

public class SftpclientPasswordChangeRequestEventArgs : EventArgs {
  public string Prompt { get; }
  public string NewPassword { get; set; }
  public bool Cancel { get; set; }
}
Public Event OnPasswordChangeRequest As OnPasswordChangeRequestHandler

Public Delegate Sub OnPasswordChangeRequestHandler(sender As Object, e As SftpclientPasswordChangeRequestEventArgs)

Public Class SftpclientPasswordChangeRequestEventArgs Inherits EventArgs
  Public ReadOnly Property Prompt As String
  Public Property NewPassword As String
  Public Property Cancel As Boolean
End Class

Remarks

The component fires this event to pass the password change request from the server to the application. This event is fired during the SSH handshake.

PrivateKeyNeeded Event (SFTPClient Component)

Asks the application for the client's private key.

Syntax

public event OnPrivateKeyNeededHandler OnPrivateKeyNeeded;

public delegate void OnPrivateKeyNeededHandler(object sender, SftpclientPrivateKeyNeededEventArgs e);

public class SftpclientPrivateKeyNeededEventArgs : EventArgs {
  public bool Skip { get; set; }
}
Public Event OnPrivateKeyNeeded As OnPrivateKeyNeededHandler

Public Delegate Sub OnPrivateKeyNeededHandler(sender As Object, e As SftpclientPrivateKeyNeededEventArgs)

Public Class SftpclientPrivateKeyNeededEventArgs Inherits EventArgs
  Public Property Skip As Boolean
End Class

Remarks

The component fires this event if the public key provided in Key was accepted by the server, but no private key is available for it.

Use this event handler to attach the private key to your Key. The component will pick the key up and continue the authentication.

Progress Event (SFTPClient Component)

Fires periodically during the data transfer.

Syntax

public event OnProgressHandler OnProgress;

public delegate void OnProgressHandler(object sender, SftpclientProgressEventArgs e);

public class SftpclientProgressEventArgs : EventArgs {
  public long Total { get; }
  public long Current { get; }
  public bool Cancel { get; set; }
}
Public Event OnProgress As OnProgressHandler

Public Delegate Sub OnProgressHandler(sender As Object, e As SftpclientProgressEventArgs)

Public Class SftpclientProgressEventArgs Inherits EventArgs
  Public ReadOnly Property Total As Long
  Public ReadOnly Property Current As Long
  Public Property Cancel As Boolean
End Class

Remarks

Use this event to check the progress of an upload or download operation. Total indicates the total number of bytes to be transferred; Current specifies how much data has been transferred so far, and Cancel gives you a chance to cancel the operation.

UnknownKeyReceived Event (SFTPClient Component)

Signals that the server has introduced itself with an unknown key.

Syntax

public event OnUnknownKeyReceivedHandler OnUnknownKeyReceived;

public delegate void OnUnknownKeyReceivedHandler(object sender, SftpclientUnknownKeyReceivedEventArgs e);

public class SftpclientUnknownKeyReceivedEventArgs : EventArgs {
  public string Algorithm { get; }
  public int Bits { get; }
  public string FingerprintSHA256 { get; }
  public int Action { get; set; }
}
Public Event OnUnknownKeyReceived As OnUnknownKeyReceivedHandler

Public Delegate Sub OnUnknownKeyReceivedHandler(sender As Object, e As SftpclientUnknownKeyReceivedEventArgs)

Public Class SftpclientUnknownKeyReceivedEventArgs Inherits EventArgs
  Public ReadOnly Property Algorithm As String
  Public ReadOnly Property Bits As Integer
  Public ReadOnly Property FingerprintSHA256 As String
  Public Property Action As Integer
End Class

Remarks

The component fires this event to tell the application that the server has introduced itself with a key not present in TrustedKeysFile.

The details of the key are provided: Algorithm and Bits specify the key algorithm and the number of bits. FingerprintSHA256 contains the key's fingerprint.

In this event handler, you need to make a decision whether to proceed with the connection. Use Action to tell the component what it should do with the key:

catAcceptOnce1Accept the key for the current session only.
catAcceptPermanently2Accept the key for the current session and store the key to the trusted keys list.
catReject3Reject the key and close the connection.
Note that accepting an unknown and unchecked key may be risky.

ExternalCrypto Type

Specifies the parameters of external cryptographic calls.

Remarks

External cryptocalls are used in a Distributed Cryptography (DC) subsystem, which allows the delegation of security operations to the remote agent. For instance, it can be used to compute the signature value on the server, while retaining the client's private key locally.

Fields

AsyncDocumentID
string

Default Value: ""

Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls.

Use this property when working with multi-signature DCAuth requests and responses to uniquely identify documents signed within a larger batch. On the completion stage, this value helps the signing component identify the correct signature in the returned batch of responses.

If using batched requests, make sure to set this property to the same value on both the pre-signing (SignAsyncBegin) and completion (SignAsyncEnd) stages.

CustomParams
string

Default Value: ""

Custom parameters to be passed to the signing service (uninterpreted).

Data
string

Default Value: ""

Additional data to be included in the async state and mirrored back by the requestor.

ExternalHashCalculation
bool

Default Value: False

Specifies whether the message hash is to be calculated at the external endpoint. Please note that this mode is not supported by the DCAuth component.

If set to true, the component will pass a few kilobytes of to-be-signed data from the document to the OnExternalSign event. This only applies when SignExternal() is called.

HashAlgorithm
string

Default Value: "SHA256"

Specifies the request's signature hash algorithm.

SB_HASH_ALGORITHM_SHA1SHA1
SB_HASH_ALGORITHM_SHA224SHA224
SB_HASH_ALGORITHM_SHA256SHA256
SB_HASH_ALGORITHM_SHA384SHA384
SB_HASH_ALGORITHM_SHA512SHA512
SB_HASH_ALGORITHM_MD2MD2
SB_HASH_ALGORITHM_MD4MD4
SB_HASH_ALGORITHM_MD5MD5
SB_HASH_ALGORITHM_RIPEMD160RIPEMD160
SB_HASH_ALGORITHM_CRC32CRC32
SB_HASH_ALGORITHM_SSL3SSL3
SB_HASH_ALGORITHM_GOST_R3411_1994GOST1994
SB_HASH_ALGORITHM_WHIRLPOOLWHIRLPOOL
SB_HASH_ALGORITHM_POLY1305POLY1305
SB_HASH_ALGORITHM_SHA3_224SHA3_224
SB_HASH_ALGORITHM_SHA3_256SHA3_256
SB_HASH_ALGORITHM_SHA3_384SHA3_384
SB_HASH_ALGORITHM_SHA3_512SHA3_512
SB_HASH_ALGORITHM_BLAKE2S_128BLAKE2S_128
SB_HASH_ALGORITHM_BLAKE2S_160BLAKE2S_160
SB_HASH_ALGORITHM_BLAKE2S_224BLAKE2S_224
SB_HASH_ALGORITHM_BLAKE2S_256BLAKE2S_256
SB_HASH_ALGORITHM_BLAKE2B_160BLAKE2B_160
SB_HASH_ALGORITHM_BLAKE2B_256BLAKE2B_256
SB_HASH_ALGORITHM_BLAKE2B_384BLAKE2B_384
SB_HASH_ALGORITHM_BLAKE2B_512BLAKE2B_512
SB_HASH_ALGORITHM_SHAKE_128SHAKE_128
SB_HASH_ALGORITHM_SHAKE_256SHAKE_256
SB_HASH_ALGORITHM_SHAKE_128_LENSHAKE_128_LEN
SB_HASH_ALGORITHM_SHAKE_256_LENSHAKE_256_LEN

KeyID
string

Default Value: ""

The ID of the pre-shared key used for DC request authentication.

Asynchronous DCAuth-driven communication requires that parties authenticate each other with a secret pre-shared cryptographic key. This provides an extra protection layer for the protocol and diminishes the risk of the private key becoming abused by foreign parties. Use this property to provide the pre-shared key identifier, and use KeySecret to pass the key itself.

The same KeyID/KeySecret pair should be used on the DCAuth side for the signing requests to be accepted.

Note: The KeyID/KeySecret scheme is very similar to the AuthKey scheme used in various Cloud service providers to authenticate users.

Example: signer.ExternalCrypto.KeyID = "MainSigningKey"; signer.ExternalCrypto.KeySecret = "abcdef0123456789";

KeySecret
string

Default Value: ""

The pre-shared key used for DC request authentication. This key must be set and match the key used by the DCAuth counterpart for the scheme to work.

Read more about configuring authentication in the KeyID topic.

Method
AsyncSignMethods

Default Value: 0

Specifies the asynchronous signing method. This is typically defined by the DC server capabilities and setup.

Available options:

asmdPKCS10
asmdPKCS71

Mode
ExternalCryptoModes

Default Value: 0

Specifies the external cryptography mode.

Available options:

ecmDefaultThe default value (0)
ecmDisabledDo not use DC or external signing (1)
ecmGenericGeneric external signing with the OnExternalSign event (2)
ecmDCAuthDCAuth signing (3)
ecmDCAuthJSONDCAuth signing in JSON format (4)

PublicKeyAlgorithm
string

Default Value: ""

Provide the public key algorithm here if the certificate is not available on the pre-signing stage.

SB_CERT_ALGORITHM_ID_RSA_ENCRYPTIONrsaEncryption
SB_CERT_ALGORITHM_MD2_RSA_ENCRYPTIONmd2withRSAEncryption
SB_CERT_ALGORITHM_MD5_RSA_ENCRYPTIONmd5withRSAEncryption
SB_CERT_ALGORITHM_SHA1_RSA_ENCRYPTIONsha1withRSAEncryption
SB_CERT_ALGORITHM_ID_DSAid-dsa
SB_CERT_ALGORITHM_ID_DSA_SHA1id-dsa-with-sha1
SB_CERT_ALGORITHM_DH_PUBLICdhpublicnumber
SB_CERT_ALGORITHM_SHA224_RSA_ENCRYPTIONsha224WithRSAEncryption
SB_CERT_ALGORITHM_SHA256_RSA_ENCRYPTIONsha256WithRSAEncryption
SB_CERT_ALGORITHM_SHA384_RSA_ENCRYPTIONsha384WithRSAEncryption
SB_CERT_ALGORITHM_SHA512_RSA_ENCRYPTIONsha512WithRSAEncryption
SB_CERT_ALGORITHM_ID_RSAPSSid-RSASSA-PSS
SB_CERT_ALGORITHM_ID_RSAOAEPid-RSAES-OAEP
SB_CERT_ALGORITHM_RSASIGNATURE_RIPEMD160ripemd160withRSA
SB_CERT_ALGORITHM_ID_ELGAMALelGamal
SB_CERT_ALGORITHM_SHA1_ECDSAecdsa-with-SHA1
SB_CERT_ALGORITHM_RECOMMENDED_ECDSAecdsa-recommended
SB_CERT_ALGORITHM_SHA224_ECDSAecdsa-with-SHA224
SB_CERT_ALGORITHM_SHA256_ECDSAecdsa-with-SHA256
SB_CERT_ALGORITHM_SHA384_ECDSAecdsa-with-SHA384
SB_CERT_ALGORITHM_SHA512_ECDSAecdsa-with-SHA512
SB_CERT_ALGORITHM_ECid-ecPublicKey
SB_CERT_ALGORITHM_SPECIFIED_ECDSAecdsa-specified
SB_CERT_ALGORITHM_GOST_R3410_1994id-GostR3410-94
SB_CERT_ALGORITHM_GOST_R3410_2001id-GostR3410-2001
SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_1994id-GostR3411-94-with-GostR3410-94
SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_2001id-GostR3411-94-with-GostR3410-2001
SB_CERT_ALGORITHM_SHA1_ECDSA_PLAINecdsa-plain-SHA1
SB_CERT_ALGORITHM_SHA224_ECDSA_PLAINecdsa-plain-SHA224
SB_CERT_ALGORITHM_SHA256_ECDSA_PLAINecdsa-plain-SHA256
SB_CERT_ALGORITHM_SHA384_ECDSA_PLAINecdsa-plain-SHA384
SB_CERT_ALGORITHM_SHA512_ECDSA_PLAINecdsa-plain-SHA512
SB_CERT_ALGORITHM_RIPEMD160_ECDSA_PLAINecdsa-plain-RIPEMD160
SB_CERT_ALGORITHM_WHIRLPOOL_RSA_ENCRYPTIONwhirlpoolWithRSAEncryption
SB_CERT_ALGORITHM_ID_DSA_SHA224id-dsa-with-sha224
SB_CERT_ALGORITHM_ID_DSA_SHA256id-dsa-with-sha256
SB_CERT_ALGORITHM_SHA3_224_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-sha3-224
SB_CERT_ALGORITHM_SHA3_256_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-sha3-256
SB_CERT_ALGORITHM_SHA3_384_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-sha3-384
SB_CERT_ALGORITHM_SHA3_512_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-sha3-512
SB_CERT_ALGORITHM_SHA3_224_ECDSAid-ecdsa-with-sha3-224
SB_CERT_ALGORITHM_SHA3_256_ECDSAid-ecdsa-with-sha3-256
SB_CERT_ALGORITHM_SHA3_384_ECDSAid-ecdsa-with-sha3-384
SB_CERT_ALGORITHM_SHA3_512_ECDSAid-ecdsa-with-sha3-512
SB_CERT_ALGORITHM_SHA3_224_ECDSA_PLAINid-ecdsa-plain-with-sha3-224
SB_CERT_ALGORITHM_SHA3_256_ECDSA_PLAINid-ecdsa-plain-with-sha3-256
SB_CERT_ALGORITHM_SHA3_384_ECDSA_PLAINid-ecdsa-plain-with-sha3-384
SB_CERT_ALGORITHM_SHA3_512_ECDSA_PLAINid-ecdsa-plain-with-sha3-512
SB_CERT_ALGORITHM_ID_DSA_SHA3_224id-dsa-with-sha3-224
SB_CERT_ALGORITHM_ID_DSA_SHA3_256id-dsa-with-sha3-256
SB_CERT_ALGORITHM_BLAKE2S_128_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2s128
SB_CERT_ALGORITHM_BLAKE2S_160_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2s160
SB_CERT_ALGORITHM_BLAKE2S_224_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2s224
SB_CERT_ALGORITHM_BLAKE2S_256_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2s256
SB_CERT_ALGORITHM_BLAKE2B_160_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2b160
SB_CERT_ALGORITHM_BLAKE2B_256_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2b256
SB_CERT_ALGORITHM_BLAKE2B_384_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2b384
SB_CERT_ALGORITHM_BLAKE2B_512_RSA_ENCRYPTIONid-rsassa-pkcs1-v1_5-with-blake2b512
SB_CERT_ALGORITHM_BLAKE2S_128_ECDSAid-ecdsa-with-blake2s128
SB_CERT_ALGORITHM_BLAKE2S_160_ECDSAid-ecdsa-with-blake2s160
SB_CERT_ALGORITHM_BLAKE2S_224_ECDSAid-ecdsa-with-blake2s224
SB_CERT_ALGORITHM_BLAKE2S_256_ECDSAid-ecdsa-with-blake2s256
SB_CERT_ALGORITHM_BLAKE2B_160_ECDSAid-ecdsa-with-blake2b160
SB_CERT_ALGORITHM_BLAKE2B_256_ECDSAid-ecdsa-with-blake2b256
SB_CERT_ALGORITHM_BLAKE2B_384_ECDSAid-ecdsa-with-blake2b384
SB_CERT_ALGORITHM_BLAKE2B_512_ECDSAid-ecdsa-with-blake2b512
SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA_PLAINid-ecdsa-plain-with-blake2s128
SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA_PLAINid-ecdsa-plain-with-blake2s160
SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA_PLAINid-ecdsa-plain-with-blake2s224
SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA_PLAINid-ecdsa-plain-with-blake2s256
SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA_PLAINid-ecdsa-plain-with-blake2b160
SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA_PLAINid-ecdsa-plain-with-blake2b256
SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA_PLAINid-ecdsa-plain-with-blake2b384
SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA_PLAINid-ecdsa-plain-with-blake2b512
SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_224id-dsa-with-blake2s224
SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_256id-dsa-with-blake2s256
SB_CERT_ALGORITHM_EDDSA_ED25519id-Ed25519
SB_CERT_ALGORITHM_EDDSA_ED448id-Ed448
SB_CERT_ALGORITHM_EDDSA_ED25519_PHid-Ed25519ph
SB_CERT_ALGORITHM_EDDSA_ED448_PHid-Ed448ph
SB_CERT_ALGORITHM_EDDSAid-EdDSA
SB_CERT_ALGORITHM_EDDSA_SIGNATUREid-EdDSA-sig

Constructors

public ExternalCrypto();
Public ExternalCrypto()

Creates a new ExternalCrypto object with default field values.

ProxySettings Type

A container for proxy server settings.

Remarks

This type exposes a collection of properties for tuning up the proxy server configuration.

Fields

Address
string

Default Value: ""

The IP address of the proxy server.

Authentication
ProxyAuthTypes

Default Value: 0

The authentication type used by the proxy server.

patNoAuthentication0
patBasic1
patDigest2
patNTLM3

Password
string

Default Value: ""

The password to authenticate to the proxy server.

Port
int

Default Value: 0

The port on the proxy server to connect to.

ProxyType
ProxyTypes

Default Value: 0

The type of the proxy server.

The WebTunnel proxy is also known as HTTPS proxy. Unlike HTTP proxy, HTTPS proxy (WebTunnel) provides end-to-end security.

cptNone0
cptSocks41
cptSocks52
cptWebTunnel3
cptHTTP4

RequestHeaders
string

Default Value: ""

Contains HTTP request headers for WebTunnel and HTTP proxy.

ResponseBody
string

Default Value: ""

Contains the HTTP or HTTPS (WebTunnel) proxy response body.

ResponseHeaders
string

Default Value: ""

Contains response headers received from an HTTP or HTTPS (WebTunnel) proxy server.

UseIPv6
bool

Default Value: False

Specifies whether IPv6 should be used when connecting through the proxy.

UseProxy
bool

Default Value: False

Enables or disables proxy-driven connection.

Username
string

Default Value: ""

Specifies the username credential for proxy authentication.

Constructors

public ProxySettings();
Public ProxySettings()

Creates a new ProxySettings object.

SFTPListEntry Type

A container for filesystem element's attributes.

Remarks

This type contains attributes of a single entry returned by a ListDir command.

The contents of this container may differ for different servers (not all servers support all attributes).

Fields

ATime
string

Default Value: ""

Contains the last access time for this file, in UTC.

CTime
string

Default Value: ""

Contains this file's creation time, in UTC.

Directory
bool

Default Value: False

Specifies whether this entry is a directory.

FileType
SFTPFileTypes

Default Value: 4

Specifies the type of this entry, one of the following:

cftFile0
cftDirectory1
cftSymblink2
cftSpecial3
cftUnknown4
cftSocket5
cftCharDevice6
cftBlockDevice7
cftFIFO8

GroupExecute
bool

Default Value: False

Controls file execution permission for the group users.

GroupRead
bool

Default Value: False

Controls file read permission for the group users.

GroupWrite
bool

Default Value: False

Controls file write permission for the group users.

LongName
string

Default Value: ""

Contains the long name of the file (human-readable, ftp-like).

MTime
string

Default Value: ""

Specifies the last modification time, in UTC.

Name
string

Default Value: ""

Specifies the file name.

OtherExecute
bool

Default Value: False

Controls file execution permission for other users (users that are neither owners, nor belong to the same group).

OtherRead
bool

Default Value: False

Controls file read permission for other users (users that are neither owners, nor belong to the same group).

OtherWrite
bool

Default Value: False

Controls file write permission for other users (users that are neither owners, nor belong to the same group).

Owner
string

Default Value: ""

Specifies the owner of the file/directory.

Path
string

Default Value: ""

Contains the full path to the file.

Size
long

Default Value: 0

The size of the file in bytes.

UserExecute
bool

Default Value: False

Controls file execution permission for the file owner.

UserRead
bool

Default Value: False

Controls file read permission for the file owner.

UserWrite
bool

Default Value: False

Controls file write permission for the file owner.

Constructors

public SFTPListEntry();
Public SFTPListEntry()

Creates a new SFTPListEntry object.

SocketSettings Type

A container for the socket settings.

Remarks

This type is a container for socket-layer parameters.

Fields

DNSMode
DNSResolveModes

Default Value: 0

Selects the DNS resolver to use: the component's (secure) built-in one, or the one provided by the system.

dmAuto0
dmPlatform1
dmOwn2
dmOwnSecure3

DNSPort
int

Default Value: 0

Specifies the port number to be used for sending queries to the DNS server.

DNSQueryTimeout
int

Default Value: 0

The timeout (in milliseconds) for each DNS query. The value of 0 indicates an infinite timeout.

DNSServers
string

Default Value: ""

The addresses of DNS servers to use for address resolution, separated by commas or semicolons.

DNSTotalTimeout
int

Default Value: 0

The timeout (in milliseconds) for the whole resolution process. The value of 0 indicates an infinite timeout.

IncomingSpeedLimit
int

Default Value: 0

The maximum number of bytes to read from the socket, per second.

LocalAddress
string

Default Value: ""

The local network interface to bind the socket to.

LocalPort
int

Default Value: 0

The local port number to bind the socket to.

OutgoingSpeedLimit
int

Default Value: 0

The maximum number of bytes to write to the socket, per second.

Timeout
int

Default Value: 60000

The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.

If Timeout is set to 0, a socket operation will expire after the system-default timeout (2 hrs 8 min for TCP stack).

UseIPv6
bool

Default Value: False

Enables or disables IP protocol version 6.

Constructors

public SocketSettings();
Public SocketSettings()

Creates a new SocketSettings object.

SSHInfo Type

Contains information about SSH connection.

Remarks

SSHInfo object contains information about one SSH connection.

Fields

ClientKeyAlgorithm
string (read-only)

Default Value: ""

Specifies the client's key algorithm.

ClientKeyBits
int (read-only)

Default Value: 0

Specifies the length of the client's key.

ClientKeyFingerprint
string (read-only)

Default Value: ""

The fingerprint (hash value) of the client's public key.

CloseReason
string (read-only)

Default Value: ""

Contains the line sent by the server just before closing the connection. It might contain the error description if the connection was not closed gracefully.

CompressionAlgorithmInbound
string (read-only)

Default Value: ""

Compression algorithm for the incoming traffic.

CompressionAlgorithmOutbound
string (read-only)

Default Value: ""

Compression algorithm for the outgoing traffic.

EncryptionAlgorithmInbound
string (read-only)

Default Value: ""

Encryption algorithm for the incoming traffic.

EncryptionAlgorithmOutbound
string (read-only)

Default Value: ""

Encryption algorithm for the outgoing traffic.

InboundEncryptionKeyBits
int (read-only)

Default Value: 0

Specifies the length of the key used to encrypt the incoming traffic.

KexAlgorithm
string (read-only)

Default Value: ""

The key exchange algorithm used during the SSH handshake.

KexBits
int (read-only)

Default Value: 0

The number of bits used by the key exchange algorithm.

KexLines
string (read-only)

Default Value: ""

The contents of the received KexInit packet.

KexInit packet contains the list of algorithms supported by the remote party.

MacAlgorithmInbound
string (read-only)

Default Value: ""

MAC algorithm used for the incoming connection.

MacAlgorithmOutbound
string (read-only)

Default Value: ""

MAC algorithm used for outbound connection.

OutboundEncryptionKeyBits
int (read-only)

Default Value: 0

Specifies the length of the key used to encrypt the outgoing traffic.

PublicKeyAlgorithm
string (read-only)

Default Value: ""

Specifies the public key algorithm which was used during the SSH handshake.

ServerKeyBits
int (read-only)

Default Value: 0

Specifies the number of bits in the server's key.

ServerKeyFingerprint
string (read-only)

Default Value: ""

The fingerprint (hash value) of the server's public key.

ServerSoftwareName
string (read-only)

Default Value: ""

Returns the name of the SSH software running on the server side.

TotalBytesReceived
long (read-only)

Default Value: 0

Returns the total number of bytes received over this connection.

TotalBytesSent
long (read-only)

Default Value: 0

Returns the total number of bytes sent over this connection.

Version
int (read-only)

Default Value: 2

Specifies SSH protocol version.

Constructors

public SSHInfo();
Public SSHInfo()

Creates an empty object representing a SSH connection info.

SSHKey Type

SSHKey is used to store information about single compound public-key algorithm (such as RSA or DSA) key.

Remarks

SSH keys are used to secure the SSH protocol flow. They support different algorithms and key lengths, a very typical example being RSA-2048 bits.

Fields

Algorithm
string (read-only)

Default Value: ""

Specifies the key algorithm.

Bits
int (read-only)

Default Value: 0

The number of bits in the key: the more the better, 2048 or 4096 are typical values.

Comment
string

Default Value: ""

The comment for the public key.

Curve
string (read-only)

Default Value: ""

Specifies the elliptical curve when EC cryptography is used.

DSSG
byte[] (read-only)

Default Value: ""

The G (Generator) parameter of the DSS signature key. The string should contain the binary data of G.

DSSP
byte[] (read-only)

Default Value: ""

The P (Prime) parameter of the DSS signature key. The string should contain the binary data of P.

DSSQ
byte[] (read-only)

Default Value: ""

The Q (Prime Factor) parameter of the DSS signature key. The string should contain the binary data of Q.

DSSX
byte[] (read-only)

Default Value: ""

The X (Private key) parameter of the DSS signature key. The string should contain the binary data of X.

This parameter may be empty if there's no need to sign data with this key (e.g. if the key is a server public key needed only to authenticate the server).

DSSY
byte[] (read-only)

Default Value: ""

The Y (Public key) parameter of the DSS signature key. The string should contain the binary data of Y.

ECCD
byte[] (read-only)

Default Value: ""

The value of the secret key (the order of the public key, D) if elliptic curve (EC) cryptography is used. The string should contain the binary data of D.

ECCQX
byte[] (read-only)

Default Value: ""

The value of the X coordinate of the public key if elliptic curve (EC) cryptography is used. The string should contain the binary data of X.

ECCQY
byte[] (read-only)

Default Value: ""

The value of the Y coordinate of the public key if elliptic curve (EC) cryptography is used. The string should contain the binary data of Y.

EdPrivate
byte[] (read-only)

Default Value: ""

The value of the private key if EdDSA (Edwards-curve Digital Signature Algorithm) algorithm is used.

EdPublic
byte[] (read-only)

Default Value: ""

The value of the public key if EdDSA (Edwards-curve Digital Signature Algorithm) algorithm is used.

FingerprintMD5
string (read-only)

Default Value: ""

Contains the MD5 fingerprint (hash) of the key.

FingerprintSHA1
string (read-only)

Default Value: ""

Contains the SHA-1 fingerprint (hash) of the key.

FingerprintSHA256
string (read-only)

Default Value: ""

Contains the SHA-256 fingerprint (hash) of the key.

IsExtractable
bool (read-only)

Default Value: False

Whether the key is extractable (e.g., from a security token), or not.

IsPrivate
bool (read-only)

Default Value: False

Whether this key is a private key or not.

IsPublic
bool (read-only)

Default Value: False

Whether this key is a public key or not.

KDFRounds
int (read-only)

Default Value: 0

Returns the number of iterations of the Key Derivation Function (KDF) used to generate this key.

KDFSalt
byte[] (read-only)

Default Value: ""

The salt value used by the Key Derivation Function (KDF) to generate this key.

KeyFormat
SSHKeyFormats (read-only)

Default Value: 0

Specifies the format in which the key is stored.

ckfOpenSSH0
ckfOpenSSH21
ckfIETF2
ckfPuTTY3
ckfX5094
ckfBinary5
ckfSSH16
ckfPGP7
ckfPKCS88
ckfPuTTY39

KeyProtectionAlgorithm
string (read-only)

Default Value: ""

Specifies the key protection algorithm.

RSAExponent
byte[] (read-only)

Default Value: ""

Returns the e parameter (public exponent) of the RSA key.

RSAIQMP
byte[] (read-only)

Default Value: ""

Returns the iqmp parameter of the RSA key.

RSAModulus
byte[] (read-only)

Default Value: ""

Returns the m parameter (public modulus) of the RSA key.

RSAP
byte[] (read-only)

Default Value: ""

Returns the p parameter (first factor of the common modulus n) of the RSA key.

RSAPrivateExponent
byte[] (read-only)

Default Value: ""

Returns the d parameter (private exponent) of the RSA key.

RSAQ
byte[] (read-only)

Default Value: ""

Returns the q parameter (second factor of the common modulus n) of the RSA key.

Subject
string

Default Value: ""

Specifies the public key owner (subject). This property is used only for IETF-keys.

Constructors

public SSHKey(byte[] bytes, int startIndex, int count, string password);
Public SSHKey(ByVal Bytes As Byte(), ByVal StartIndex As Integer, ByVal Count As Integer, ByVal Password As String)

Loads private key from the Bytes buffer. Parameters StartIndex and Count specify the starting index of the key data and its length, correspondingly. Provide a Password to decrypt the key.

public SSHKey(byte[] bytes, int startIndex, int count);
Public SSHKey(ByVal Bytes As Byte(), ByVal StartIndex As Integer, ByVal Count As Integer)

Loads public key from the Bytes buffer. Parameters StartIndex and Count specify the starting index of the key data and its length, correspondingly.

public SSHKey(System.IO.Stream stream, string password);
Public SSHKey(ByVal Stream As System.IO.Stream, ByVal Password As String)

Loads private key from the stream. Provide a Password to decrypt the key.

public SSHKey(System.IO.Stream stream);
Public SSHKey(ByVal Stream As System.IO.Stream)

Loads public key from the stream.

public SSHKey(string path, string password);
Public SSHKey(ByVal Path As String, ByVal Password As String)

Loads private key from the file. Provide a Path to the file and Password to decrypt the key.

public SSHKey(string path);
Public SSHKey(ByVal Path As String)

Loads public key from the file specified by Path .

public SSHKey();
Public SSHKey()

Creates a new key.

SSHSettings Type

A container for various SSH protocol settings.

Remarks

SSHSettings stores various settings of SSH client or server.

Fields

AutoAdjustCiphers
bool

Default Value: True

Whether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.

BaseConfiguration
SecureTransportPredefinedConfigurations

Default Value: 0

Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.

CompressionAlgorithms
string

Default Value: ""

A list of session compression algorithms separated with commas or semicolons. Each algorithm in the list may be prefixed with a minus sign (-) to indicate that the algorithm should be disabled rather than enabled. Besides the specific algorithm names, this property supports the all (and -all) aliases that allow to blanketly enable or disable all compression algorithms at once.

Note: the list of algorithms provided to this property alters the baseline list of compression algorithms pre-configured for this component. Remember to start your algorithm string with -all; if you need to only enable a specific fixed set of algorithms. The list of supported compression algorithms is provided below:

  • none
  • zlib
  • zlib@openssh.com

CompressionLevel
int

Default Value: 6

Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression). This setting is ignored if compression wasn't accepted.

DefaultWindowSize
int

Default Value: 2048000

The SSH window size specifies how many bytes the client can send to the server in the command channel without obtaining pre-authorization for the further send from the server.

EncryptionAlgorithms
string

Default Value: ""

A list of session encryption algorithms separated with commas or semicolons. Each algorithm in the list may be prefixed with a minus sign (-) to indicate that the algorithm should be disabled rather than enabled. Besides the specific algorithm names, this property supports the all (and -all) aliases that allow to blanketly enable or disable all encryption algorithms at once.

Note: the list of algorithms provided to this property alters the baseline list of encryption algorithms pre-configured for this component. Remember to start your algorithm string with -all; if you need to only enable a specific fixed set of algorithms. The list of supported encryption algorithms is provided below:

  • 3des-cbc
  • blowfish-cbc
  • twofish256-cbc
  • twofish192-cbc
  • twofish128-cbc
  • aes256-cbc
  • aes192-cbc
  • aes128-cbc
  • serpent256-cbc
  • serpent192-cbc
  • serpent128-cbc
  • arcfour
  • idea-cbc
  • cast128-cbc
  • none
  • des-cbc
  • aes128-ctr
  • aes192-ctr
  • aes256-ctr
  • 3des-ctr
  • blowfish-ctr
  • twofish128-ctr
  • twofish192-ctr
  • twofish256-ctr
  • serpent128-ctr
  • serpent192-ctr
  • serpent256-ctr
  • idea-ctr
  • cast128-ctr
  • arcfour128
  • arcfour256
  • aes128-gcm
  • aes256-gcm
  • aes128-gcm@openssh.com
  • aes256-gcm@openssh.com
  • chacha20-poly1305
  • chacha20-poly1305@openssh.com

ForceCompression
bool

Default Value: False

Whether the SSH client should explicitly request compression.

If ForceCompression is False, compression will be used only if the server doesn't support algorithms without compression.

GSSAuthTypes
string

Default Value: ""

A comma-separated list of authentication types. Two types are currently supported: gssapi-with-mic and gssapi-keyex.

GSSDelegateCreds
bool

Default Value: False

Switches credential delegation on or off.

GSSHostname
string

Default Value: ""

The GSS host name, in form of a FQDN (e.g. hostname.com), a principal name (e.g. 'host@hostname.com), or a cross-real ticket-granting ticket (e.g. krbtgt/test.com@example.com).

GSSLib
string

Default Value: ""

A path to the GSS-API library (DLL or SO).

GSSMechanisms
string

Default Value: ""

A comma-separated list of GSS mechanisms to use. Two values are currently supported: lib and SSPI.

GSSProtocols
string

Default Value: ""

A comma-separated list of SSPI protocols. Two protocols are currently supported: kerberos and NTLM.

HandshakeTimeout
int

Default Value: 45

Specifies the maximal time for the SSH handshake to proceed, in seconds. If the handshake is not completed within this period, the session is aborted.

KexAlgorithms
string

Default Value: ""

A list of key exchange algorithms separated with commas or semicolons. Each algorithm in the list may be prefixed with a minus sign (-) to indicate that the algorithm should be disabled rather than enabled. Besides the specific algorithm names, this property supports the all (and -all) aliases that allow to blanketly enable or disable all key exchange algorithms at once.

Note: the list of algorithms provided to this property alters the baseline list of key exchange algorithms pre-configured for this component. Remember to start your algorithm string with -all; if you need to only enable a specific fixed set of algorithms. The list of supported kex algorithms is provided below:

  • diffie-hellman-group-exchange-sha1
  • diffie-hellman-group1-sha1
  • diffie-hellman-group14-sha1
  • diffie-hellman-group-exchange-sha256
  • rsa1024-sha1
  • rsa2048-sha256
  • ecdh-sha2-nistp256
  • ecdh-sha2-nistp384
  • ecdh-sha2-nistp521
  • ecdh-sha2-nistk163
  • ecdh-sha2-nistp192
  • ecdh-sha2-nistp224
  • ecdh-sha2-nistk233
  • ecdh-sha2-nistb233
  • ecdh-sha2-nistk283
  • ecdh-sha2-nistk409
  • ecdh-sha2-nistb409
  • ecdh-sha2-nistt571
  • ecdh-sha2-curve25519
  • curve25519-sha256@libssh.org
  • curve448-sha512@libssh.org
  • diffie-hellman-group14-sha256
  • diffie-hellman-group15-sha512
  • diffie-hellman-group16-sha512
  • diffie-hellman-group17-sha512
  • diffie-hellman-group18-sha512

MacAlgorithms
string

Default Value: ""

A list of MAC (for message authentication code) algorithms separated with commas or semicolons. Each algorithm in the list may be prefixed with a minus sign (-) to indicate that the algorithm should be disabled rather than enabled. Besides the specific algorithm names, this property supports the all (and -all) aliases that allow to blanketly enable or disable all MAC algorithms at once.

Note: the list of algorithms provided to this property alters the baseline list of MAC algorithms pre-configured for this component. Remember to start your algorithm string with -all; if you need to only enable a specific fixed set of algorithms. The list of supported MAC algorithms is provided below:

  • hmac-sha1
  • hmac-sha1-96
  • hmac-md5
  • hmac-md5-96
  • none
  • hmac-ripemd160
  • hmac-ripemd
  • hmac-ripemd160@openssh.com
  • hmac-sha256@ssh.com
  • hmac-sha256-96@ssh.com
  • umac-32@openssh.com
  • umac-64@openssh.com
  • umac-96@openssh.com
  • umac-128@openssh.com
  • hmac-sha2-256
  • hmac-sha2-512
  • aes128-gcm
  • aes256-gcm
  • chacha20-poly1305@openssh.com
  • hmac-sha2-256-etm@openssh.com
  • hmac-sha2-512-etm@openssh.com

MaxSSHPacketSize
int

Default Value: 262144

Specifies the maximum length of one SSH packet in bytes.

MinWindowSize
int

Default Value: 2048

Specifies the minimal internal window size. When the minimal window size is reached, the 'window extension' request is sent to the server. This request notifies the server that the window was extended, and it can send more data.

ObfuscateHandshake
bool

Default Value: False

Enables or disables handshake obfuscation.

ObfuscationPassword
string

Default Value: ""

Specifies the password used to encrypt the handshake when ObfuscateHandshake is set.

PublicKeyAlgorithms
string

Default Value: ""

A list of public key algorithms separated with commas or semicolons. Each algorithm in the list may be prefixed with a minus sign (-) to indicate that the algorithm should be disabled rather than enabled. Besides the specific algorithm names, this property supports the all (and -all) aliases that allow to blanketly enable or disable all public key algorithms at once.

Note: the list of algorithms provided to this property alters the baseline list of public key algorithms pre-configured for this component. Remember to start your algorithm string with -all; if you need to only enable a specific fixed set of algorithms. The list of supported public key algorithms is provided below:

  • ssh-dss
  • ssh-rsa
  • x509v3-sign-rsa
  • x509v3-sign-dss
  • spki-sign-rsa,
  • spki-sign-dss
  • pgp-sign-rsa
  • pgp-sign-dss
  • ecdsa-sha2-nistp256
  • ecdsa-sha2-nistp384
  • ecdsa-sha2-nistp521
  • ecdsa-sha2-nistk163
  • ecdsa-sha2-nistp192
  • ecdsa-sha2-nistp224
  • ecdsa-sha2-nistk233
  • ecdsa-sha2-nistb233
  • ecdsa-sha2-nistk283
  • ecdsa-sha2-nistk409
  • ecdsa-sha2-nistb409
  • ecdsa-sha2-nistt571,
  • ecdsa-sha2-curve25519
  • x509v3-ssh-rsa
  • x509v3-ssh-dss
  • x509v3-rsa2048-sha256
  • x509v3-ecdsa-sha2-nistp256
  • x509v3-ecdsa-sha2-nistp384
  • x509v3-ecdsa-sha2-nistp521
  • x509v3-ecdsa-sha2-nistk163
  • x509v3-ecdsa-sha2-nistp192
  • x509v3-ecdsa-sha2-nistp224
  • x509v3-ecdsa-sha2-nistk233
  • x509v3-ecdsa-sha2-nistb233
  • x509v3-ecdsa-sha2-nistk283
  • x509v3-ecdsa-sha2-nistk409
  • x509v3-ecdsa-sha2-nistb409
  • x509v3-ecdsa-sha2-nistt571
  • x509v3-ecdsa-sha2-curve25519
  • ssh-ed25519
  • ssh-ed448
  • rsa-sha2-256
  • rsa-sha2-512

RequestPasswordChange
bool

Default Value: False

Whether to request a password change when connecting.

SoftwareName
string

Default Value: "SecureBlackbox"

The name to be used by the component to identify itself.

TrustAllKeys
bool

Default Value: False

Enables or disables explicit trust to all server keys. Use with care.

UseAuthAgent
bool

Default Value: False

Enables or disables the use of external key agent, such as Putty key agent.

Versions
int

Default Value: 1

Specifies enabled SSH protocol versions (1 or 2).

Constructors

public SSHSettings();
Public SSHSettings()

Creates a new object with default settings.

Config Settings (SFTPClient Component)

The component accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, access to these internal properties is provided through the Config method.

SFTPClient Config Settings

AdjustFileTimes:   Whether file times should be adjusted after upload/download.

If this property value is True, file times (creation, access and last modification times) will be adjusted after upload/download operation.

ASCIIMode:   Whether ASCII transfer mode is used.

When this property is True, ASCII (text) transfer mode is used, otherwise the transfer is performed in binary mode.

AvailableSpace:   Returns details of server disk space availability. This protocol extension must be supported by the server for this request to work.

This config property returns the details of the server disk space. The information is provided in the form of semicolon-separated entries: BytesOnDevice, UnusedBytesOnDevice, BytesAvailableToUser, UnusedBytesAvailableToUser, BytesPerAllocationUnit. You can use this property without parameters, or provide a specific mounting point in brackets: AvailableSpace(./path).

CaseConversion:   Whether case conversion must be applied to file names as they are downloaded.

You can choose to: convert file names to upper case, convert file names to lower case, or to keep them as they are.

CaseSensitive:   Specifies if file paths are case-sensitive.

Set this property to True if all file names, paths and file masks should be case-sensitive.

CopyMode:   Defines what to do with each successfully copied file.

You could choose to: simply copy the file, delete each file's origin right after that file has been copied, or delete all original files only after all files have been copied.

DefOutboundBlockSize:   The default outbound block size.

Use this property to configure the outbound data block size.

DisablePacketFragmentation:   Enables or disables SSH packet fragmentation.

Use this property to enable or disable SSH packet fragmentation. This is one of the settings that is worth a look if encountering unexplained transfer issues.

ErrorOrigin:   Specifies whether the error is local or remote.

Use this property to check where the error took place.

ErrorSeverity:   Specifies whether the error is fatal.

Use this property to check whether the error is fatal or not.

FileHash:   Returns the hash of the specified file. This protocol extension must be supported by the server for this request to work.

Use this property to request the hash of a remote file. Pass the file name in brackets: FileHash(./path/file.ext). You can adjust the hash algorithm using the HashAlgorithm configuration setting.

HashAlgorithm:   The hash algorithm to use for the protocol operations.

Specifies the hash algorithm to use for file protocol operations, such as FileHash.

HomeDir:   Returns a user's home directory. This protocol extension must be supported by the server for this request to work.

Use this property to request a specific user's home directory on the server. Provide the username in brackets: HomeDir(user2).

IncomingSpeedLimit:   Specifies incoming speed limit.

Use this property to limit the maximum number of bytes per second that client may receive. The value of 0 (zero) means "no limitation".

KeepAlivePeriod:   The inactivity period after which a keep-alive signal will be sent.

Use this property to specify tunnel inactivity period (in milliseconds) after which a keep-alive signal will be sent. The default value is 0 (no keep-alive signals).

LocalCharset:   Charset used on the client machine.

This property specifies the charset used on the local client computer.

LocalNewLineConvention:   A character string for the end of line (EOL) indication on the local machine.

This property contains a character string for the end of line (EOL) indication on the local machine.

Mode:   The file open mode to use.

This property allows to provide a custom file upload mode.

NewLineConvention:   A character string for the end of line (EOL) indication on the server.

This property contains a character string for the end of line (EOL) indication used by the server. Usually its value is one of: 0x0d, 0x0d0x0a, 0x0a0x0d, or 0x0a, but it can differ for some servers.

OutgoingSpeedLimit:   Specifies incoming speed limit.

Use this property to limit the maximum number of bytes per second that client may send. The value of 0 (zero) means "no limitation".

PreserveExistingFileTimes:   Whether original file times should be restored upon transfer.

If the destination file exists and PreserveExistingFileTimes option is enabled, the component will remember the file's times before transfer, and restore them after the file has been transferred. The default value is False.

Recursive:   Whether subdirectories should also be scanned for matching files.

Set this property to True to indicate that subdirectories should also be scanned for matching files

RedirectStdErr:   Whether to redirect output to StdErr.

If this property is True, all output will be redirected to StdErr.

RemoteCharset:   Charset used on the server.

This property specifies the charset used on the server.

SFTPBufferSize:   The size of internal buffer used for data transfer.

Use this property to control the size of the internal buffers used for data transfer.

SFTPServerExecutableLocations:   Location of the SFTP server executable.

Specifies the location of the SFTP server executable.

StatVFS:   Returns VFS details. This protocol extension must be supported by the server for this request to work.

This config property returns the VFS details of the server file system. The information is provided in the form of semicolon-separated entries. You can use this property without parameters, or provide a specific mounting point in brackets: StatVFS(./).

StdErrData:   The buffer for writing StdErr data.

This property represents a buffer where StdErr data is written by the component.

TempFolder:   Returns the temporary directory offered by the server. This protocol extension must be supported by the server for this request to work.

Use this property to request a path to the temporary directory maintained by the server.

TempPath:   Location where the temporary files are stored.

This setting specifies an absolute path to the location on disk where temporary files are stored.

TreatZeroSizeAsUndefined:   Whether zero size returned by STAT should be considered as undefined.

This property specifies if the size of zero returned by the STAT command for a particular file should be considered as undefined. It makes sense to set this property to True, because some operating systems (e.g. Unix-based) return zero size for the files of certain type. For instance, most of the files contained in the /proc directory are reported as 0-sized, while actually not being empty.

UseStrictKeyExchange:   Specifies how strict key exchange is supported.

This setting controls whether strict key exchange (strict kex) is enabled to mitigate the Terrapin attack. When enabled, the component will indicate support for strict key exchange by automatically including the pseudo-algorithm kex-strict-c-v00@openssh.com for client components and kex-strict-s-v00@openssh.com for server components in the list of supported key exchange algorithms.

Since both client and server must implement strict key exchange to effectively mitigate the Terrapin attack, the component provides options to further control the behavior in different scenarios. Possible values for this setting are:

0Disabled. Strict key exchange is not supported in the component.
1 (default)Enabled, but not enforced. This setting enables strict key exchange, but if the remote host does not support strict key exchange the connection is still allowed to continue.
2Enabled, but reject affected algorithms if the remote host does not support strict key exchange. If the remote host supports strict key exchange all algorithms may be used. If the remote host does not support strict key exchange the connection will only continue if the selected encryption and MAC algorithms are not affected by the Terrapin attack.
3Required. If the remote host does not support strict key exchange the connection will fail.

UseTruncateFlagOnUpload:   whether to use the 'truncate' flag on file upload.

If this property is True, the existing files are opened truncated on upload, otherwise new files are created. The default value is True.

UseUTF8OnV3:   Whether to apply UTF-8 conversion for SFTP protocol versions 3 and lower.

If this property is True, UTF-8 encoding will be applied to file names for SFTP protocol versions 3 and lower.

Base Config Settings

CheckKeyIntegrityBeforeUse:   Enables or disable private key integrity check before use.

This global property enables or disables private key material check before each signing operation. This slows down performance a bit, but prevents a selection of attacks on RSA keys where keys with unknown origins are used.

You can switch this property off to improve performance if your project only uses known, good private keys.

CookieCaching:   Specifies whether a cookie cache should be used for HTTP(S) transports.

Set this property to enable or disable cookies caching for the component.

Supported values are:

offNo caching (default)
localLocal caching
globalGlobal caching

Cookies:   Gets or sets local cookies for the component.

Use this property to get cookies from the internal cookie storage of the component and/or restore them back between application sessions.

DefDeriveKeyIterations:   Specifies the default key derivation algorithm iteration count.

This global property sets the default number of iterations for all supported key derivation algorithms. Note that you can provide the required number of iterations by using properties of the relevant key generation component; this global setting is used in scenarios where specific iteration count is not or cannot be provided.

EnableClientSideSSLFFDHE:   Enables or disables finite field DHE key exchange support in TLS clients.

This global property enables or disables support for finite field DHE key exchange methods in TLS clients. FF DHE is a slower algorithm if compared to EC DHE; enabling it may result in slower connections.

This setting only applies to sessions negotiated with TLS version 1.3.

GlobalCookies:   Gets or sets global cookies for all the HTTP transports.

Use this property to get cookies from the GLOBAL cookie storage or restore them back between application sessions. These cookies will be used by all the components that have its CookieCaching property set to "global".

HttpUserAgent:   Specifies the user agent name to be used by all HTTP clients.

This global setting defines the User-Agent field of the HTTP request provides information about the software that initiates the request. This value will be used by all the HTTP clients including the ones used internally in other components.

LogDestination:   Specifies the debug log destination.

Contains a comma-separated list of values that specifies where debug log should be dumped.

Supported values are:

fileFile
consoleConsole
systemlogSystem Log (supported for Android only)
debuggerDebugger (supported for VCL for Windows and .Net)

LogDetails:   Specifies the debug log details to dump.

Contains a comma-separated list of values that specifies which debug log details to dump.

Supported values are:

timeCurrent time
levelLevel
packagePackage name
moduleModule name
classClass name
methodMethod name
threadidThread Id
contenttypeContent type
contentContent
allAll details

LogFile:   Specifies the debug log filename.

Use this property to provide a path to the log file.

LogFilters:   Specifies the debug log filters.

Contains a comma-separated list of value pairs ("name:value") that describe filters.

Supported filter names are:

exclude-packageExclude a package specified in the value
exclude-moduleExclude a module specified in the value
exclude-classExclude a class specified in the value
exclude-methodExclude a method specified in the value
include-packageInclude a package specified in the value
include-moduleInclude a module specified in the value
include-classInclude a class specified in the value
include-methodInclude a method specified in the value

LogFlushMode:   Specifies the log flush mode.

Use this property to set the log flush mode. The following values are defined:

noneNo flush (caching only)
immediateImmediate flush (real-time logging)
maxcountFlush cached entries upon reaching LogMaxEventCount entries in the cache.

LogLevel:   Specifies the debug log level.

Use this property to provide the desired debug log level.

Supported values are:

noneNone (by default)
fatalSevere errors that cause premature termination.
errorOther runtime errors or unexpected conditions.
warningUse of deprecated APIs, poor use of API, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
infoInteresting runtime events (startup/shutdown).
debugDetailed information on flow of through the system.
traceMore detailed information.

LogMaxEventCount:   Specifies the maximum number of events to cache before further action is taken.

Use this property to specify the log event number threshold. This threshold may have different effects, depending on the rotation setting and/or the flush mode.

The default value of this setting is 100.

LogRotationMode:   Specifies the log rotation mode.

Use this property to set the log rotation mode. The following values are defined:

noneNo rotation
deleteolderDelete older entries from the cache upon reaching LogMaxEventCount
keepolderKeep older entries in the cache upon reaching LogMaxEventCount (newer entries are discarded)

MaxASN1BufferLength:   Specifies the maximal allowed length for ASN.1 primitive tag data.

This global property limits the maximal allowed length for ASN.1 tag data for non-content-carrying structures, such as certificates, CRLs, or timestamps. It does not affect structures that can carry content, such as CMS/CAdES messages. This is a security property aiming at preventing DoS attacks.

MaxASN1TreeDepth:   Specifies the maximal depth for processed ASN.1 trees.

This global property limits the maximal depth of ASN.1 trees that the component can handle without throwing an error. This is a security property aiming at preventing DoS attacks.

OCSPHashAlgorithm:   Specifies the hash algorithm to be used to identify certificates in OCSP requests.

This global setting defines the hash algorithm to use in OCSP requests during chain validation. Some OCSP responders can only use older algorithms, in which case setting this property to SHA1 may be helpful.

StaticDNS:   Specifies whether static DNS rules should be used.

Set this property to enable or disable static DNS rules for the component. Works only if UseOwnDNSResolver is set to true.

Supported values are:

noneNo static DNS rules (default)
localLocal static DNS rules
globalGlobal static DNS rules

StaticIPAddress[domain]:   Gets or sets an IP address for the specified domain name.

Use this property to get or set an IP address for the specified domain name in the internal (of the component) or global DNS rules storage depending on the StaticDNS value. The type of the IP address (IPv4 or IPv6) is determined automatically. If both addresses are available, they are devided by the | (pipe) character.

StaticIPAddresses:   Gets or sets all the static DNS rules.

Use this property to get static DNS rules from the current rules storage or restore them back between application sessions. If StaticDNS of the component is set to "local", the property returns/restores the rules from/to the internal storage of the component. If StaticDNS of the component is set to "global", the property returns/restores the rules from/to the GLOBAL storage. The rules list is returned and accepted in JSON format.

Tag:   Allows to store any custom data.

Use this config property to store any custom data.

TLSSessionGroup:   Specifies the group name of TLS sessions to be used for session resumption.

Use this property to limit the search of chached TLS sessions to the specified group. Sessions from other groups will be ignored. By default, all sessions are cached with an empty group name and available to all the components.

TLSSessionLifetime:   Specifies lifetime in seconds of the cached TLS session.

Use this property to specify how much time the TLS session should be kept in the session cache. After this time, the session expires and will be automatically removed from the cache. Default value is 300 seconds (5 minutes).

TLSSessionPurgeInterval:   Specifies how often the session cache should remove the expired TLS sessions.

Use this property to specify the time interval of purging the expired TLS sessions from the session cache. Default value is 60 seconds (1 minute).

UseOwnDNSResolver:   Specifies whether the client components should use own DNS resolver.

Set this global property to false to force all the client components to use the DNS resolver provided by the target OS instead of using own one.

UseSharedSystemStorages:   Specifies whether the validation engine should use a global per-process copy of the system certificate stores.

Set this global property to false to make each validation run use its own copy of system certificate stores.

UseSystemOAEPAndPSS:   Enforces or disables the use of system-driven RSA OAEP and PSS computations.

This global setting defines who is responsible for performing RSA-OAEP and RSA-PSS computations where the private key is stored in a Windows system store and is exportable. If set to true, SBB will delegate the computations to Windows via a CryptoAPI call. Otherwise, it will export the key material and perform the computations using its own OAEP/PSS implementation.

This setting only applies to certificates originating from a Windows system store.

UseSystemRandom:   Enables or disables the use of the OS PRNG.

Use this global property to enable or disable the use of operating system-driven pseudorandom number generation.

Trappable Errors (SFTPClient Component)

SFTPClient Errors

1048577   Invalid parameter value (SB_ERROR_INVALID_PARAMETER)
1048578   Component is configured incorrectly (SB_ERROR_INVALID_SETUP)
1048579   Operation cannot be executed in the current state (SB_ERROR_INVALID_STATE)
1048580   Attempt to set an invalid value to a property (SB_ERROR_INVALID_VALUE)
1048581   Certificate does not have its private key loaded (SB_ERROR_NO_PRIVATE_KEY)
1048581   Cancelled by the user (SB_ERROR_CANCELLED_BY_USER) 
31457281   Unsupported file operation (SB_ERROR_SFTP_UNSUPPORTED_FILEOPERATION)