Struct secureblackbox::SFTPClient
Properties Methods Events Config Settings Errors
The SFTPClient struct provides client-side functionality for SFTP (Secure File Transfer Protocol).
Syntax
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 trusted_keys_file property. When a client receives a server key, it reports it to your code via its on_known_key_received or on_unknown_key_received event, depending on whether the key was found in the trusted list. If you leave trusted_keys_file empty, SFTPClient will only be able to fire the on_unknown_key_received event, since there will be no known keys to report.
- If needed, customize proxy parameters and ssh_settings.
- Consider interacting more with SFTPClient by subscribing to on_auth_attempt, on_auth_failed, and on_auth_succeeded 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: on_unknown_key_received (or on_known_key_received), and then one or more on_auth_attempt, on_auth_failed and on_auth_succeeded.
- Upon completion of the connect method, the component is ready for file operations. Use download_file, upload_file, list_dir, delete_file 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:
- auto_adjust_transfer_block to false,
- pipeline_length to 1,
- upload_block_size to 16384,
- download_block_size to 16384.
Object Lifetime
The new() method returns a mutable reference to a struct instance. The object itself is kept in the global list maintained by SecureBlackbox. Due to this, the SFTPClient struct cannot be disposed of automatically. Please, call the dispose(&mut self) method of SFTPClient when you have finished using the instance.
Property List
The following is the full list of the properties of the struct with short descriptions. Click on the links for further details.
| auth_attempts | Specifies the number of SSH authentication attempts. |
| auto_adjust_transfer_block | Specifies whether to adjust the send and receive buffer sizes automatically. |
| conflict_resolution_mode | Defines the approach that should be used to resolve various conflicts during batch processing. |
| connected | Indicates if the client is connected to the SFTP server. |
| conn_info_client_key_algorithm | Specifies the client's key algorithm. |
| conn_info_client_key_bits | Specifies the length of the client's key. |
| conn_info_client_key_fingerprint | The fingerprint (hash value) of the client's public key. |
| conn_info_close_reason | Contains the line sent by the server just before closing the connection. |
| conn_info_compression_algorithm_inbound | Compression algorithm for the incoming traffic. |
| conn_info_compression_algorithm_outbound | Compression algorithm for the outgoing traffic. |
| conn_info_encryption_algorithm_inbound | Encryption algorithm for the incoming traffic. |
| conn_info_encryption_algorithm_outbound | Encryption algorithm for the outgoing traffic. |
| conn_info_inbound_encryption_key_bits | Specifies the length of the key used to encrypt the incoming traffic. |
| conn_info_kex_algorithm | The key exchange algorithm used during the SSH handshake. |
| conn_info_kex_bits | The number of bits used by the key exchange algorithm. |
| conn_info_kex_lines | The contents of the received KexInit packet. |
| conn_info_mac_algorithm_inbound | MAC algorithm used for the incoming connection. |
| conn_info_mac_algorithm_outbound | MAC algorithm used for outbound connection. |
| conn_info_outbound_encryption_key_bits | Specifies the length of the key used to encrypt the outgoing traffic. |
| conn_info_public_key_algorithm | Specifies the public key algorithm which was used during the SSH handshake. |
| conn_info_remote_address | The client's IP address. |
| conn_info_remote_port | The remote port of the client connection. |
| conn_info_remote_software_name | Returns the name (self-advertised) of the SSH software running on the other side. |
| conn_info_server_key_algorithm | Specifies the server's key algorithm. |
| conn_info_server_key_bits | Specifies the number of bits in the server's key. |
| conn_info_server_key_fingerprint | The fingerprint (hash value) of the server's public key. |
| conn_info_total_bytes_received | Returns the total number of bytes received over this connection. |
| conn_info_total_bytes_sent | Returns the total number of bytes sent over this connection. |
| conn_info_version | Specifies SSH protocol version. |
| curr_list_entry_access_time | Contains the last access time for this file, in UTC. |
| curr_list_entry_creation_time | Contains this file's creation time, in UTC. |
| curr_list_entry_entry_format | The file listing format: cfefUnknown 0 cfefUnix 1 cfefWindows 2 cfefMLSD 3 . |
| curr_list_entry_file_type | The type of the entry: fetUnknown 0 fetDirectory 1 fetFile 2 fetSymlink 3 fetSpecial 4 fetCurrentDirectory 5 fetParentDirectory 6 fetSocket 7 fetCharDevice 8 fetBlockDevice 9 fetFIFO 10 . |
| curr_list_entry_handle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| curr_list_entry_modification_time | File last modification date/time. |
| curr_list_entry_name | The file or directory name. |
| curr_list_entry_path | The full path to the file or directory. |
| curr_list_entry_principal | Specifies the owner of the file/directory. |
| curr_list_entry_size | File size in bytes. |
| curr_list_entry_unix_perms | The file Unix permissions bit mask (e. |
| curr_list_entry_unparsed_name | The unparsed entry as returned by the server. |
| download_block_size | The download block size in bytes. |
| external_crypto_async_document_id | Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls. |
| external_crypto_custom_params | Custom parameters to be passed to the signing service (uninterpreted). |
| external_crypto_data | Additional data to be included in the async state and mirrored back by the requestor. |
| external_crypto_external_hash_calculation | Specifies whether the message hash is to be calculated at the external endpoint. |
| external_crypto_hash_algorithm | Specifies the request's signature hash algorithm. |
| external_crypto_key_id | The ID of the pre-shared key used for DC request authentication. |
| external_crypto_key_secret | The pre-shared key used for DC request authentication. |
| external_crypto_method | Specifies the asynchronous signing method. |
| external_crypto_mode | Specifies the external cryptography mode. |
| external_crypto_public_key_algorithm | Provide the public key algorithm here if the certificate is not available on the pre-signing stage. |
| fips_mode | Reserved. |
| force_compression | Enforces compression for the SSH layer. |
| key_fingerprint_sha1 | Contains the SHA-1 fingerprint (hash) of the key. |
| key_fingerprint_sha256 | Contains the SHA-256 fingerprint (hash) of the key. |
| key_handle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| max_sftp_version | Higher SFTP version to support. |
| min_sftp_version | Lower SFTP version to support. |
| password | Specifies user's authentication password. |
| pipeline_length | The number of parallelized transfer requests. |
| proxy_address | The IP address of the proxy server. |
| proxy_authentication | The authentication type used by the proxy server. |
| proxy_password | The password to authenticate to the proxy server. |
| proxy_port | The port on the proxy server to connect to. |
| proxy_type | The type of the proxy server. |
| proxy_request_headers | Contains HTTP request headers for WebTunnel and HTTP proxy. |
| proxy_response_body | Contains the HTTP or HTTPS (WebTunnel) proxy response body. |
| proxy_response_headers | Contains response headers received from an HTTP or HTTPS (WebTunnel) proxy server. |
| proxy_use_ipv6 | Specifies whether IPv6 should be used when connecting through the proxy. |
| proxy_username | Specifies the username credential for proxy authentication. |
| server_key_algorithm | Specifies the key algorithm. |
| server_key_bits | The number of bits in the key: the more the better, 2048 or 4096 are typical values. |
| server_key_comment | The comment for the public key. |
| server_key_curve | Specifies the elliptical curve when EC cryptography is used. |
| server_key_extractable | Whether the key is extractable (e. |
| server_key_fingerprint_md5 | Contains the MD5 fingerprint (hash) of the key. |
| server_key_fingerprint_sha1 | Contains the SHA-1 fingerprint (hash) of the key. |
| server_key_fingerprint_sha256 | Contains the SHA-256 fingerprint (hash) of the key. |
| server_key_handle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| server_key_key_format | Specifies the format in which the key is stored. |
| server_key_key_protection_algorithm | Specifies the key protection algorithm. |
| server_key_private | Whether this key is a private key or not. |
| server_key_public | Whether this key is a public key or not. |
| server_key_subject | Specifies the public key owner (subject). |
| socket_dns_mode | Selects the DNS resolver to use: the struct's (secure) built-in one, or the one provided by the system. |
| socket_dns_port | Specifies the port number to be used for sending queries to the DNS server. |
| socket_dns_query_timeout | The timeout (in milliseconds) for each DNS query. |
| socket_dns_servers | The addresses of DNS servers to use for address resolution, separated by commas or semicolons. |
| socket_dns_total_timeout | The timeout (in milliseconds) for the whole resolution process. |
| socket_incoming_speed_limit | The maximum number of bytes to read from the socket, per second. |
| socket_local_address | The local network interface to bind the socket to. |
| socket_local_port | The local port number to bind the socket to. |
| socket_outgoing_speed_limit | The maximum number of bytes to write to the socket, per second. |
| socket_timeout | The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful. |
| socket_use_ipv6 | Enables or disables IP protocol version 6. |
| ssh_settings_auto_adjust_ciphers | Whether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to. |
| ssh_settings_base_configuration | Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility. |
| ssh_settings_compression_algorithms | A list of session compression algorithms separated with commas or semicolons. |
| ssh_settings_compression_level | Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression). |
| ssh_settings_default_window_size | 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. |
| ssh_settings_encryption_algorithms | A list of session encryption algorithms separated with commas or semicolons. |
| ssh_settings_force_compression | Whether the SSH client should explicitly request compression. |
| ssh_settings_forward_auth_agent | Enables or disables auth agent forwarding. |
| ssh_settings_gss_auth_types | A comma-separated list of authentication types. |
| ssh_settings_gss_delegate_creds | Switches credential delegation on or off. |
| ssh_settings_gss_hostname | The GSS host name, in form of a FQDN (e. |
| ssh_settings_gss_lib | A path to the GSS-API library (DLL or SO). |
| ssh_settings_gss_mechanisms | A comma-separated list of GSS mechanisms to use. |
| ssh_settings_gss_protocols | A comma-separated list of SSPI protocols. |
| ssh_settings_handshake_timeout | Specifies the maximal time for the SSH handshake to proceed, in seconds. |
| ssh_settings_kex_algorithms | A list of key exchange algorithms separated with commas or semicolons. |
| ssh_settings_mac_algorithms | A list of MAC (for message authentication code ) algorithms separated with commas or semicolons. |
| ssh_settings_max_ssh_packet_size | Specifies the maximum length of one SSH packet in bytes. |
| ssh_settings_min_window_size | Specifies the minimal internal window size. |
| ssh_settings_obfuscate_handshake | Enables or disables handshake obfuscation. |
| ssh_settings_obfuscation_password | Specifies the password used to encrypt the handshake when ObfuscateHandshake is set. |
| ssh_settings_public_key_algorithms | A list of public key algorithms separated with commas or semicolons. |
| ssh_settings_request_password_change | Whether to request a password change when connecting. |
| ssh_settings_software_name | The name to be used by the struct to identify itself. |
| ssh_settings_trust_all_keys | Enables or disables explicit trust to all server keys. |
| ssh_settings_use_auth_agent | Enables or disables the use of external key agent, such as Putty key agent. |
| ssh_settings_versions | Specifies enabled SSH protocol versions (1 or 2). |
| trusted_keys_file | A file containing the keys of authorized servers. |
| upload_block_size | The upload block size in bytes. |
| username | The client's username to authenticate to the server. |
| use_utf8 | Enables UTF8 for all string content. |
| version | The SFTP version negotiated. |
Method List
The following is the full list of the methods of the struct with short descriptions. Click on the links for further details.
| absolute_path | Requests the absolute path for a relative path. |
| change_dir | Changes current working directory on the server. |
| config | Sets or retrieves a configuration setting. |
| connect | Connects to an SFTP server. |
| create_link | Creates a symbolic or hard link to a remote file. |
| delete_dir | Removes directory from the SFTP server. |
| delete_file | Deletes a file from the SFTP server. |
| delete_files | Deletes a group of files from the SFTP server. |
| dir_exists | Checks if a directory exists on the SFTP server. |
| disconnect | Disconnects from the SFTP server. |
| do_action | Performs an additional action. |
| download_bytes | Downloads a file from the server into an array of bytes. |
| download_file | Downloads a file from the SFTP server. |
| download_files | Downloads multiple files from the SFTP server. |
| execute_ssh_command | Sends an SSH command to the server in the middle of SFTP session. |
| extension_cmd | Sends an extension command to the server. |
| file_exists | Checks whether a file exists on the server. |
| get_current_dir | Returns the current directory on the SFTP server. |
| get_file_size | Checks the size of a remote file. |
| list_dir | Lists the content of the current remote directory. |
| make_dir | Creates a new directory on the server. |
| rename_file | Renames a file. |
| request_attributes | Requests attributes of the remote file. |
| reset | Resets the struct settings. |
| set_attributes | Sets the attributes upon a remote file. |
| upload_bytes | Uploads a byte array to the server. |
| upload_file | Uploads a file to the server. |
| upload_files | Uploads multiple files to the server. |
Event List
The following is the full list of the events fired by the struct with short descriptions. Click on the links for further details.
| on_auth_attempt | Fires when an authentication attempt is performed. |
| on_auth_failed | Fires if an authentication attempt fails. |
| on_auth_succeeded | Reports a successful authentication. |
| on_banner | Reports the receipt of the Welcome message from the server. |
| on_disconnect | Reports SFTP connection closure. |
| on_error | Information about errors during SFTP connection. |
| on_external_sign | Handles remote or external signing initiated by the SignExternal method or other source. |
| on_file_name_change_needed | Asks the application for a new file name. |
| on_file_operation | Signifies the start of a file transfer operation. |
| on_file_operation_result | Signifies the completion of a file transfer operation. |
| on_known_key_received | Signals that the server has introduced itself with a known key. |
| on_list_entry | Reports a directory listing entry to the application. |
| on_notification | This event notifies the application about an underlying control flow event. |
| on_password_change_request | Signals that the server requests a password change. |
| on_private_key_needed | Asks the application for the client's private key. |
| on_progress | Fires periodically during the data transfer. |
| on_unknown_key_received | Signals that the server has introduced itself with an unknown key. |
Config Settings
The following is a list of config settings for the struct with short descriptions. Click on the links for further details.
| AdjustFileTimes | Whether file times should be adjusted after upload/download. |
| AllAlgorithms | Returns the list of algorithms enabled in the struct. |
| ASCIIMode | Whether ASCII transfer mode is used. |
| AvailableSpace | Returns details of server disk space availability. This protocol extension must be supported by the server for this request to work. |
| CaseConversion | Whether file names and paths should be case-converted. |
| CaseSensitive | Specifies if file paths are case-sensitive. |
| CloseQuietly | Controls the client's approach to session closure. |
| CommandTimeout | Specifies the command timeout. |
| CompressionAlgorithms | Returns the list of compression algorithms enabled in the struct. |
| CopyMode | Tunes up the post-transfer action for batch uploads. |
| DefaultTransferBlock | Specifies the default transfer block size. |
| DefOutboundBlockSize | The default outbound block size. |
| DisablePacketFragmentation | Enables or disables SSH packet fragmentation. |
| EarlyIdString | Enables the proactive approach to SSH handshake. |
| EncryptionAlgorithms | Returns the list of encryption algorithms enabled in the struct. |
| ErrorOrigin | Specifies whether the error is local or remote. |
| ErrorSeverity | Specifies whether the error is fatal. |
| FileHash | Returns the hash of the specified file. This protocol extension must be supported by the server for this request to work. |
| HashAlgorithm | The hash algorithm to use for the protocol operations. |
| HomeDir | Returns a user's home directory. This protocol extension must be supported by the server for this request to work. |
| IncomingSpeedLimit | Specifies incoming speed limit. |
| KeepAlivePeriod | The inactivity period after which a keep-alive signal will be sent. |
| KexAlgorithms | Returns the list of key exchange algorithms enabled in the struct. |
| LocalCharset | Charset used on the client machine. |
| LocalNewLineConvention | A character string for the end of line (EOL) indication on the local machine. |
| MacAlgorithms | Returns the list of MAC algorithms enabled in the struct. |
| NewLineConvention | A character string for the end of line (EOL) indication on the server. |
| OutgoingSpeedLimit | Specifies incoming speed limit. |
| PreserveExistingFileTimes | Whether original file times should be restored upon transfer. |
| PublicKeyAlgorithms | Returns the list of public key algorithms enabled in the struct. |
| RedirectStdErr | Whether to redirect output to StdErr. |
| RemoteCharset | Charset used on the server. |
| SFTPBufferSize | The size of internal buffer used for data transfer. |
| SFTPServerExecutableLocations | Location of the SFTP server executable. |
| SocketRecvBufferSize | The inbound socket buffer size. |
| SocketSendBufferSize | The outbound socket buffer size. |
| StatVFS | Returns VFS details. This protocol extension must be supported by the server for this request to work. |
| StdErrData | The buffer for writing StdErr data. |
| SuppressAuxTransferOps | TBD. |
| TempFolder | Returns the temporary directory offered by the server. This protocol extension must be supported by the server for this request to work. |
| TempPath | Path for storing temporary files. |
| TreatZeroSizeAsUndefined | Whether zero size returned by STAT should be considered as undefined. |
| TryPasswordAuth | Specifies whether the struct should attempt the password-based authentication if no password is set. |
| UseStrictKeyExchange | Specifies how strict key exchange is supported. |
| UseTruncateFlagOnUpload | whether to use the 'truncate' flag on file upload. |
| UseUTF8OnV3 | Whether to apply UTF-8 conversion for SFTP protocol versions 3 and lower. |
| ASN1UseGlobalTagCache | Controls whether ASN.1 module should use a global object cache. |
| AssignSystemSmartCardPins | Specifies whether CSP-level PINs should be assigned to CNG keys. |
| CheckKeyIntegrityBeforeUse | Enables or disable private key integrity check before use. |
| CookieCaching | Specifies whether a cookie cache should be used for HTTP(S) transports. |
| Cookies | Gets or sets local cookies for the struct. |
| DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
| DNSLocalSuffix | The suffix to assign for TLD names. |
| EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
| EnableSSHMLKEM | Enables support for ML-KEM/hybrid key exchange algorithms in SSH client and server structs. |
| EnableTLSMLKEM | Enables support for ML-KEM and hybrid groups in TLS client and server structs. |
| GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
| HardwareCryptoUsePolicy | The hardware crypto usage policy. |
| HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
| HttpVersion | The HTTP version to use in any inner HTTP client structs created. |
| IgnoreExpiredMSCTLSigningCert | Whether to tolerate the expired Windows Update signing certificate. |
| ListDelimiter | The delimiter character for multi-element lists. |
| LogDestination | Specifies the debug log destination. |
| LogDetails | Specifies the debug log details to dump. |
| LogFile | Specifies the debug log filename. |
| LogFilters | Specifies the debug log filters. |
| LogFlushMode | Specifies the log flush mode. |
| LogLevel | Specifies the debug log level. |
| LogMaxEventCount | Specifies the maximum number of events to cache before further action is taken. |
| LogRotationMode | Specifies the log rotation mode. |
| MaxASN1BufferLength | Specifies the maximal allowed length for ASN.1 primitive tag data. |
| MaxASN1TreeDepth | Specifies the maximal depth for processed ASN.1 trees. |
| OCSPHashAlgorithm | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
| OldClientSideRSAFallback | Specifies whether the SSH client should use a SHA1 fallback. |
| PKICache | Specifies which PKI elements (certificates, CRLs, OCSP responses) should be cached. |
| PKICachePath | Specifies the file system path where cached PKI data is stored. |
| ProductVersion | Returns the version of the SecureBlackbox library. |
| ServerSSLDHKeyLength | Sets the size of the TLS DHE key exchange group. |
| StaticDNS | Specifies whether static DNS rules should be used. |
| StaticIPAddress[domain] | Gets or sets an IP address for the specified domain name. |
| StaticIPAddresses | Gets or sets all the static DNS rules. |
| Tag | Allows to store any custom data. |
| TLSSessionGroup | Specifies the group name of TLS sessions to be used for session resumption. |
| TLSSessionLifetime | Specifies lifetime in seconds of the cached TLS session. |
| TLSSessionPurgeInterval | Specifies how often the session cache should remove the expired TLS sessions. |
| UseCRLObjectCaching | Specifies whether reuse of loaded CRL objects is enabled. |
| UseInternalRandom | Switches between SecureBlackbox-own and platform PRNGs. |
| UseLegacyAdESValidation | Enables legacy AdES validation mode. |
| UseOCSPResponseObjectCaching | Specifies whether reuse of loaded OCSP response objects is enabled. |
| UseOwnDNSResolver | Specifies whether the client structs should use own DNS resolver. |
| UseSharedSystemStorages | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
| UseSystemNativeSizeCalculation | An internal CryptoAPI access tweak. |
| UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
| UseSystemRandom | Enables or disables the use of the OS PRNG. |
| XMLRDNDescriptorName[OID] | Defines an OID mapping to descriptor names for the certificate's IssuerRDN or SubjectRDN. |
| XMLRDNDescriptorPriority[OID] | Specifies the priority of descriptor names associated with a specific OID. |
| XMLRDNDescriptorReverseOrder | Specifies whether to reverse the order of descriptors in RDN. |
| XMLRDNDescriptorSeparator | Specifies the separator used between descriptors in RDN. |
auth_attempts property (SFTPClient Struct)
Specifies the number of SSH authentication attempts.
Syntax
fn auth_attempts(&self ) -> Result<i32, SecureBlackboxError>
fn set_auth_attempts(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
1
Remarks
Use this property to specify the number of authentication attempts to try. The on_auth_failed event is fired for every failed attempt.
Data Type
i32
auto_adjust_transfer_block property (SFTPClient Struct)
Specifies whether to adjust the send and receive buffer sizes automatically.
Syntax
fn auto_adjust_transfer_block(&self ) -> Result<bool, SecureBlackboxError>
fn set_auto_adjust_transfer_block(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
true
Remarks
Automatic transfer block size adjustment may be beneficial for maximizing interoperability and achieving the best transfer speeds.
Use download_block_size, upload_block_size, and pipeline_length properties to adjust the transfer settings manually.
Data Type
bool
conflict_resolution_mode property (SFTPClient Struct)
Defines the approach that should be used to resolve various conflicts during batch processing.
Syntax
fn conflict_resolution_mode(&self ) -> Result<i32, SecureBlackboxError>
fn set_conflict_resolution_mode(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // Overwrite
1 // Skip
2 // AppendToEnd
3 // Resume
4 // OverwriteIfDiffSize
5 // SaveWithNewName
6 // RenameExistingTarget
Default Value
0
Remarks
Use this property to specify the approach to use when landing in conflicting transfer situations.
| cftmOverwrite | 0 | |
| cftmSkip | 1 | |
| cftmAppendToEnd | 2 | The signature is corrupted |
| cftmResume | 3 | |
| cftmOverwriteIfDiffSize | 4 | |
| cftmSaveWithNewName | 5 | |
| cftmRenameExistingTarget | 5 |
Data Type
i32
connected property (SFTPClient Struct)
Indicates if the client is connected to the SFTP server.
Syntax
fn connected(&self ) -> Result<bool, SecureBlackboxError>
Default Value
false
Remarks
Use this read-only property to check whether the client is connected to the server.
This property is read-only.
Data Type
bool
conn_info_client_key_algorithm property (SFTPClient Struct)
Specifies the client's key algorithm.
Syntax
fn conn_info_client_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the client's key algorithm.
This property is read-only.
Data Type
String
conn_info_client_key_bits property (SFTPClient Struct)
Specifies the length of the client's key.
Syntax
fn conn_info_client_key_bits(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
Specifies the length of the client's key.
This property is read-only.
Data Type
i32
conn_info_client_key_fingerprint property (SFTPClient Struct)
The fingerprint (hash value) of the client's public key.
Syntax
fn conn_info_client_key_fingerprint(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The fingerprint (hash value) of the client's public key.
This property is read-only.
Data Type
String
conn_info_close_reason property (SFTPClient Struct)
Contains the line sent by the server just before closing the connection.
Syntax
fn conn_info_close_reason(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
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.
This property is read-only.
Data Type
String
conn_info_compression_algorithm_inbound property (SFTPClient Struct)
Compression algorithm for the incoming traffic.
Syntax
fn conn_info_compression_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Compression algorithm for the incoming traffic.
This property is read-only.
Data Type
String
conn_info_compression_algorithm_outbound property (SFTPClient Struct)
Compression algorithm for the outgoing traffic.
Syntax
fn conn_info_compression_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Compression algorithm for the outgoing traffic.
This property is read-only.
Data Type
String
conn_info_encryption_algorithm_inbound property (SFTPClient Struct)
Encryption algorithm for the incoming traffic.
Syntax
fn conn_info_encryption_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Encryption algorithm for the incoming traffic.
This property is read-only.
Data Type
String
conn_info_encryption_algorithm_outbound property (SFTPClient Struct)
Encryption algorithm for the outgoing traffic.
Syntax
fn conn_info_encryption_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Encryption algorithm for the outgoing traffic.
This property is read-only.
Data Type
String
conn_info_inbound_encryption_key_bits property (SFTPClient Struct)
Specifies the length of the key used to encrypt the incoming traffic.
Syntax
fn conn_info_inbound_encryption_key_bits(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
Specifies the length of the key used to encrypt the incoming traffic.
This property is read-only.
Data Type
i32
conn_info_kex_algorithm property (SFTPClient Struct)
The key exchange algorithm used during the SSH handshake.
Syntax
fn conn_info_kex_algorithm(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The key exchange algorithm used during the SSH handshake.
This property is read-only.
Data Type
String
conn_info_kex_bits property (SFTPClient Struct)
The number of bits used by the key exchange algorithm.
Syntax
fn conn_info_kex_bits(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
The number of bits used by the key exchange algorithm.
This property is read-only.
Data Type
i32
conn_info_kex_lines property (SFTPClient Struct)
The contents of the received KexInit packet.
Syntax
fn conn_info_kex_lines(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The contents of the received KexInit packet.
KexInit packet contains the list of algorithms supported by the remote party.
This property is read-only.
Data Type
String
conn_info_mac_algorithm_inbound property (SFTPClient Struct)
MAC algorithm used for the incoming connection.
Syntax
fn conn_info_mac_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
MAC algorithm used for the incoming connection.
This property is read-only.
Data Type
String
conn_info_mac_algorithm_outbound property (SFTPClient Struct)
MAC algorithm used for outbound connection.
Syntax
fn conn_info_mac_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
MAC algorithm used for outbound connection.
This property is read-only.
Data Type
String
conn_info_outbound_encryption_key_bits property (SFTPClient Struct)
Specifies the length of the key used to encrypt the outgoing traffic.
Syntax
fn conn_info_outbound_encryption_key_bits(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
Specifies the length of the key used to encrypt the outgoing traffic.
This property is read-only.
Data Type
i32
conn_info_public_key_algorithm property (SFTPClient Struct)
Specifies the public key algorithm which was used during the SSH handshake.
Syntax
fn conn_info_public_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the public key algorithm which was used during the SSH handshake.
This property is read-only.
Data Type
String
conn_info_remote_address property (SFTPClient Struct)
The client's IP address.
Syntax
fn conn_info_remote_address(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The client's IP address.
This property is read-only.
Data Type
String
conn_info_remote_port property (SFTPClient Struct)
The remote port of the client connection.
Syntax
fn conn_info_remote_port(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
The remote port of the client connection.
This property is read-only.
Data Type
i32
conn_info_remote_software_name property (SFTPClient Struct)
Returns the name (self-advertised) of the SSH software running on the other side.
Syntax
fn conn_info_remote_software_name(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Returns the name (self-advertised) of the SSH software running on the other side.
This property is read-only.
Data Type
String
conn_info_server_key_algorithm property (SFTPClient Struct)
Specifies the server's key algorithm.
Syntax
fn conn_info_server_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the server's key algorithm.
This property is read-only.
Data Type
String
conn_info_server_key_bits property (SFTPClient Struct)
Specifies the number of bits in the server's key.
Syntax
fn conn_info_server_key_bits(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
Specifies the number of bits in the server's key.
This property is read-only.
Data Type
i32
conn_info_server_key_fingerprint property (SFTPClient Struct)
The fingerprint (hash value) of the server's public key.
Syntax
fn conn_info_server_key_fingerprint(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The fingerprint (hash value) of the server's public key.
This property is read-only.
Data Type
String
conn_info_total_bytes_received property (SFTPClient Struct)
Returns the total number of bytes received over this connection.
Syntax
fn conn_info_total_bytes_received(&self ) -> Result<i64, SecureBlackboxError>
Default Value
0
Remarks
Returns the total number of bytes received over this connection.
This property is read-only.
Data Type
i64
conn_info_total_bytes_sent property (SFTPClient Struct)
Returns the total number of bytes sent over this connection.
Syntax
fn conn_info_total_bytes_sent(&self ) -> Result<i64, SecureBlackboxError>
Default Value
0
Remarks
Returns the total number of bytes sent over this connection.
This property is read-only.
Data Type
i64
conn_info_version property (SFTPClient Struct)
Specifies SSH protocol version.
Syntax
fn conn_info_version(&self ) -> Result<i32, SecureBlackboxError>
Default Value
2
Remarks
Specifies SSH protocol version.
This property is read-only.
Data Type
i32
curr_list_entry_access_time property (SFTPClient Struct)
Contains the last access time for this file, in UTC.
Syntax
fn curr_list_entry_access_time(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains the last access time for this file, in UTC.
This property is read-only.
Data Type
String
curr_list_entry_creation_time property (SFTPClient Struct)
Contains this file's creation time, in UTC.
Syntax
fn curr_list_entry_creation_time(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains this file's creation time, in UTC.
This property is read-only.
Data Type
String
curr_list_entry_entry_format property (SFTPClient Struct)
The file listing format: cfefUnknown 0 cfefUnix 1 cfefWindows 2 cfefMLSD 3 .
Syntax
fn curr_list_entry_entry_format(&self ) -> Result<i32, SecureBlackboxError>
Possible Values
0 // Unknown
1 // Unix
2 // Windows
3 // MLSD
Default Value
0
Remarks
The file listing format:
| cfefUnknown | 0 |
| cfefUnix | 1 |
| cfefWindows | 2 |
| cfefMLSD | 3 |
This property is read-only.
Data Type
i32
curr_list_entry_file_type property (SFTPClient Struct)
The type of the entry: fetUnknown 0 fetDirectory 1 fetFile 2 fetSymlink 3 fetSpecial 4 fetCurrentDirectory 5 fetParentDirectory 6 fetSocket 7 fetCharDevice 8 fetBlockDevice 9 fetFIFO 10 .
Syntax
fn curr_list_entry_file_type(&self ) -> Result<i32, SecureBlackboxError>
Possible Values
0 // Unknown
1 // Directory
2 // File
3 // Symlink
4 // Special
5 // CurrentDirectory
6 // ParentDirectory
7 // Socket
8 // CharDevice
9 // BlockDevice
10 // FIFO
Default Value
0
Remarks
The type of the entry:
| fetUnknown | 0 |
| fetDirectory | 1 |
| fetFile | 2 |
| fetSymlink | 3 |
| fetSpecial | 4 |
| fetCurrentDirectory | 5 |
| fetParentDirectory | 6 |
| fetSocket | 7 |
| fetCharDevice | 8 |
| fetBlockDevice | 9 |
| fetFIFO | 10 |
This property is read-only.
Data Type
i32
curr_list_entry_handle property (SFTPClient Struct)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
fn curr_list_entry_handle(&self ) -> Result<i64, SecureBlackboxError>
Default Value
0
Remarks
Allows to get or set a 'handle', a unique identifier of the underlying property object. Use this property to assign objects of the same type in a quicker manner, without copying them fieldwise.
When you pass a handle of one object to another, the source object is copied to the destination rather than assigned. It is safe to get rid of the original object
after such operation.
pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
This property is read-only.
Data Type
i64
curr_list_entry_modification_time property (SFTPClient Struct)
File last modification date/time.
Syntax
fn curr_list_entry_modification_time(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
File last modification date/time.
This property is read-only.
Data Type
String
curr_list_entry_name property (SFTPClient Struct)
The file or directory name.
Syntax
fn curr_list_entry_name(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The file or directory name.
This property is read-only.
Data Type
String
curr_list_entry_path property (SFTPClient Struct)
The full path to the file or directory.
Syntax
fn curr_list_entry_path(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The full path to the file or directory.
This property is read-only.
Data Type
String
curr_list_entry_principal property (SFTPClient Struct)
Specifies the owner of the file/directory.
Syntax
fn curr_list_entry_principal(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the owner of the file/directory.
Note: in earlier versions this property was called Owner. It was renamed to Principal to avoid clashes with certain SDK namings.
This property is read-only.
Data Type
String
curr_list_entry_size property (SFTPClient Struct)
File size in bytes.
Syntax
fn curr_list_entry_size(&self ) -> Result<i64, SecureBlackboxError>
Default Value
0
Remarks
File size in bytes.
This property is read-only.
Data Type
i64
curr_list_entry_unix_perms property (SFTPClient Struct)
The file Unix permissions bit mask (e.
Syntax
fn curr_list_entry_unix_perms(&self ) -> Result<i32, SecureBlackboxError>
Default Value
511
Remarks
The file Unix permissions bit mask (e.g. rwxrwxrwx=511 (0777); rwxr--r--=484 (0744)).
This property is read-only.
Data Type
i32
curr_list_entry_unparsed_name property (SFTPClient Struct)
The unparsed entry as returned by the server.
Syntax
fn curr_list_entry_unparsed_name(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The unparsed entry as returned by the server. Sometimes this is also known as "long name".
This property is read-only.
Data Type
String
download_block_size property (SFTPClient Struct)
The download block size in bytes.
Syntax
fn download_block_size(&self ) -> Result<i32, SecureBlackboxError>
fn set_download_block_size(&self, value : i32) -> Option<SecureBlackboxError>
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 (auto_adjust_transfer_block) don't work.
Data Type
i32
external_crypto_async_document_id property (SFTPClient Struct)
Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls.
Syntax
fn external_crypto_async_document_id(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_async_document_id(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_async_document_id_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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.
Data Type
String
external_crypto_custom_params property (SFTPClient Struct)
Custom parameters to be passed to the signing service (uninterpreted).
Syntax
fn external_crypto_custom_params(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_custom_params(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_custom_params_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Custom parameters to be passed to the signing service (uninterpreted).
Data Type
String
external_crypto_data property (SFTPClient Struct)
Additional data to be included in the async state and mirrored back by the requestor.
Syntax
fn external_crypto_data(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_data(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_data_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Additional data to be included in the async state and mirrored back by the requestor.
Data Type
String
external_crypto_external_hash_calculation property (SFTPClient Struct)
Specifies whether the message hash is to be calculated at the external endpoint.
Syntax
fn external_crypto_external_hash_calculation(&self ) -> Result<bool, SecureBlackboxError>
fn set_external_crypto_external_hash_calculation(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Specifies whether the message hash is to be calculated at the external endpoint. Please note that this mode is not supported by the DCAuth struct.
If set to true, the struct will pass a few kilobytes of to-be-signed data from the document to the OnExternalSign event. This only applies when SignExternal() is called.
Data Type
bool
external_crypto_hash_algorithm property (SFTPClient Struct)
Specifies the request's signature hash algorithm.
Syntax
fn external_crypto_hash_algorithm(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_hash_algorithm(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_hash_algorithm_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
"SHA256"
Remarks
Specifies the request's signature hash algorithm.
| SB_HASH_ALGORITHM_SHA1 | SHA1 | |
| SB_HASH_ALGORITHM_SHA224 | SHA224 | |
| SB_HASH_ALGORITHM_SHA256 | SHA256 | |
| SB_HASH_ALGORITHM_SHA384 | SHA384 | |
| SB_HASH_ALGORITHM_SHA512 | SHA512 | |
| SB_HASH_ALGORITHM_MD2 | MD2 | |
| SB_HASH_ALGORITHM_MD4 | MD4 | |
| SB_HASH_ALGORITHM_MD5 | MD5 | |
| SB_HASH_ALGORITHM_RIPEMD160 | RIPEMD160 | |
| SB_HASH_ALGORITHM_CRC32 | CRC32 | |
| SB_HASH_ALGORITHM_SSL3 | SSL3 | |
| SB_HASH_ALGORITHM_GOST_R3411_1994 | GOST1994 | |
| SB_HASH_ALGORITHM_WHIRLPOOL | WHIRLPOOL | |
| SB_HASH_ALGORITHM_POLY1305 | POLY1305 | |
| SB_HASH_ALGORITHM_SHA3_224 | SHA3_224 | |
| SB_HASH_ALGORITHM_SHA3_256 | SHA3_256 | |
| SB_HASH_ALGORITHM_SHA3_384 | SHA3_384 | |
| SB_HASH_ALGORITHM_SHA3_512 | SHA3_512 | |
| SB_HASH_ALGORITHM_BLAKE2S_128 | BLAKE2S_128 | |
| SB_HASH_ALGORITHM_BLAKE2S_160 | BLAKE2S_160 | |
| SB_HASH_ALGORITHM_BLAKE2S_224 | BLAKE2S_224 | |
| SB_HASH_ALGORITHM_BLAKE2S_256 | BLAKE2S_256 | |
| SB_HASH_ALGORITHM_BLAKE2B_160 | BLAKE2B_160 | |
| SB_HASH_ALGORITHM_BLAKE2B_256 | BLAKE2B_256 | |
| SB_HASH_ALGORITHM_BLAKE2B_384 | BLAKE2B_384 | |
| SB_HASH_ALGORITHM_BLAKE2B_512 | BLAKE2B_512 | |
| SB_HASH_ALGORITHM_SHAKE_128 | SHAKE_128 | |
| SB_HASH_ALGORITHM_SHAKE_256 | SHAKE_256 | |
| SB_HASH_ALGORITHM_SHAKE_128_LEN | SHAKE_128_LEN | |
| SB_HASH_ALGORITHM_SHAKE_256_LEN | SHAKE_256_LEN |
Data Type
String
external_crypto_key_id property (SFTPClient Struct)
The ID of the pre-shared key used for DC request authentication.
Syntax
fn external_crypto_key_id(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_key_id(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_key_id_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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 external_crypto_key_secret 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";
Data Type
String
external_crypto_key_secret property (SFTPClient Struct)
The pre-shared key used for DC request authentication.
Syntax
fn external_crypto_key_secret(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_key_secret(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_key_secret_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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 external_crypto_key_id topic.
Data Type
String
external_crypto_method property (SFTPClient Struct)
Specifies the asynchronous signing method.
Syntax
fn external_crypto_method(&self ) -> Result<i32, SecureBlackboxError>
fn set_external_crypto_method(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // PKCS1
1 // PKCS7
Default Value
0
Remarks
Specifies the asynchronous signing method. This is typically defined by the DC server capabilities and setup.
Available options:
| asmdPKCS1 | 0 |
| asmdPKCS7 | 1 |
Data Type
i32
external_crypto_mode property (SFTPClient Struct)
Specifies the external cryptography mode.
Syntax
fn external_crypto_mode(&self ) -> Result<i32, SecureBlackboxError>
fn set_external_crypto_mode(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // Default
1 // Disabled
2 // Generic
3 // DCAuth
4 // DCAuthJSON
Default Value
0
Remarks
Specifies the external cryptography mode.
Available options:
| ecmDefault | The default value (0) |
| ecmDisabled | Do not use DC or external signing (1) |
| ecmGeneric | Generic external signing with the OnExternalSign event (2) |
| ecmDCAuth | DCAuth signing (3) |
| ecmDCAuthJSON | DCAuth signing in JSON format (4) |
Data Type
i32
external_crypto_public_key_algorithm property (SFTPClient Struct)
Provide the public key algorithm here if the certificate is not available on the pre-signing stage.
Syntax
fn external_crypto_public_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
fn set_external_crypto_public_key_algorithm(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_public_key_algorithm_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Provide the public key algorithm here if the certificate is not available on the pre-signing stage.
| SB_CERT_ALGORITHM_ID_RSA_ENCRYPTION | rsaEncryption | |
| SB_CERT_ALGORITHM_MD2_RSA_ENCRYPTION | md2withRSAEncryption | |
| SB_CERT_ALGORITHM_MD5_RSA_ENCRYPTION | md5withRSAEncryption | |
| SB_CERT_ALGORITHM_SHA1_RSA_ENCRYPTION | sha1withRSAEncryption | |
| SB_CERT_ALGORITHM_ID_DSA | id-dsa | |
| SB_CERT_ALGORITHM_ID_DSA_SHA1 | id-dsa-with-sha1 | |
| SB_CERT_ALGORITHM_DH_PUBLIC | dhpublicnumber | |
| SB_CERT_ALGORITHM_SHA224_RSA_ENCRYPTION | sha224WithRSAEncryption | |
| SB_CERT_ALGORITHM_SHA256_RSA_ENCRYPTION | sha256WithRSAEncryption | |
| SB_CERT_ALGORITHM_SHA384_RSA_ENCRYPTION | sha384WithRSAEncryption | |
| SB_CERT_ALGORITHM_SHA512_RSA_ENCRYPTION | sha512WithRSAEncryption | |
| SB_CERT_ALGORITHM_ID_RSAPSS | id-RSASSA-PSS | |
| SB_CERT_ALGORITHM_ID_RSAOAEP | id-RSAES-OAEP | |
| SB_CERT_ALGORITHM_RSASIGNATURE_RIPEMD160 | ripemd160withRSA | |
| SB_CERT_ALGORITHM_ID_ELGAMAL | elGamal | |
| SB_CERT_ALGORITHM_SHA1_ECDSA | ecdsa-with-SHA1 | |
| SB_CERT_ALGORITHM_RECOMMENDED_ECDSA | ecdsa-recommended | |
| SB_CERT_ALGORITHM_SHA224_ECDSA | ecdsa-with-SHA224 | |
| SB_CERT_ALGORITHM_SHA256_ECDSA | ecdsa-with-SHA256 | |
| SB_CERT_ALGORITHM_SHA384_ECDSA | ecdsa-with-SHA384 | |
| SB_CERT_ALGORITHM_SHA512_ECDSA | ecdsa-with-SHA512 | |
| SB_CERT_ALGORITHM_EC | id-ecPublicKey | |
| SB_CERT_ALGORITHM_SPECIFIED_ECDSA | ecdsa-specified | |
| SB_CERT_ALGORITHM_GOST_R3410_1994 | id-GostR3410-94 | |
| SB_CERT_ALGORITHM_GOST_R3410_2001 | id-GostR3410-2001 | |
| SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_1994 | id-GostR3411-94-with-GostR3410-94 | |
| SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_2001 | id-GostR3411-94-with-GostR3410-2001 | |
| SB_CERT_ALGORITHM_SHA1_ECDSA_PLAIN | ecdsa-plain-SHA1 | |
| SB_CERT_ALGORITHM_SHA224_ECDSA_PLAIN | ecdsa-plain-SHA224 | |
| SB_CERT_ALGORITHM_SHA256_ECDSA_PLAIN | ecdsa-plain-SHA256 | |
| SB_CERT_ALGORITHM_SHA384_ECDSA_PLAIN | ecdsa-plain-SHA384 | |
| SB_CERT_ALGORITHM_SHA512_ECDSA_PLAIN | ecdsa-plain-SHA512 | |
| SB_CERT_ALGORITHM_RIPEMD160_ECDSA_PLAIN | ecdsa-plain-RIPEMD160 | |
| SB_CERT_ALGORITHM_WHIRLPOOL_RSA_ENCRYPTION | whirlpoolWithRSAEncryption | |
| SB_CERT_ALGORITHM_ID_DSA_SHA224 | id-dsa-with-sha224 | |
| SB_CERT_ALGORITHM_ID_DSA_SHA256 | id-dsa-with-sha256 | |
| SB_CERT_ALGORITHM_SHA3_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-224 | |
| SB_CERT_ALGORITHM_SHA3_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-256 | |
| SB_CERT_ALGORITHM_SHA3_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-384 | |
| SB_CERT_ALGORITHM_SHA3_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-512 | |
| SB_CERT_ALGORITHM_SHA3_224_ECDSA | id-ecdsa-with-sha3-224 | |
| SB_CERT_ALGORITHM_SHA3_256_ECDSA | id-ecdsa-with-sha3-256 | |
| SB_CERT_ALGORITHM_SHA3_384_ECDSA | id-ecdsa-with-sha3-384 | |
| SB_CERT_ALGORITHM_SHA3_512_ECDSA | id-ecdsa-with-sha3-512 | |
| SB_CERT_ALGORITHM_SHA3_224_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-224 | |
| SB_CERT_ALGORITHM_SHA3_256_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-256 | |
| SB_CERT_ALGORITHM_SHA3_384_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-384 | |
| SB_CERT_ALGORITHM_SHA3_512_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-512 | |
| SB_CERT_ALGORITHM_ID_DSA_SHA3_224 | id-dsa-with-sha3-224 | |
| SB_CERT_ALGORITHM_ID_DSA_SHA3_256 | id-dsa-with-sha3-256 | |
| SB_CERT_ALGORITHM_BLAKE2S_128_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s128 | |
| SB_CERT_ALGORITHM_BLAKE2S_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s160 | |
| SB_CERT_ALGORITHM_BLAKE2S_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s224 | |
| SB_CERT_ALGORITHM_BLAKE2S_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s256 | |
| SB_CERT_ALGORITHM_BLAKE2B_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b160 | |
| SB_CERT_ALGORITHM_BLAKE2B_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b256 | |
| SB_CERT_ALGORITHM_BLAKE2B_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b384 | |
| SB_CERT_ALGORITHM_BLAKE2B_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b512 | |
| SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA | id-ecdsa-with-blake2s128 | |
| SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA | id-ecdsa-with-blake2s160 | |
| SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA | id-ecdsa-with-blake2s224 | |
| SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA | id-ecdsa-with-blake2s256 | |
| SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA | id-ecdsa-with-blake2b160 | |
| SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA | id-ecdsa-with-blake2b256 | |
| SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA | id-ecdsa-with-blake2b384 | |
| SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA | id-ecdsa-with-blake2b512 | |
| SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s128 | |
| SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s160 | |
| SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s224 | |
| SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s256 | |
| SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b160 | |
| SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b256 | |
| SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b384 | |
| SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b512 | |
| SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_224 | id-dsa-with-blake2s224 | |
| SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_256 | id-dsa-with-blake2s256 | |
| SB_CERT_ALGORITHM_EDDSA_ED25519 | id-Ed25519 | |
| SB_CERT_ALGORITHM_EDDSA_ED448 | id-Ed448 | |
| SB_CERT_ALGORITHM_EDDSA_ED25519_PH | id-Ed25519ph | |
| SB_CERT_ALGORITHM_EDDSA_ED448_PH | id-Ed448ph | |
| SB_CERT_ALGORITHM_EDDSA | id-EdDSA | |
| SB_CERT_ALGORITHM_EDDSA_SIGNATURE | id-EdDSA-sig | |
| SB_CERT_ALGORITHM_MLDSA_44 | id-ml-dsa-44 | |
| SB_CERT_ALGORITHM_MLDSA_65 | id-ml-dsa-65 | |
| SB_CERT_ALGORITHM_MLDSA_87 | id-ml-dsa-87 | |
| SB_CERT_ALGORITHM_HASH_MLDSA_44_SHA512 | id-hash-ml-dsa-44-with-sha512 | |
| SB_CERT_ALGORITHM_HASH_MLDSA_65_SHA512 | id-hash-ml-dsa-65-with-sha512 | |
| SB_CERT_ALGORITHM_HASH_MLDSA_87_SHA512 | id-hash-ml-dsa-87-with-sha512 | |
| SB_CERT_ALGORITHM_MLKEM_512 | id-ml-kem-512 | |
| SB_CERT_ALGORITHM_MLKEM_768 | id-ml-kem-768 | |
| SB_CERT_ALGORITHM_MLKEM_1024 | id-ml-kem-1024 |
Data Type
String
fips_mode property (SFTPClient Struct)
Reserved.
Syntax
fn fips_mode(&self ) -> Result<bool, SecureBlackboxError>
fn set_fips_mode(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
This property is reserved for future use.
Data Type
bool
force_compression property (SFTPClient Struct)
Enforces compression for the SSH layer.
Syntax
fn force_compression(&self ) -> Result<bool, SecureBlackboxError>
fn set_force_compression(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Set this property before opening a connection to enforce compression of the SSH packets.
Data Type
bool
key_fingerprint_sha1 property (SFTPClient Struct)
Contains the SHA-1 fingerprint (hash) of the key.
Syntax
fn key_fingerprint_sha1(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains the SHA-1 fingerprint (hash) of the key.
This property is read-only.
Data Type
String
key_fingerprint_sha256 property (SFTPClient Struct)
Contains the SHA-256 fingerprint (hash) of the key.
Syntax
fn key_fingerprint_sha256(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains the SHA-256 fingerprint (hash) of the key.
This property is read-only.
Data Type
String
key_handle property (SFTPClient Struct)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
fn key_handle(&self ) -> Result<i64, SecureBlackboxError>
fn set_key_handle(&self, value : i64) -> Option<SecureBlackboxError>
Default Value
0
Remarks
Allows to get or set a 'handle', a unique identifier of the underlying property object. Use this property to assign objects of the same type in a quicker manner, without copying them fieldwise.
When you pass a handle of one object to another, the source object is copied to the destination rather than assigned. It is safe to get rid of the original object
after such operation.
pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
Data Type
i64
max_sftp_version property (SFTPClient Struct)
Higher SFTP version to support.
Syntax
fn max_sftp_version(&self ) -> Result<i32, SecureBlackboxError>
fn set_max_sftp_version(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
6
Remarks
max_sftp_version and min_sftp_version properties control the range of SFTP protocol versions supported by this client.
Data Type
i32
min_sftp_version property (SFTPClient Struct)
Lower SFTP version to support.
Syntax
fn min_sftp_version(&self ) -> Result<i32, SecureBlackboxError>
fn set_min_sftp_version(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
max_sftp_version and min_sftp_version properties control the range of SFTP protocol versions to be supported by this client.
Data Type
i32
password property (SFTPClient Struct)
Specifies user's authentication password.
Syntax
fn password(&self ) -> Result<String, SecureBlackboxError>
fn set_password(&self, value : &str) -> Option<SecureBlackboxError> fn set_password_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Use this property to provide an authentication password. This property is only applicable for password-based and keyboard-interactive authentication types.
Data Type
String
pipeline_length property (SFTPClient Struct)
The number of parallelized transfer requests.
Syntax
fn pipeline_length(&self ) -> Result<i32, SecureBlackboxError>
fn set_pipeline_length(&self, value : i32) -> Option<SecureBlackboxError>
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 (auto_adjust_transfer_block) don't work.
Data Type
i32
proxy_address property (SFTPClient Struct)
The IP address of the proxy server.
Syntax
fn proxy_address(&self ) -> Result<String, SecureBlackboxError>
fn set_proxy_address(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_address_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
The IP address of the proxy server.
Data Type
String
proxy_authentication property (SFTPClient Struct)
The authentication type used by the proxy server.
Syntax
fn proxy_authentication(&self ) -> Result<i32, SecureBlackboxError>
fn set_proxy_authentication(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // NoAuthentication
1 // Basic
2 // Digest
3 // NTLM
Default Value
0
Remarks
The authentication type used by the proxy server.
| patNoAuthentication | 0 |
| patBasic | 1 |
| patDigest | 2 |
| patNTLM | 3 |
Data Type
i32
proxy_password property (SFTPClient Struct)
The password to authenticate to the proxy server.
Syntax
fn proxy_password(&self ) -> Result<String, SecureBlackboxError>
fn set_proxy_password(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_password_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
The password to authenticate to the proxy server.
Data Type
String
proxy_port property (SFTPClient Struct)
The port on the proxy server to connect to.
Syntax
fn proxy_port(&self ) -> Result<i32, SecureBlackboxError>
fn set_proxy_port(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
The port on the proxy server to connect to.
Data Type
i32
proxy_type property (SFTPClient Struct)
The type of the proxy server.
Syntax
fn proxy_type(&self ) -> Result<i32, SecureBlackboxError>
fn set_proxy_type(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // None
1 // Socks4
2 // Socks5
3 // WebTunnel
4 // HTTP
Default Value
0
Remarks
The type of the proxy server.
| cptNone | 0 |
| cptSocks4 | 1 |
| cptSocks5 | 2 |
| cptWebTunnel | 3 |
| cptHTTP | 4 |
Data Type
i32
proxy_request_headers property (SFTPClient Struct)
Contains HTTP request headers for WebTunnel and HTTP proxy.
Syntax
fn proxy_request_headers(&self ) -> Result<String, SecureBlackboxError>
fn set_proxy_request_headers(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_request_headers_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Contains HTTP request headers for WebTunnel and HTTP proxy.
Data Type
String
proxy_response_body property (SFTPClient Struct)
Contains the HTTP or HTTPS (WebTunnel) proxy response body.
Syntax
fn proxy_response_body(&self ) -> Result<String, SecureBlackboxError>
fn set_proxy_response_body(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_response_body_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Contains the HTTP or HTTPS (WebTunnel) proxy response body.
Data Type
String
proxy_response_headers property (SFTPClient Struct)
Contains response headers received from an HTTP or HTTPS (WebTunnel) proxy server.
Syntax
fn proxy_response_headers(&self ) -> Result<String, SecureBlackboxError>
fn set_proxy_response_headers(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_response_headers_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Contains response headers received from an HTTP or HTTPS (WebTunnel) proxy server.
Data Type
String
proxy_use_ipv6 property (SFTPClient Struct)
Specifies whether IPv6 should be used when connecting through the proxy.
Syntax
fn proxy_use_ipv6(&self ) -> Result<bool, SecureBlackboxError>
fn set_proxy_use_ipv6(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Specifies whether IPv6 should be used when connecting through the proxy.
Data Type
bool
proxy_username property (SFTPClient Struct)
Specifies the username credential for proxy authentication.
Syntax
fn proxy_username(&self ) -> Result<String, SecureBlackboxError>
fn set_proxy_username(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_username_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Specifies the username credential for proxy authentication.
Data Type
String
server_key_algorithm property (SFTPClient Struct)
Specifies the key algorithm.
Syntax
fn server_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the key algorithm.
The following key algorithms are currently supported and can be returned by this property:
- RSA
- DSS
- ECDSA
- EDDSA
- MLDSA
- ECDSA-SK
- EDDSA-SK
This property is read-only.
Data Type
String
server_key_bits property (SFTPClient Struct)
The number of bits in the key: the more the better, 2048 or 4096 are typical values.
Syntax
fn server_key_bits(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
The number of bits in the key: the more the better, 2048 or 4096 are typical values.
This property is read-only.
Data Type
i32
server_key_comment property (SFTPClient Struct)
The comment for the public key.
Syntax
fn server_key_comment(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
The comment for the public key.
This property is read-only.
Data Type
String
server_key_curve property (SFTPClient Struct)
Specifies the elliptical curve when EC cryptography is used.
Syntax
fn server_key_curve(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the elliptical curve when EC cryptography is used.
The following curves are currently supported:
- NISTP256
- NISTP384
- NISTP521
- NISTK163
- NISTP192
- NISTP224
- NISTK233
- NISTB233
- NISTK283
- NISTK409
- NISTB409
- NISTK571
- CURVE25519 (EdDSA curve)
- CURVE448 (EdDSA curve)
This property is read-only.
Data Type
String
server_key_extractable property (SFTPClient Struct)
Whether the key is extractable (e.
Syntax
fn server_key_extractable(&self ) -> Result<bool, SecureBlackboxError>
Default Value
false
Remarks
Whether the key is extractable (e.g., from a security token), or not.
This property is read-only.
Data Type
bool
server_key_fingerprint_md5 property (SFTPClient Struct)
Contains the MD5 fingerprint (hash) of the key.
Syntax
fn server_key_fingerprint_md5(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains the MD5 fingerprint (hash) of the key.
This property is read-only.
Data Type
String
server_key_fingerprint_sha1 property (SFTPClient Struct)
Contains the SHA-1 fingerprint (hash) of the key.
Syntax
fn server_key_fingerprint_sha1(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains the SHA-1 fingerprint (hash) of the key.
This property is read-only.
Data Type
String
server_key_fingerprint_sha256 property (SFTPClient Struct)
Contains the SHA-256 fingerprint (hash) of the key.
Syntax
fn server_key_fingerprint_sha256(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Contains the SHA-256 fingerprint (hash) of the key.
This property is read-only.
Data Type
String
server_key_handle property (SFTPClient Struct)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
fn server_key_handle(&self ) -> Result<i64, SecureBlackboxError>
Default Value
0
Remarks
Allows to get or set a 'handle', a unique identifier of the underlying property object. Use this property to assign objects of the same type in a quicker manner, without copying them fieldwise.
When you pass a handle of one object to another, the source object is copied to the destination rather than assigned. It is safe to get rid of the original object
after such operation.
pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
This property is read-only.
Data Type
i64
server_key_key_format property (SFTPClient Struct)
Specifies the format in which the key is stored.
Syntax
fn server_key_key_format(&self ) -> Result<i32, SecureBlackboxError>
Possible Values
0 // OpenSSH
1 // OpenSSH2
2 // IETF
3 // PuTTY
4 // X509
5 // Binary
6 // SSH1
7 // PGP
8 // PKCS8
9 // PuTTY3
10 // OpenSSHCert
Default Value
0
Remarks
Specifies the format in which the key is stored.
| ckfOpenSSH | 0 | |
| ckfOpenSSH2 | 1 | |
| ckfIETF | 2 | |
| ckfPuTTY | 3 | |
| ckfX509 | 4 | |
| ckfBinary | 5 | |
| ckfSSH1 | 6 | |
| ckfPGP | 7 | |
| ckfPKCS8 | 8 | |
| ckfPuTTY3 | 9 | |
| ckfOpenSSHCert | 10 |
This property is read-only.
Data Type
i32
server_key_key_protection_algorithm property (SFTPClient Struct)
Specifies the key protection algorithm.
Syntax
fn server_key_key_protection_algorithm(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the key protection algorithm.
This property is read-only.
Data Type
String
server_key_private property (SFTPClient Struct)
Whether this key is a private key or not.
Syntax
fn server_key_private(&self ) -> Result<bool, SecureBlackboxError>
Default Value
false
Remarks
Whether this key is a private key or not.
This property is read-only.
Data Type
bool
server_key_public property (SFTPClient Struct)
Whether this key is a public key or not.
Syntax
fn server_key_public(&self ) -> Result<bool, SecureBlackboxError>
Default Value
false
Remarks
Whether this key is a public key or not.
This property is read-only.
Data Type
bool
server_key_subject property (SFTPClient Struct)
Specifies the public key owner (subject).
Syntax
fn server_key_subject(&self ) -> Result<String, SecureBlackboxError>
Default Value
""
Remarks
Specifies the public key owner (subject). This property is used only for IETF-keys.
This property is read-only.
Data Type
String
socket_dns_mode property (SFTPClient Struct)
Selects the DNS resolver to use: the struct's (secure) built-in one, or the one provided by the system.
Syntax
fn socket_dns_mode(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_dns_mode(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // Auto
1 // Platform
2 // Own
3 // OwnSecure
Default Value
0
Remarks
Selects the DNS resolver to use: the component's (secure) built-in one, or the one provided by the system.
| dmAuto | 0 |
| dmPlatform | 1 |
| dmOwn | 2 |
| dmOwnSecure | 3 |
Data Type
i32
socket_dns_port property (SFTPClient Struct)
Specifies the port number to be used for sending queries to the DNS server.
Syntax
fn socket_dns_port(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_dns_port(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
Specifies the port number to be used for sending queries to the DNS server.
Data Type
i32
socket_dns_query_timeout property (SFTPClient Struct)
The timeout (in milliseconds) for each DNS query.
Syntax
fn socket_dns_query_timeout(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_dns_query_timeout(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
The timeout (in milliseconds) for each DNS query. The value of 0 indicates an infinite timeout.
Data Type
i32
socket_dns_servers property (SFTPClient Struct)
The addresses of DNS servers to use for address resolution, separated by commas or semicolons.
Syntax
fn socket_dns_servers(&self ) -> Result<String, SecureBlackboxError>
fn set_socket_dns_servers(&self, value : &str) -> Option<SecureBlackboxError> fn set_socket_dns_servers_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
The addresses of DNS servers to use for address resolution, separated by commas or semicolons.
Data Type
String
socket_dns_total_timeout property (SFTPClient Struct)
The timeout (in milliseconds) for the whole resolution process.
Syntax
fn socket_dns_total_timeout(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_dns_total_timeout(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
The timeout (in milliseconds) for the whole resolution process. The value of 0 indicates an infinite timeout.
Data Type
i32
socket_incoming_speed_limit property (SFTPClient Struct)
The maximum number of bytes to read from the socket, per second.
Syntax
fn socket_incoming_speed_limit(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_incoming_speed_limit(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
The maximum number of bytes to read from the socket, per second.
Data Type
i32
socket_local_address property (SFTPClient Struct)
The local network interface to bind the socket to.
Syntax
fn socket_local_address(&self ) -> Result<String, SecureBlackboxError>
fn set_socket_local_address(&self, value : &str) -> Option<SecureBlackboxError> fn set_socket_local_address_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
The local network interface to bind the socket to.
Data Type
String
socket_local_port property (SFTPClient Struct)
The local port number to bind the socket to.
Syntax
fn socket_local_port(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_local_port(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
The local port number to bind the socket to.
Data Type
i32
socket_outgoing_speed_limit property (SFTPClient Struct)
The maximum number of bytes to write to the socket, per second.
Syntax
fn socket_outgoing_speed_limit(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_outgoing_speed_limit(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
0
Remarks
The maximum number of bytes to write to the socket, per second.
Data Type
i32
socket_timeout property (SFTPClient Struct)
The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
Syntax
fn socket_timeout(&self ) -> Result<i32, SecureBlackboxError>
fn set_socket_timeout(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
60000
Remarks
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).
Data Type
i32
socket_use_ipv6 property (SFTPClient Struct)
Enables or disables IP protocol version 6.
Syntax
fn socket_use_ipv6(&self ) -> Result<bool, SecureBlackboxError>
fn set_socket_use_ipv6(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Enables or disables IP protocol version 6.
Data Type
bool
ssh_settings_auto_adjust_ciphers property (SFTPClient Struct)
Whether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.
Syntax
fn ssh_settings_auto_adjust_ciphers(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_auto_adjust_ciphers(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
true
Remarks
Whether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.
Data Type
bool
ssh_settings_base_configuration property (SFTPClient Struct)
Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
Syntax
fn ssh_settings_base_configuration(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_base_configuration(&self, value : i32) -> Option<SecureBlackboxError>
Possible Values
0 // Default
1 // Compatible
2 // ComprehensiveInsecure
3 // HighlySecure
Default Value
0
Remarks
Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
Data Type
i32
ssh_settings_compression_algorithms property (SFTPClient Struct)
A list of session compression algorithms separated with commas or semicolons.
Syntax
fn ssh_settings_compression_algorithms(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_compression_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_compression_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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
Data Type
String
ssh_settings_compression_level property (SFTPClient Struct)
Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).
Syntax
fn ssh_settings_compression_level(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_compression_level(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
6
Remarks
Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression). This setting is ignored if compression wasn't accepted.
Data Type
i32
ssh_settings_default_window_size property (SFTPClient Struct)
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.
Syntax
fn ssh_settings_default_window_size(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_default_window_size(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
2048000
Remarks
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.
Data Type
i32
ssh_settings_encryption_algorithms property (SFTPClient Struct)
A list of session encryption algorithms separated with commas or semicolons.
Syntax
fn ssh_settings_encryption_algorithms(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_encryption_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_encryption_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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
Data Type
String
ssh_settings_force_compression property (SFTPClient Struct)
Whether the SSH client should explicitly request compression.
Syntax
fn ssh_settings_force_compression(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_force_compression(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
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.
Data Type
bool
ssh_settings_forward_auth_agent property (SFTPClient Struct)
Enables or disables auth agent forwarding.
Syntax
fn ssh_settings_forward_auth_agent(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_forward_auth_agent(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Enables or disables auth agent forwarding. This allows the struct to connect to the second and subsequent servers in the chain with the key agent available on the client computer.
Data Type
bool
ssh_settings_gss_auth_types property (SFTPClient Struct)
A comma-separated list of authentication types.
Syntax
fn ssh_settings_gss_auth_types(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_gss_auth_types(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_auth_types_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
A comma-separated list of authentication types. Two types are currently supported: gssapi-with-mic and gssapi-keyex.
Data Type
String
ssh_settings_gss_delegate_creds property (SFTPClient Struct)
Switches credential delegation on or off.
Syntax
fn ssh_settings_gss_delegate_creds(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_gss_delegate_creds(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Switches credential delegation on or off.
Data Type
bool
ssh_settings_gss_hostname property (SFTPClient Struct)
The GSS host name, in form of a FQDN (e.
Syntax
fn ssh_settings_gss_hostname(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_gss_hostname(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_hostname_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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).
Data Type
String
ssh_settings_gss_lib property (SFTPClient Struct)
A path to the GSS-API library (DLL or SO).
Syntax
fn ssh_settings_gss_lib(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_gss_lib(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_lib_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
A path to the GSS-API library (DLL or SO).
Data Type
String
ssh_settings_gss_mechanisms property (SFTPClient Struct)
A comma-separated list of GSS mechanisms to use.
Syntax
fn ssh_settings_gss_mechanisms(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_gss_mechanisms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_mechanisms_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
A comma-separated list of GSS mechanisms to use. Two values are currently supported: lib and SSPI.
Data Type
String
ssh_settings_gss_protocols property (SFTPClient Struct)
A comma-separated list of SSPI protocols.
Syntax
fn ssh_settings_gss_protocols(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_gss_protocols(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_protocols_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
A comma-separated list of SSPI protocols. Two protocols are currently supported: kerberos and NTLM.
Data Type
String
ssh_settings_handshake_timeout property (SFTPClient Struct)
Specifies the maximal time for the SSH handshake to proceed, in seconds.
Syntax
fn ssh_settings_handshake_timeout(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_handshake_timeout(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
45
Remarks
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.
Data Type
i32
ssh_settings_kex_algorithms property (SFTPClient Struct)
A list of key exchange algorithms separated with commas or semicolons.
Syntax
fn ssh_settings_kex_algorithms(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_kex_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_kex_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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
Data Type
String
ssh_settings_mac_algorithms property (SFTPClient Struct)
A list of MAC (for message authentication code ) algorithms separated with commas or semicolons.
Syntax
fn ssh_settings_mac_algorithms(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_mac_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_mac_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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
Data Type
String
ssh_settings_max_ssh_packet_size property (SFTPClient Struct)
Specifies the maximum length of one SSH packet in bytes.
Syntax
fn ssh_settings_max_ssh_packet_size(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_max_ssh_packet_size(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
262144
Remarks
Specifies the maximum length of one SSH packet in bytes.
Data Type
i32
ssh_settings_min_window_size property (SFTPClient Struct)
Specifies the minimal internal window size.
Syntax
fn ssh_settings_min_window_size(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_min_window_size(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
2048
Remarks
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.
Data Type
i32
ssh_settings_obfuscate_handshake property (SFTPClient Struct)
Enables or disables handshake obfuscation.
Syntax
fn ssh_settings_obfuscate_handshake(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_obfuscate_handshake(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Enables or disables handshake obfuscation.
Data Type
bool
ssh_settings_obfuscation_password property (SFTPClient Struct)
Specifies the password used to encrypt the handshake when ObfuscateHandshake is set.
Syntax
fn ssh_settings_obfuscation_password(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_obfuscation_password(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_obfuscation_password_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Specifies the password used to encrypt the handshake when ObfuscateHandshake is set.
Data Type
String
ssh_settings_public_key_algorithms property (SFTPClient Struct)
A list of public key algorithms separated with commas or semicolons.
Syntax
fn ssh_settings_public_key_algorithms(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_public_key_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_public_key_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
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
Data Type
String
ssh_settings_request_password_change property (SFTPClient Struct)
Whether to request a password change when connecting.
Syntax
fn ssh_settings_request_password_change(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_request_password_change(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Whether to request a password change when connecting.
Data Type
bool
ssh_settings_software_name property (SFTPClient Struct)
The name to be used by the struct to identify itself.
Syntax
fn ssh_settings_software_name(&self ) -> Result<String, SecureBlackboxError>
fn set_ssh_settings_software_name(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_software_name_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
"SecureBlackbox"
Remarks
The name to be used by the component to identify itself.
Data Type
String
ssh_settings_trust_all_keys property (SFTPClient Struct)
Enables or disables explicit trust to all server keys.
Syntax
fn ssh_settings_trust_all_keys(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_trust_all_keys(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Enables or disables explicit trust to all server keys. Use with care.
Data Type
bool
ssh_settings_use_auth_agent property (SFTPClient Struct)
Enables or disables the use of external key agent, such as Putty key agent.
Syntax
fn ssh_settings_use_auth_agent(&self ) -> Result<bool, SecureBlackboxError>
fn set_ssh_settings_use_auth_agent(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
Enables or disables the use of external key agent, such as Putty key agent.
Data Type
bool
ssh_settings_versions property (SFTPClient Struct)
Specifies enabled SSH protocol versions (1 or 2).
Syntax
fn ssh_settings_versions(&self ) -> Result<i32, SecureBlackboxError>
fn set_ssh_settings_versions(&self, value : i32) -> Option<SecureBlackboxError>
Default Value
1
Remarks
Specifies enabled SSH protocol versions (1 or 2).
Data Type
i32
trusted_keys_file property (SFTPClient Struct)
A file containing the keys of authorized servers.
Syntax
fn trusted_keys_file(&self ) -> Result<String, SecureBlackboxError>
fn set_trusted_keys_file(&self, value : &str) -> Option<SecureBlackboxError> fn set_trusted_keys_file_ref(&self, value : &String) -> Option<SecureBlackboxError>
Default Value
""
Remarks
Use this property to provide a path to the 'authorized_keys' file to be used by the client.
Data Type
String
upload_block_size property (SFTPClient Struct)
The upload block size in bytes.
Syntax
fn upload_block_size(&self ) -> Result<i32, SecureBlackboxError>
fn set_upload_block_size(&self, value : i32) -> Option<SecureBlackboxError>
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 (auto_adjust_transfer_block) don't work.
Data Type
i32
username property (SFTPClient Struct)
The client's username to authenticate to the server.
Syntax
fn username(&self ) -> Result<String, SecureBlackboxError>
fn set_username(&self, value : &str) -> Option<SecureBlackboxError> fn set_username_ref(&self, value : &String) -> Option<SecureBlackboxError>
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.
Data Type
String
use_utf8 property (SFTPClient Struct)
Enables UTF8 for all string content.
Syntax
fn use_utf8(&self ) -> Result<bool, SecureBlackboxError>
fn set_use_utf8(&self, value : bool) -> Option<SecureBlackboxError>
Default Value
false
Remarks
If UseUTF8 is true, the struct 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.
Data Type
bool
version property (SFTPClient Struct)
The SFTP version negotiated.
Syntax
fn version(&self ) -> Result<i32, SecureBlackboxError>
Default Value
0
Remarks
Use this property to get the negotiated SFTP version.
This property is read-only.
Data Type
i32
absolute_path method (SFTPClient Struct)
Requests the absolute path for a relative path.
Syntax
fn absolute_path(&self, remote_path : &str) -> Result<String, SecureBlackboxError>
Remarks
Use this method to ask the SFTP server to convert a relative path to an absolute.
change_dir method (SFTPClient Struct)
Changes current working directory on the server.
Syntax
fn change_dir(&self, remote_dir : &str) -> Result<(), SecureBlackboxError>
Remarks
Changes current working directory on the server to RemoteDir.
config method (SFTPClient Struct)
Sets or retrieves a configuration setting.
Syntax
fn config(&self, configuration_string : &str) -> Result<String, SecureBlackboxError>
Remarks
config is a generic method available in every struct. It is used to set and retrieve configuration settings for the struct.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the struct, 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 Struct)
Connects to an SFTP server.
Syntax
fn connect(&self, address : &str, port : i32) -> Result<(), SecureBlackboxError>
Remarks
Use this method to connect to the SFTP server identified via its Address and Port.
create_link method (SFTPClient Struct)
Creates a symbolic or hard link to a remote file.
Syntax
fn create_link(&self, link_path : &str, target_path : &str, hard_link : bool) -> Result<(), SecureBlackboxError>
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 destination file or directory path via the TargetPath parameter. HardLink specifies whether the new link should be hard (true) or symbolic (false).
delete_dir method (SFTPClient Struct)
Removes directory from the SFTP server.
Syntax
fn delete_dir(&self, remote_dir : &str) -> Result<(), SecureBlackboxError>
Remarks
Use RemoteDir to provide a path to the directory to be deleted.
delete_file method (SFTPClient Struct)
Deletes a file from the SFTP server.
Syntax
fn delete_file(&self, remote_file : &str) -> Result<(), SecureBlackboxError>
Remarks
Use the RemoteFile parameter to specify the name of the file to delete.
delete_files method (SFTPClient Struct)
Deletes a group of files from the SFTP server.
Syntax
fn delete_files(&self, remote_path : &str, mask : &str, case_sensitive : bool, recursive : bool, error_handling : i32) -> Result<(), SecureBlackboxError>
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.
The ErrorHandling parameter specifies the error handling tactics.
| ehStopOnFailure | 0 | Stop on the first failure and throw an exception |
| ehIgnoreErrors | 1 | Ignore individual processing errors, just proceed to the next item on the list |
| ehTryAllItems | 2 | Try to process all the items by ignoring any mid-way errors, but throw an exception at the end of the processing if any of the items failed to process |
This method is a more efficient way to delete a group of files than deleting them one by one.
dir_exists method (SFTPClient Struct)
Checks if a directory exists on the SFTP server.
Syntax
fn dir_exists(&self, remote_dir : &str) -> Result<bool, SecureBlackboxError>
Remarks
RemoteDir specifies the name of the remote directory to check for existence.
disconnect method (SFTPClient Struct)
Disconnects from the SFTP server.
Syntax
fn disconnect(&self) -> Result<(), SecureBlackboxError>
Remarks
Call this method to disconnect from the SFTP server.
do_action method (SFTPClient Struct)
Performs an additional action.
Syntax
fn do_action(&self, action_id : &str, action_params : &str) -> Result<String, SecureBlackboxError>
Remarks
do_action is a generic method available in every struct. 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;....
Common ActionIDs:
| Action | Parameters | Returned value | Description |
| ResetTrustedListCache | none | none | Clears the cached list of trusted lists. |
| ResetCertificateCache | none | none | Clears the cached certificates. |
| ResetCRLCache | none | none | Clears the cached CRLs. |
| ResetOCSPResponseCache | none | none | Clears the cached OCSP responses. |
download_bytes method (SFTPClient Struct)
Downloads a file from the server into an array of bytes.
Syntax
fn download_bytes(&self, remote_file : &str) -> Result<Vec<u8>, SecureBlackboxError>
Remarks
Use this method to download RemoteFile into a byte array.
download_file method (SFTPClient Struct)
Downloads a file from the SFTP server.
Syntax
fn download_file(&self, remote_file : &str, local_file : &str) -> Result<(), SecureBlackboxError>
Remarks
Use this method to download RemoteFile into the location specified by LocalFile.
download_files method (SFTPClient Struct)
Downloads multiple files from the SFTP server.
Syntax
fn download_files(&self, remote_path : &str, local_dir : &str, recursive : bool, error_handling : i32) -> Result<(), SecureBlackboxError>
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. The Recursive parameter tells the component whether it should navigate source directories recursively when downloading files. If set to false, only the files residing in the actual RemotePath, but not its subdirectories, will be downloaded.
The ErrorHandling parameter specifies the error handling tactics.
| ehStopOnFailure | 0 | Stop on the first failure and throw an exception |
| ehIgnoreErrors | 1 | Ignore individual processing errors, just proceed to the next item on the list |
| ehTryAllItems | 2 | Try to process all the items by ignoring any mid-way errors, but throw an exception at the end of the processing if any of the items failed to process |
execute_ssh_command method (SFTPClient Struct)
Sends an SSH command to the server in the middle of SFTP session.
Syntax
fn execute_ssh_command(&self, command : &str) -> Result<Vec<u8>, SecureBlackboxError>
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.
extension_cmd method (SFTPClient Struct)
Sends an extension command to the server.
Syntax
fn extension_cmd(&self, extn : &str, data_buffer : &[u8]) -> Result<Vec<u8>, SecureBlackboxError>
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.
file_exists method (SFTPClient Struct)
Checks whether a file exists on the server.
Syntax
fn file_exists(&self, remote_file : &str) -> Result<bool, SecureBlackboxError>
Remarks
Use this method to check if a RemoteFile exists on the server.
get_current_dir method (SFTPClient Struct)
Returns the current directory on the SFTP server.
Syntax
fn get_current_dir(&self) -> Result<String, SecureBlackboxError>
Remarks
Use this method to retrieve the current directory as stored by the struct. This is a virtualized current directory, as SFTP protocol does not maintain a concept of the current directory.
get_file_size method (SFTPClient Struct)
Checks the size of a remote file.
Syntax
fn get_file_size(&self, remote_file : &str) -> Result<i64, SecureBlackboxError>
Remarks
Returns the size of the RemoteFile.
list_dir method (SFTPClient Struct)
Lists the content of the current remote directory.
Syntax
fn list_dir(&self, include_files : bool, include_directories : bool) -> Result<String, SecureBlackboxError>
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 on_list_entry event.
make_dir method (SFTPClient Struct)
Creates a new directory on the server.
Syntax
fn make_dir(&self, remote_dir : &str) -> Result<(), SecureBlackboxError>
Remarks
RemoteDir specifies the name of the new directory.
rename_file method (SFTPClient Struct)
Renames a file.
Syntax
fn rename_file(&self, source_file : &str, dest_file : &str) -> Result<(), SecureBlackboxError>
Remarks
Use this method to rename a remote file. Provide the old and the new name via SourceFile and DestFile parameters.
request_attributes method (SFTPClient Struct)
Requests attributes of the remote file.
Syntax
fn request_attributes(&self, remote_path : &str, follow_sym_links : bool) -> Result<String, SecureBlackboxError>
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.
reset method (SFTPClient Struct)
Resets the struct settings.
Syntax
fn reset(&self) -> Result<(), SecureBlackboxError>
Remarks
reset is a generic method available in every struct.
set_attributes method (SFTPClient Struct)
Sets the attributes upon a remote file.
Syntax
fn set_attributes(&self, remote_path : &str, attributes : &str) -> Result<(), SecureBlackboxError>
Remarks
Use this method to set the attributes of a remote file.
upload_bytes method (SFTPClient Struct)
Uploads a byte array to the server.
Syntax
fn upload_bytes(&self, bytes : &[u8], remote_file : &str) -> Result<(), SecureBlackboxError>
Remarks
Use this method to upload Bytes or its part to RemoteFile on the server.
upload_file method (SFTPClient Struct)
Uploads a file to the server.
Syntax
fn upload_file(&self, local_file : &str, remote_file : &str) -> Result<(), SecureBlackboxError>
Remarks
Use this method to upload LocalFile to the RemoteFile location on the server.
upload_files method (SFTPClient Struct)
Uploads multiple files to the server.
Syntax
fn upload_files(&self, local_path : &str, remote_dir : &str, recursive : bool, error_handling : i32) -> Result<(), SecureBlackboxError>
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. The Recursive parameter tells the component whether it should navigate source directories recursively when uploading files. If set to false, only the files residing in the actual LocalPath, but not its subdirectories, will be uploaded.
The ErrorHandling parameter specifies one of the pre-defined error handling tactics:
| ehStopOnFailure | 0 | Stop on the first failure and throw an exception |
| ehIgnoreErrors | 1 | Ignore individual processing errors, just proceed to the next item on the list |
| ehTryAllItems | 2 | Try to process all the items by ignoring any mid-way errors, but throw an exception at the end of the processing if any of the items failed to process |
on_auth_attempt event (SFTPClient Struct)
Fires when an authentication attempt is performed.
Syntax
// SFTPClientAuthAttemptEventArgs carries the SFTPClient AuthAttempt event's parameters.
pub struct SFTPClientAuthAttemptEventArgs {
fn auth_type(&self) -> i32
}
// SFTPClientAuthAttemptEvent defines the signature of the SFTPClient AuthAttempt event's handler function.
pub trait SFTPClientAuthAttemptEvent {
fn on_auth_attempt(&self, sender : SFTPClient, e : &mut SFTPClientAuthAttemptEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_auth_attempt(&self) -> &'a dyn SFTPClientAuthAttemptEvent;
pub fn set_on_auth_attempt(&mut self, value : &'a dyn SFTPClientAuthAttemptEvent);
...
}
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:
| atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
| atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
| atPassword | 0x04 | Password-based authentication |
| atHostbased | 0x08 | Hostbased authentication |
| atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
| atGssWithMic | 0x20 | GSS authentication |
| atGssKeyex | 0x40 | GSS authentication with key exchange |
| atPublicKeyAgent | 0x80 | Public key agent authentication |
on_auth_failed event (SFTPClient Struct)
Fires if an authentication attempt fails.
Syntax
// SFTPClientAuthFailedEventArgs carries the SFTPClient AuthFailed event's parameters.
pub struct SFTPClientAuthFailedEventArgs {
fn auth_type(&self) -> i32
}
// SFTPClientAuthFailedEvent defines the signature of the SFTPClient AuthFailed event's handler function.
pub trait SFTPClientAuthFailedEvent {
fn on_auth_failed(&self, sender : SFTPClient, e : &mut SFTPClientAuthFailedEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_auth_failed(&self) -> &'a dyn SFTPClientAuthFailedEvent;
pub fn set_on_auth_failed(&mut self, value : &'a dyn SFTPClientAuthFailedEvent);
...
}
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 auth_attempts 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:
| atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
| atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
| atPassword | 0x04 | Password-based authentication |
| atHostbased | 0x08 | Hostbased authentication |
| atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
| atGssWithMic | 0x20 | GSS authentication |
| atGssKeyex | 0x40 | GSS authentication with key exchange |
| atPublicKeyAgent | 0x80 | Public key agent authentication |
on_auth_succeeded event (SFTPClient Struct)
Reports a successful authentication.
Syntax
// SFTPClientAuthSucceededEventArgs carries the SFTPClient AuthSucceeded event's parameters.
pub struct SFTPClientAuthSucceededEventArgs {
}
// SFTPClientAuthSucceededEvent defines the signature of the SFTPClient AuthSucceeded event's handler function.
pub trait SFTPClientAuthSucceededEvent {
fn on_auth_succeeded(&self, sender : SFTPClient, e : &mut SFTPClientAuthSucceededEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_auth_succeeded(&self) -> &'a dyn SFTPClientAuthSucceededEvent;
pub fn set_on_auth_succeeded(&mut self, value : &'a dyn SFTPClientAuthSucceededEvent);
...
}
Remarks
This event marks the completion of the authentication procedure, and signifies transition to the SSH connection subprotocol.
on_banner event (SFTPClient Struct)
Reports the receipt of the Welcome message from the server.
Syntax
// SFTPClientBannerEventArgs carries the SFTPClient Banner event's parameters.
pub struct SFTPClientBannerEventArgs {
fn text(&self) -> &[u8]
fn language(&self) -> &[u8]
}
// SFTPClientBannerEvent defines the signature of the SFTPClient Banner event's handler function.
pub trait SFTPClientBannerEvent {
fn on_banner(&self, sender : SFTPClient, e : &mut SFTPClientBannerEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_banner(&self) -> &'a dyn SFTPClientBannerEvent;
pub fn set_on_banner(&mut self, value : &'a dyn SFTPClientBannerEvent);
...
}
Remarks
The struct fires this event when it receives a welcome message from the server. Use the Text parameter to access the encoded message.
on_disconnect event (SFTPClient Struct)
Reports SFTP connection closure.
Syntax
// SFTPClientDisconnectEventArgs carries the SFTPClient Disconnect event's parameters.
pub struct SFTPClientDisconnectEventArgs {
fn close_reason(&self) -> i32
}
// SFTPClientDisconnectEvent defines the signature of the SFTPClient Disconnect event's handler function.
pub trait SFTPClientDisconnectEvent {
fn on_disconnect(&self, sender : SFTPClient, e : &mut SFTPClientDisconnectEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_disconnect(&self) -> &'a dyn SFTPClientDisconnectEvent;
pub fn set_on_disconnect(&mut self, value : &'a dyn SFTPClientDisconnectEvent);
...
}
Remarks
The struct fires this event to report connection closure. No more SFTP activity could be done after the disconnect.
on_error event (SFTPClient Struct)
Information about errors during SFTP connection.
Syntax
// SFTPClientErrorEventArgs carries the SFTPClient Error event's parameters.
pub struct SFTPClientErrorEventArgs {
fn error_code(&self) -> i32
fn description(&self) -> &String
}
// SFTPClientErrorEvent defines the signature of the SFTPClient Error event's handler function.
pub trait SFTPClientErrorEvent {
fn on_error(&self, sender : SFTPClient, e : &mut SFTPClientErrorEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_error(&self) -> &'a dyn SFTPClientErrorEvent;
pub fn set_on_error(&mut self, value : &'a dyn SFTPClientErrorEvent);
...
}
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.
on_external_sign event (SFTPClient Struct)
Handles remote or external signing initiated by the SignExternal method or other source.
Syntax
// SFTPClientExternalSignEventArgs carries the SFTPClient ExternalSign event's parameters.
pub struct SFTPClientExternalSignEventArgs {
fn operation_id(&self) -> &String
fn hash_algorithm(&self) -> &String
fn pars(&self) -> &String
fn data(&self) -> &String
fn signed_data(&self) -> &String
fn set_signed_data(&self, value : &str)
fn set_signed_data_ref(&self, value : &String)
}
// SFTPClientExternalSignEvent defines the signature of the SFTPClient ExternalSign event's handler function.
pub trait SFTPClientExternalSignEvent {
fn on_external_sign(&self, sender : SFTPClient, e : &mut SFTPClientExternalSignEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_external_sign(&self) -> &'a dyn SFTPClientExternalSignEvent;
pub fn set_on_external_sign(&mut self, value : &'a dyn SFTPClientExternalSignEvent);
...
}
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 struct via the SignedData parameter.
OperationId provides a comment about the operation and its origin. It depends on the exact struct being used, and may be empty. HashAlgorithm specifies the hash algorithm being used for the operation, and Pars contains algorithm-dependent parameters.
The struct 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();
};
on_file_name_change_needed event (SFTPClient Struct)
Asks the application for a new file name.
Syntax
// SFTPClientFileNameChangeNeededEventArgs carries the SFTPClient FileNameChangeNeeded event's parameters.
pub struct SFTPClientFileNameChangeNeededEventArgs {
fn file_name(&self) -> &String
fn set_file_name(&self, value : &str)
fn set_file_name_ref(&self, value : &String)
fn force(&self) -> bool
fn set_force(&self, value : bool)
}
// SFTPClientFileNameChangeNeededEvent defines the signature of the SFTPClient FileNameChangeNeeded event's handler function.
pub trait SFTPClientFileNameChangeNeededEvent {
fn on_file_name_change_needed(&self, sender : SFTPClient, e : &mut SFTPClientFileNameChangeNeededEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_file_name_change_needed(&self) -> &'a dyn SFTPClientFileNameChangeNeededEvent;
pub fn set_on_file_name_change_needed(&mut self, value : &'a dyn SFTPClientFileNameChangeNeededEvent);
...
}
Remarks
The component uses this event to ask the application for a new file name in the case of a name conflict. Adjust the FileName as required to avoid the conflict, or set Force to true to go ahead with the current name (possibly overwriting an existing file).
on_file_operation event (SFTPClient Struct)
Signifies the start of a file transfer operation.
Syntax
// SFTPClientFileOperationEventArgs carries the SFTPClient FileOperation event's parameters.
pub struct SFTPClientFileOperationEventArgs {
fn operation(&self) -> i32
fn remote_path(&self) -> &String
fn local_path(&self) -> &String
fn skip(&self) -> bool
fn set_skip(&self, value : bool)
fn cancel(&self) -> bool
fn set_cancel(&self, value : bool)
}
// SFTPClientFileOperationEvent defines the signature of the SFTPClient FileOperation event's handler function.
pub trait SFTPClientFileOperationEvent {
fn on_file_operation(&self, sender : SFTPClient, e : &mut SFTPClientFileOperationEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_file_operation(&self) -> &'a dyn SFTPClientFileOperationEvent;
pub fn set_on_file_operation(&mut self, value : &'a dyn SFTPClientFileOperationEvent);
...
}
Remarks
This event is fired each time the struct 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:
| cffoDownloadFile | 0 | Download file |
| cffoUploadFile | 1 | Upload file |
| cffoDeleteFile | 2 | Delete file |
| cffoMakeDir | 3 | Make directory |
on_file_operation_result event (SFTPClient Struct)
Signifies the completion of a file transfer operation.
Syntax
// SFTPClientFileOperationResultEventArgs carries the SFTPClient FileOperationResult event's parameters.
pub struct SFTPClientFileOperationResultEventArgs {
fn operation(&self) -> i32
fn remote_path(&self) -> &String
fn local_path(&self) -> &String
fn error_code(&self) -> i32
fn comment(&self) -> &String
fn cancel(&self) -> bool
fn set_cancel(&self, value : bool)
}
// SFTPClientFileOperationResultEvent defines the signature of the SFTPClient FileOperationResult event's handler function.
pub trait SFTPClientFileOperationResultEvent {
fn on_file_operation_result(&self, sender : SFTPClient, e : &mut SFTPClientFileOperationResultEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_file_operation_result(&self) -> &'a dyn SFTPClientFileOperationResultEvent;
pub fn set_on_file_operation_result(&mut self, value : &'a dyn SFTPClientFileOperationResultEvent);
...
}
Remarks
This event is fired each time the struct 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:
| cffoDownloadFile | 0 | Download file |
| cffoUploadFile | 1 | Upload file |
| cffoDeleteFile | 2 | Delete file |
| cffoMakeDir | 3 | Make directory |
on_known_key_received event (SFTPClient Struct)
Signals that the server has introduced itself with a known key.
Syntax
// SFTPClientKnownKeyReceivedEventArgs carries the SFTPClient KnownKeyReceived event's parameters.
pub struct SFTPClientKnownKeyReceivedEventArgs {
fn algorithm(&self) -> &String
fn bits(&self) -> i32
fn fingerprint_sha256(&self) -> &String
}
// SFTPClientKnownKeyReceivedEvent defines the signature of the SFTPClient KnownKeyReceived event's handler function.
pub trait SFTPClientKnownKeyReceivedEvent {
fn on_known_key_received(&self, sender : SFTPClient, e : &mut SFTPClientKnownKeyReceivedEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_known_key_received(&self) -> &'a dyn SFTPClientKnownKeyReceivedEvent;
pub fn set_on_known_key_received(&mut self, value : &'a dyn SFTPClientKnownKeyReceivedEvent);
...
}
Remarks
The struct fires this event to tell the application that the server has introduced itself with a known key from trusted_keys_file.
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 server_key to access more key details.
on_list_entry event (SFTPClient Struct)
Reports a directory listing entry to the application.
Syntax
// SFTPClientListEntryEventArgs carries the SFTPClient ListEntry event's parameters.
pub struct SFTPClientListEntryEventArgs {
fn file_name(&self) -> &String
}
// SFTPClientListEntryEvent defines the signature of the SFTPClient ListEntry event's handler function.
pub trait SFTPClientListEntryEvent {
fn on_list_entry(&self, sender : SFTPClient, e : &mut SFTPClientListEntryEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_list_entry(&self) -> &'a dyn SFTPClientListEntryEvent;
pub fn set_on_list_entry(&mut self, value : &'a dyn SFTPClientListEntryEvent);
...
}
Remarks
The struct fires this event to report a directory listing entry to the application. FileName contains the entry name.
Use current_list_entry to access the details of the entry.
on_notification event (SFTPClient Struct)
This event notifies the application about an underlying control flow event.
Syntax
// SFTPClientNotificationEventArgs carries the SFTPClient Notification event's parameters.
pub struct SFTPClientNotificationEventArgs {
fn event_id(&self) -> &String
fn event_param(&self) -> &String
}
// SFTPClientNotificationEvent defines the signature of the SFTPClient Notification event's handler function.
pub trait SFTPClientNotificationEvent {
fn on_notification(&self, sender : SFTPClient, e : &mut SFTPClientNotificationEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_notification(&self) -> &'a dyn SFTPClientNotificationEvent;
pub fn set_on_notification(&mut self, value : &'a dyn SFTPClientNotificationEvent);
...
}
Remarks
The struct fires this event to let the application know about some event, occurrence, or milestone in the struct. 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 struct, the exact action it is performing, or the document being processed, one or both may be omitted.
on_password_change_request event (SFTPClient Struct)
Signals that the server requests a password change.
Syntax
// SFTPClientPasswordChangeRequestEventArgs carries the SFTPClient PasswordChangeRequest event's parameters.
pub struct SFTPClientPasswordChangeRequestEventArgs {
fn prompt(&self) -> &String
fn new_password(&self) -> &String
fn set_new_password(&self, value : &str)
fn set_new_password_ref(&self, value : &String)
fn cancel(&self) -> bool
fn set_cancel(&self, value : bool)
}
// SFTPClientPasswordChangeRequestEvent defines the signature of the SFTPClient PasswordChangeRequest event's handler function.
pub trait SFTPClientPasswordChangeRequestEvent {
fn on_password_change_request(&self, sender : SFTPClient, e : &mut SFTPClientPasswordChangeRequestEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_password_change_request(&self) -> &'a dyn SFTPClientPasswordChangeRequestEvent;
pub fn set_on_password_change_request(&mut self, value : &'a dyn SFTPClientPasswordChangeRequestEvent);
...
}
Remarks
The struct fires this event to pass the password change request from the server to the application. This event is fired during the SSH handshake.
on_private_key_needed event (SFTPClient Struct)
Asks the application for the client's private key.
Syntax
// SFTPClientPrivateKeyNeededEventArgs carries the SFTPClient PrivateKeyNeeded event's parameters.
pub struct SFTPClientPrivateKeyNeededEventArgs {
fn skip(&self) -> bool
fn set_skip(&self, value : bool)
}
// SFTPClientPrivateKeyNeededEvent defines the signature of the SFTPClient PrivateKeyNeeded event's handler function.
pub trait SFTPClientPrivateKeyNeededEvent {
fn on_private_key_needed(&self, sender : SFTPClient, e : &mut SFTPClientPrivateKeyNeededEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_private_key_needed(&self) -> &'a dyn SFTPClientPrivateKeyNeededEvent;
pub fn set_on_private_key_needed(&mut self, value : &'a dyn SFTPClientPrivateKeyNeededEvent);
...
}
Remarks
The struct 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.
on_progress event (SFTPClient Struct)
Fires periodically during the data transfer.
Syntax
// SFTPClientProgressEventArgs carries the SFTPClient Progress event's parameters.
pub struct SFTPClientProgressEventArgs {
fn total(&self) -> i64
fn current(&self) -> i64
fn cancel(&self) -> bool
fn set_cancel(&self, value : bool)
}
// SFTPClientProgressEvent defines the signature of the SFTPClient Progress event's handler function.
pub trait SFTPClientProgressEvent {
fn on_progress(&self, sender : SFTPClient, e : &mut SFTPClientProgressEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_progress(&self) -> &'a dyn SFTPClientProgressEvent;
pub fn set_on_progress(&mut self, value : &'a dyn SFTPClientProgressEvent);
...
}
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.
on_unknown_key_received event (SFTPClient Struct)
Signals that the server has introduced itself with an unknown key.
Syntax
// SFTPClientUnknownKeyReceivedEventArgs carries the SFTPClient UnknownKeyReceived event's parameters.
pub struct SFTPClientUnknownKeyReceivedEventArgs {
fn algorithm(&self) -> &String
fn bits(&self) -> i32
fn fingerprint_sha256(&self) -> &String
fn action(&self) -> i32
fn set_action(&self, value : i32)
}
// SFTPClientUnknownKeyReceivedEvent defines the signature of the SFTPClient UnknownKeyReceived event's handler function.
pub trait SFTPClientUnknownKeyReceivedEvent {
fn on_unknown_key_received(&self, sender : SFTPClient, e : &mut SFTPClientUnknownKeyReceivedEventArgs);
}
impl <'a> SFTPClient<'a> {
pub fn on_unknown_key_received(&self) -> &'a dyn SFTPClientUnknownKeyReceivedEvent;
pub fn set_on_unknown_key_received(&mut self, value : &'a dyn SFTPClientUnknownKeyReceivedEvent);
...
}
Remarks
The struct fires this event to tell the application that the server has introduced itself with a key not present in trusted_keys_file.
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 struct what it should do with the key:
| catAcceptOnce | 1 | Accept the key for the current session only. |
| catAcceptPermanently | 2 | Accept the key for the current session and store the key to the trusted keys list. |
| catReject | 3 | Reject the key and close the connection. |
Config Settings (SFTPClient Struct)
The struct 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 struct, access to these internal properties is provided through the config method.SFTPClient Config Settings
The following values are supported:
- 0 (the default setting) - no post-transfer action.
- 1 - delete each file immediately after it has been transferred to the destination system.
- 2 - delete all the original files after all the files have been transferred to the destination system.
In the former case, each file is deleted right after it has been transferred, independently of the outcome of transfer of other items in the batch.
Note that this setting only applies to batch (multi-file_ transfers. It has no effect on single-file transfers.
Since both client and server must implement strict key exchange to effectively mitigate the Terrapin attack, the struct provides options to further control the behavior in different scenarios. Possible values for this setting are:
| 0 | Disabled. Strict key exchange is not supported in the struct. |
| 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. |
| 2 | Enabled, 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. |
| 3 | Required. If the remote host does not support strict key exchange the connection will fail. |
Base Config Settings
You can switch this property off to improve performance if your project only uses known, good private keys.
Supported values are:
| off | No caching (default) | |
| local | Local caching | |
| global | Global caching |
This setting only applies to sessions negotiated with TLS version 1.3.
Supported Values:
| auto | Use hardware cryptography if available; otherwise, fall back to software-based cryptography (default). |
| enable | Always attempt to use hardware cryptography. If unavailable, exception will be thrown. |
| disable | Do not use hardware cryptography. |
Supported values are:
| file | File | |
| console | Console | |
| systemlog | System Log (supported for Android only) | |
| debugger | Debugger (supported for VCL for Windows and .Net) |
Supported values are:
| time | Current time | |
| level | Level | |
| package | Package name | |
| module | Module name | |
| class | Class name | |
| method | Method name | |
| threadid | Thread Id | |
| contenttype | Content type | |
| content | Content | |
| all | All details |
Supported filter names are:
| exclude-package | Exclude a package specified in the value | |
| exclude-module | Exclude a module specified in the value | |
| exclude-class | Exclude a class specified in the value | |
| exclude-method | Exclude a method specified in the value | |
| include-package | Include a package specified in the value | |
| include-module | Include a module specified in the value | |
| include-class | Include a class specified in the value | |
| include-method | Include a method specified in the value |
| none | No flush (caching only) | |
| immediate | Immediate flush (real-time logging) | |
| maxcount | Flush cached entries upon reaching LogMaxEventCount entries in the cache. |
Supported values are:
| none | None (by default) | |
| fatal | Severe errors that cause premature termination. | |
| error | Other runtime errors or unexpected conditions. | |
| warning | Use of deprecated APIs, poor use of API, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong". | |
| info | Interesting runtime events (startup/shutdown). | |
| debug | Detailed information on flow of through the system. | |
| trace | More detailed information. |
The default value of this setting is 100.
| none | No rotation | |
| deleteolder | Delete older entries from the cache upon reaching LogMaxEventCount | |
| keepolder | Keep older entries in the cache upon reaching LogMaxEventCount (newer entries are discarded) |
Supported Values:
| certificate | Enables caching of certificates. |
| crl | Enables caching of Certificate Revocation Lists (CRLs). |
| ocsp | Enables caching of OCSP (Online Certificate Status Protocol) responses. |
Example (default value):
PKICache=certificate,crl,ocsp
In this example, the component caches certificates, CRLs, and OCSP responses.
The default value is an empty string - no cached PKI data is stored on disk.
Example:
PKICachePath=C:\Temp\cache
In this example, the cached PKI data is stored in the C:\Temp\cache directory.
Supported values are:
| none | No static DNS rules (default) | |
| local | Local static DNS rules | |
| global | Global static DNS rules |
This setting only applies to certificates originating from a Windows system store.
The property accepts comma-separated values where the first descriptor name is used when the OID is mapped, and subsequent values act as aliases for parsing.
Syntax:
Config("XMLRDNDescriptorName[OID]=PrimaryName,Alias1,Alias2");
Where:
OID: The Object Identifier from the certificate's IssuerRDN or SubjectRDN that you want to map.
PrimaryName: The main descriptor name used in the XML signature when the OID is encountered.
Alias1, Alias2, ...: Optional alternative names recognized during parsing.
Usage Examples:
Map OID 2.5.4.5 to SERIALNUMBER:
Config("XMLRDNDescriptorName[2.5.4.5]=SERIALNUMBER");
Map OID 1.2.840.113549.1.9.1 to E, with aliases EMAIL and EMAILADDRESS:
Config("XMLRDNDescriptorName[1.2.840.113549.1.9.1]=E,EMAIL,EMAILADDRESS");
Trappable Errors (SFTPClient Struct)
SFTPClient Errors
| 1048577 | Invalid parameter (SB_ERROR_INVALID_PARAMETER) |
| 1048578 | Invalid configuration (SB_ERROR_INVALID_SETUP) |
| 1048579 | Invalid state (SB_ERROR_INVALID_STATE) |
| 1048580 | Invalid value (SB_ERROR_INVALID_VALUE) |
| 1048581 | Private key not found (SB_ERROR_NO_PRIVATE_KEY) |
| 1048582 | Cancelled by the user (SB_ERROR_CANCELLED_BY_USER) |
| 1048583 | The file was not found (SB_ERROR_NO_SUCH_FILE) |
| 1048584 | Unsupported feature or operation (SB_ERROR_UNSUPPORTED_FEATURE) |
| 1048585 | General error (SB_ERROR_GENERAL_ERROR) |
| 31457281 | Unsupported file operation (SB_ERROR_SFTP_UNSUPPORTED_FILE_OPERATION) |
| 31457282 | Invalid authentication type (SB_ERROR_SFTP_INVALID_AUTH_TYPE) |