# Struct secureblackbox::SFTPServer

The SFTPServer struct provides server-side functionality for SFTP connections.

## Syntax

```text
secureblackbox::SFTPServer
```

## Remarks

SFTPServer is an implementation for SSH File Transfer Protocol server. It works over a secure SSH channel, and should not be confused with the FTP/FTPS protocol.

### 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 SFTPServer struct cannot be disposed of automatically. Please, call the *dispose(&mut; self)* method of SFTPServer 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.*

|  |  |
| --- | --- |
| [active](#active-property-sftpserver-struct) | Specifies whether the SFTP server has started and ready to accept connections. |
| [auth_types](#auth_types-property-sftpserver-struct) | Defines allowed authentication types. |
| [base_dir](#base_dir-property-sftpserver-struct) | Specifies the server's base (root) directory. |
| [capabilities](#capabilities-property-sftpserver-struct) | Specifies which elements of the SSH ecosystem the struct must support/enable. |
| [client_file_entry_access_time](#client_file_entry_access_time-property-sftpserver-struct) | Contains the last access time for this file, in UTC. |
| [client_file_entry_creation_time](#client_file_entry_creation_time-property-sftpserver-struct) | Contains this file's creation time, in UTC. |
| [client_file_entry_entry_format](#client_file_entry_entry_format-property-sftpserver-struct) | The file listing format: cfefUnknown 0 cfefUnix 1 cfefWindows 2 cfefMLSD 3 . |
| [client_file_entry_file_type](#client_file_entry_file_type-property-sftpserver-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 . |
| [client_file_entry_handle](#client_file_entry_handle-property-sftpserver-struct) | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| [client_file_entry_modification_time](#client_file_entry_modification_time-property-sftpserver-struct) | File last modification date/time. |
| [client_file_entry_name](#client_file_entry_name-property-sftpserver-struct) | The file or directory name. |
| [client_file_entry_path](#client_file_entry_path-property-sftpserver-struct) | The full path to the file or directory. |
| [client_file_entry_principal](#client_file_entry_principal-property-sftpserver-struct) | Specifies the owner of the file/directory. |
| [client_file_entry_size](#client_file_entry_size-property-sftpserver-struct) | File size in bytes. |
| [client_file_entry_unix_perms](#client_file_entry_unix_perms-property-sftpserver-struct) | The file Unix permissions bit mask (e. |
| [client_file_entry_unparsed_name](#client_file_entry_unparsed_name-property-sftpserver-struct) | The unparsed entry as returned by the server. |
| [client_key_fingerprint_sha1](#client_key_fingerprint_sha1-property-sftpserver-struct) | Contains the SHA-1 fingerprint (hash) of the key. |
| [client_key_fingerprint_sha256](#client_key_fingerprint_sha256-property-sftpserver-struct) | Contains the SHA-256 fingerprint (hash) of the key. |
| [client_key_handle](#client_key_handle-property-sftpserver-struct) | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| [compression_level](#compression_level-property-sftpserver-struct) | Specifies the preferable compression level. |
| [external_crypto_async_document_id](#external_crypto_async_document_id-property-sftpserver-struct) | Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls. |
| [external_crypto_custom_params](#external_crypto_custom_params-property-sftpserver-struct) | Custom parameters to be passed to the signing service (uninterpreted). |
| [external_crypto_data](#external_crypto_data-property-sftpserver-struct) | Additional data to be included in the async state and mirrored back by the requestor. |
| [external_crypto_external_hash_calculation](#external_crypto_external_hash_calculation-property-sftpserver-struct) | Specifies whether the message hash is to be calculated at the external endpoint. |
| [external_crypto_hash_algorithm](#external_crypto_hash_algorithm-property-sftpserver-struct) | Specifies the request's signature hash algorithm. |
| [external_crypto_key_id](#external_crypto_key_id-property-sftpserver-struct) | The ID of the pre-shared key used for DC request authentication. |
| [external_crypto_key_secret](#external_crypto_key_secret-property-sftpserver-struct) | The pre-shared key used for DC request authentication. |
| [external_crypto_method](#external_crypto_method-property-sftpserver-struct) | Specifies the asynchronous signing method. |
| [external_crypto_mode](#external_crypto_mode-property-sftpserver-struct) | Specifies the external cryptography mode. |
| [external_crypto_public_key_algorithm](#external_crypto_public_key_algorithm-property-sftpserver-struct) | Provide the public key algorithm here if the certificate is not available on the pre-signing stage. |
| [fips_mode](#fips_mode-property-sftpserver-struct) | Reserved. |
| [force_compression](#force_compression-property-sftpserver-struct) | This property specifies whether server explicitly requires data compression. |
| [host](#host-property-sftpserver-struct) | Specifies server's host name. |
| [max_sftp_version](#max_sftp_version-property-sftpserver-struct) | Maximum SFTP version supported. |
| [min_sftp_version](#min_sftp_version-property-sftpserver-struct) | Minimum SFTP version supported. |
| [pinned_client_client_key_algorithm](#pinned_client_client_key_algorithm-property-sftpserver-struct) | Specifies the client's key algorithm. |
| [pinned_client_client_key_bits](#pinned_client_client_key_bits-property-sftpserver-struct) | Specifies the length of the client's key. |
| [pinned_client_client_key_fingerprint](#pinned_client_client_key_fingerprint-property-sftpserver-struct) | The fingerprint (hash value) of the client's public key. |
| [pinned_client_close_reason](#pinned_client_close_reason-property-sftpserver-struct) | Contains the line sent by the server just before closing the connection. |
| [pinned_client_compression_algorithm_inbound](#pinned_client_compression_algorithm_inbound-property-sftpserver-struct) | Compression algorithm for the incoming traffic. |
| [pinned_client_compression_algorithm_outbound](#pinned_client_compression_algorithm_outbound-property-sftpserver-struct) | Compression algorithm for the outgoing traffic. |
| [pinned_client_encryption_algorithm_inbound](#pinned_client_encryption_algorithm_inbound-property-sftpserver-struct) | Encryption algorithm for the incoming traffic. |
| [pinned_client_encryption_algorithm_outbound](#pinned_client_encryption_algorithm_outbound-property-sftpserver-struct) | Encryption algorithm for the outgoing traffic. |
| [pinned_client_inbound_encryption_key_bits](#pinned_client_inbound_encryption_key_bits-property-sftpserver-struct) | Specifies the length of the key used to encrypt the incoming traffic. |
| [pinned_client_kex_algorithm](#pinned_client_kex_algorithm-property-sftpserver-struct) | The key exchange algorithm used during the SSH handshake. |
| [pinned_client_kex_bits](#pinned_client_kex_bits-property-sftpserver-struct) | The number of bits used by the key exchange algorithm. |
| [pinned_client_kex_lines](#pinned_client_kex_lines-property-sftpserver-struct) | The contents of the received KexInit packet. |
| [pinned_client_mac_algorithm_inbound](#pinned_client_mac_algorithm_inbound-property-sftpserver-struct) | MAC algorithm used for the incoming connection. |
| [pinned_client_mac_algorithm_outbound](#pinned_client_mac_algorithm_outbound-property-sftpserver-struct) | MAC algorithm used for outbound connection. |
| [pinned_client_outbound_encryption_key_bits](#pinned_client_outbound_encryption_key_bits-property-sftpserver-struct) | Specifies the length of the key used to encrypt the outgoing traffic. |
| [pinned_client_public_key_algorithm](#pinned_client_public_key_algorithm-property-sftpserver-struct) | Specifies the public key algorithm which was used during the SSH handshake. |
| [pinned_client_remote_address](#pinned_client_remote_address-property-sftpserver-struct) | The client's IP address. |
| [pinned_client_remote_port](#pinned_client_remote_port-property-sftpserver-struct) | The remote port of the client connection. |
| [pinned_client_remote_software_name](#pinned_client_remote_software_name-property-sftpserver-struct) | Returns the name (self-advertised) of the SSH software running on the other side. |
| [pinned_client_server_key_algorithm](#pinned_client_server_key_algorithm-property-sftpserver-struct) | Specifies the server's key algorithm. |
| [pinned_client_server_key_bits](#pinned_client_server_key_bits-property-sftpserver-struct) | Specifies the number of bits in the server's key. |
| [pinned_client_server_key_fingerprint](#pinned_client_server_key_fingerprint-property-sftpserver-struct) | The fingerprint (hash value) of the server's public key. |
| [pinned_client_total_bytes_received](#pinned_client_total_bytes_received-property-sftpserver-struct) | Returns the total number of bytes received over this connection. |
| [pinned_client_total_bytes_sent](#pinned_client_total_bytes_sent-property-sftpserver-struct) | Returns the total number of bytes sent over this connection. |
| [pinned_client_version](#pinned_client_version-property-sftpserver-struct) | Specifies SSH protocol version. |
| [port](#port-property-sftpserver-struct) | Specifies the listening port number. |
| [read_only](#read_only-property-sftpserver-struct) | Specifies whether files on the server are read-only. |
| [server_key_count](#server_key_count-property-sftpserver-struct) | The number of records in the ServerKey arrays. |
| [server_key_algorithm](#server_key_algorithm-property-sftpserver-struct) | Specifies the key algorithm. |
| [server_key_bits](#server_key_bits-property-sftpserver-struct) | The number of bits in the key: the more the better, 2048 or 4096 are typical values. |
| [server_key_fingerprint_md5](#server_key_fingerprint_md5-property-sftpserver-struct) | Contains the MD5 fingerprint (hash) of the key. |
| [server_key_fingerprint_sha1](#server_key_fingerprint_sha1-property-sftpserver-struct) | Contains the SHA-1 fingerprint (hash) of the key. |
| [server_key_handle](#server_key_handle-property-sftpserver-struct) | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| [socket_incoming_speed_limit](#socket_incoming_speed_limit-property-sftpserver-struct) | The maximum number of bytes to read from the socket, per second. |
| [socket_local_address](#socket_local_address-property-sftpserver-struct) | The local network interface to bind the socket to. |
| [socket_local_port](#socket_local_port-property-sftpserver-struct) | The local port number to bind the socket to. |
| [socket_outgoing_speed_limit](#socket_outgoing_speed_limit-property-sftpserver-struct) | The maximum number of bytes to write to the socket, per second. |
| [socket_timeout](#socket_timeout-property-sftpserver-struct) | The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful. |
| [socket_use_ipv6](#socket_use_ipv6-property-sftpserver-struct) | Enables or disables IP protocol version 6. |
| [ssh_settings_auto_adjust_ciphers](#ssh_settings_auto_adjust_ciphers-property-sftpserver-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. |
| [ssh_settings_base_configuration](#ssh_settings_base_configuration-property-sftpserver-struct) | Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility. |
| [ssh_settings_compression_algorithms](#ssh_settings_compression_algorithms-property-sftpserver-struct) | A list of session compression algorithms separated with commas or semicolons. |
| [ssh_settings_compression_level](#ssh_settings_compression_level-property-sftpserver-struct) | Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression). |
| [ssh_settings_default_window_size](#ssh_settings_default_window_size-property-sftpserver-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. |
| [ssh_settings_encryption_algorithms](#ssh_settings_encryption_algorithms-property-sftpserver-struct) | A list of session encryption algorithms separated with commas or semicolons. |
| [ssh_settings_force_compression](#ssh_settings_force_compression-property-sftpserver-struct) | Whether the SSH client should explicitly request compression. |
| [ssh_settings_forward_auth_agent](#ssh_settings_forward_auth_agent-property-sftpserver-struct) | Enables or disables auth agent forwarding. |
| [ssh_settings_gss_auth_types](#ssh_settings_gss_auth_types-property-sftpserver-struct) | A comma-separated list of authentication types. |
| [ssh_settings_gss_delegate_creds](#ssh_settings_gss_delegate_creds-property-sftpserver-struct) | Switches credential delegation on or off. |
| [ssh_settings_gss_hostname](#ssh_settings_gss_hostname-property-sftpserver-struct) | The GSS host name, in form of a FQDN (e. |
| [ssh_settings_gss_lib](#ssh_settings_gss_lib-property-sftpserver-struct) | A path to the GSS-API library (DLL or SO). |
| [ssh_settings_gss_mechanisms](#ssh_settings_gss_mechanisms-property-sftpserver-struct) | A comma-separated list of GSS mechanisms to use. |
| [ssh_settings_gss_protocols](#ssh_settings_gss_protocols-property-sftpserver-struct) | A comma-separated list of SSPI protocols. |
| [ssh_settings_handshake_timeout](#ssh_settings_handshake_timeout-property-sftpserver-struct) | Specifies the maximal time for the SSH handshake to proceed, in seconds. |
| [ssh_settings_kex_algorithms](#ssh_settings_kex_algorithms-property-sftpserver-struct) | A list of key exchange algorithms separated with commas or semicolons. |
| [ssh_settings_mac_algorithms](#ssh_settings_mac_algorithms-property-sftpserver-struct) | A list of MAC (for message authentication code ) algorithms separated with commas or semicolons. |
| [ssh_settings_max_ssh_packet_size](#ssh_settings_max_ssh_packet_size-property-sftpserver-struct) | Specifies the maximum length of one SSH packet in bytes. |
| [ssh_settings_min_window_size](#ssh_settings_min_window_size-property-sftpserver-struct) | Specifies the minimal internal window size. |
| [ssh_settings_obfuscate_handshake](#ssh_settings_obfuscate_handshake-property-sftpserver-struct) | Enables or disables handshake obfuscation. |
| [ssh_settings_obfuscation_password](#ssh_settings_obfuscation_password-property-sftpserver-struct) | Specifies the password used to encrypt the handshake when ObfuscateHandshake is set. |
| [ssh_settings_public_key_algorithms](#ssh_settings_public_key_algorithms-property-sftpserver-struct) | A list of public key algorithms separated with commas or semicolons. |
| [ssh_settings_request_password_change](#ssh_settings_request_password_change-property-sftpserver-struct) | Whether to request a password change when connecting. |
| [ssh_settings_software_name](#ssh_settings_software_name-property-sftpserver-struct) | The name to be used by the struct to identify itself. |
| [ssh_settings_trust_all_keys](#ssh_settings_trust_all_keys-property-sftpserver-struct) | Enables or disables explicit trust to all server keys. |
| [ssh_settings_use_auth_agent](#ssh_settings_use_auth_agent-property-sftpserver-struct) | Enables or disables the use of external key agent, such as Putty key agent. |
| [ssh_settings_versions](#ssh_settings_versions-property-sftpserver-struct) | Specifies enabled SSH protocol versions (1 or 2). |
| [user_count](#user_count-property-sftpserver-struct) | The number of records in the User arrays. |
| [user_associated_data](#user_associated_data-property-sftpserver-struct) | Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used. |
| [user_base_path](#user_base_path-property-sftpserver-struct) | Base path for this user in the server's file system. |
| [user_certificate](#user_certificate-property-sftpserver-struct) | Contains the user's certificate. |
| [user_data](#user_data-property-sftpserver-struct) | Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings. |
| [user_email](#user_email-property-sftpserver-struct) | The user's email address. |
| [user_handle](#user_handle-property-sftpserver-struct) | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| [user_hash_algorithm](#user_hash_algorithm-property-sftpserver-struct) | Specifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user. |
| [user_incoming_speed_limit](#user_incoming_speed_limit-property-sftpserver-struct) | Specifies the incoming speed limit for this user. |
| [user_otp_algorithm](#user_otp_algorithm-property-sftpserver-struct) | The algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP). |
| [user_otp_len](#user_otp_len-property-sftpserver-struct) | Specifies the length of the user's OTP password. |
| [user_otp_value](#user_otp_value-property-sftpserver-struct) | The user's time interval (TOTP) or Counter (HOTP). |
| [user_outgoing_speed_limit](#user_outgoing_speed_limit-property-sftpserver-struct) | Specifies the outgoing speed limit for this user. |
| [user_password](#user_password-property-sftpserver-struct) | The user's authentication password. |
| [user_shared_secret](#user_shared_secret-property-sftpserver-struct) | Contains the user's secret key, which is essentially a shared secret between the client and server. |
| [user_ssh_key](#user_ssh_key-property-sftpserver-struct) | Contains the user's SSH key. |
| [username](#username-property-sftpserver-struct) | The registered name (login) of the user. |
| [use_utf8](#use_utf8-property-sftpserver-struct) | Specifies whether UTF8 conversion is to be used when parsing file names. |

## Method List

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

|  |  |
| --- | --- |
| [cleanup](#cleanup-method-sftpserver-struct) | Cleans up the server environment by purging expired sessions and cleaning caches. |
| [config](#config-method-sftpserver-struct) | Sets or retrieves a configuration setting. |
| [do_action](#do_action-method-sftpserver-struct) | Performs an additional action. |
| [drop_client](#drop_client-method-sftpserver-struct) | Terminates a client connection. |
| [get_client_buffer](#get_client_buffer-method-sftpserver-struct) | Acquires a piece of operation data. |
| [get_client_file_entry](#get_client_file_entry-method-sftpserver-struct) | Acquires file entry details from the struct. |
| [list_clients](#list_clients-method-sftpserver-struct) | Enumerates the connected clients. |
| [pin_client](#pin_client-method-sftpserver-struct) | Takes a snapshot of the connection's properties. |
| [reset](#reset-method-sftpserver-struct) | Resets the struct settings. |
| [set_client_buffer](#set_client_buffer-method-sftpserver-struct) | Commits a data buffer to the server struct. |
| [set_client_file_entry](#set_client_file_entry-method-sftpserver-struct) | Commits the file entry details to the struct. |
| [start](#start-method-sftpserver-struct) | Starts SFTP server operation. |
| [stop](#stop-method-sftpserver-struct) | Stops SFTP 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_accept](#on_accept-event-sftpserver-struct) | This event is fired when new incoming connection is accepted. |
| [on_after_create_directory](#on_after_create_directory-event-sftpserver-struct) | This event indicates completion of directory creation request. |
| [on_after_remove](#on_after_remove-event-sftpserver-struct) | This event indicates completion of file removal request. |
| [on_after_rename_file](#on_after_rename_file-event-sftpserver-struct) | This event indicates completion of a file rename operation. |
| [on_after_request_attributes](#on_after_request_attributes-event-sftpserver-struct) | This event indicates completion of file attributes request. |
| [on_after_set_attributes](#on_after_set_attributes-event-sftpserver-struct) | This event indicates completion of a set attributes request. |
| [on_auth_attempt](#on_auth_attempt-event-sftpserver-struct) | Reports a user authentication attempt. |
| [on_auth_failed](#on_auth_failed-event-sftpserver-struct) | Reports user authentication failure. |
| [on_auth_password](#on_auth_password-event-sftpserver-struct) | This event is fired on password authentication attempt from a client. |
| [on_auth_public_key](#on_auth_public_key-event-sftpserver-struct) | This event is fired on public key authentication attempt from a client. |
| [on_auth_succeeded](#on_auth_succeeded-event-sftpserver-struct) | Reports a successful user authentication. |
| [on_before_create_directory](#on_before_create_directory-event-sftpserver-struct) | This event is fired when a client requests to create a directory. |
| [on_before_download_file](#on_before_download_file-event-sftpserver-struct) | This event is fired when a download file request is received. |
| [on_before_find](#on_before_find-event-sftpserver-struct) | This event is fired when a client requests to find files and folders in Path. |
| [on_before_open_client_forwarding](#on_before_open_client_forwarding-event-sftpserver-struct) | This event is fired when a client requests to set up client-side (local) forwarding channel. |
| [on_before_open_command](#on_before_open_command-event-sftpserver-struct) | This event is fired when a client requests a command channel. |
| [on_before_open_server_forwarding](#on_before_open_server_forwarding-event-sftpserver-struct) | This event is fired when the server has received an incoming connection and needs to set up server-side (remote) forwarding channel. |
| [on_before_open_shell](#on_before_open_shell-event-sftpserver-struct) | This event is fired when a client requests a shell channel. |
| [on_before_remove](#on_before_remove-event-sftpserver-struct) | This event is fired when a client requests to delete a file or directory. |
| [on_before_rename_file](#on_before_rename_file-event-sftpserver-struct) | This event is fired when a client requests to rename a file. |
| [on_before_request_attributes](#on_before_request_attributes-event-sftpserver-struct) | This event is fired when a client requests to get file attributes. |
| [on_before_set_attributes](#on_before_set_attributes-event-sftpserver-struct) | This event is fired when a client requests to set file attributes. |
| [on_before_upload_file](#on_before_upload_file-event-sftpserver-struct) | This event is fired when an upload file request is received. |
| [on_close_client_forwarding](#on_close_client_forwarding-event-sftpserver-struct) | This event is fired when a client has closed a previously opened forwarding channel. |
| [on_close_command](#on_close_command-event-sftpserver-struct) | This event is fired when a client has closed a previously opened SSH command channel. |
| [on_close_file](#on_close_file-event-sftpserver-struct) | This event instructs the application to close an opened file. |
| [on_close_server_forwarding](#on_close_server_forwarding-event-sftpserver-struct) | This event is fired when a client has closed a previously opened forwarding channel. |
| [on_close_shell](#on_close_shell-event-sftpserver-struct) | This event is fired when a client has closed a previously opened shell channel. |
| [on_connect](#on_connect-event-sftpserver-struct) | This event is fired when a remote connection has been established. |
| [on_create_directory](#on_create_directory-event-sftpserver-struct) | This event instructs the application to create a directory. |
| [on_disconnect](#on_disconnect-event-sftpserver-struct) | This event is fired when a client has disconnected. |
| [on_error](#on_error-event-sftpserver-struct) | Information about errors during data delivery. |
| [on_external_sign](#on_external_sign-event-sftpserver-struct) | Handles remote or external signing initiated by the server protocol. |
| [on_find_close](#on_find_close-event-sftpserver-struct) | This event signifies the completion of a custom file listing operation. |
| [on_find_first](#on_find_first-event-sftpserver-struct) | This event signifies the start of the custom file listing retrieval mechanism. |
| [on_find_next](#on_find_next-event-sftpserver-struct) | This event retrieves the next entry of a custom file listing. |
| [on_listening_started](#on_listening_started-event-sftpserver-struct) | Fires when the server has started accepting connections on a local port. |
| [on_listening_stopped](#on_listening_stopped-event-sftpserver-struct) | Fires when the server has stopped accepting connections on a local port. |
| [on_notification](#on_notification-event-sftpserver-struct) | This event notifies the application about an underlying control flow event. |
| [on_open_client_forwarding](#on_open_client_forwarding-event-sftpserver-struct) | This event is fired when a client opens a client-side (local) forwarding channel. |
| [on_open_command](#on_open_command-event-sftpserver-struct) | This event is fired when a client has opened an SSH command channel. |
| [on_open_file](#on_open_file-event-sftpserver-struct) | This event instructs the application to handle the file open request. |
| [on_open_server_forwarding](#on_open_server_forwarding-event-sftpserver-struct) | This event is fired when the server opens a server-side (remote) forwarding channel. |
| [on_open_shell](#on_open_shell-event-sftpserver-struct) | This event is fired when a client has opened a shell channel. |
| [on_read_file](#on_read_file-event-sftpserver-struct) | This event is fired when a file read request is received. |
| [on_remove](#on_remove-event-sftpserver-struct) | This event is fired when a client requests to delete a file or directory. |
| [on_rename_file](#on_rename_file-event-sftpserver-struct) | This event is fired when a client requests to rename a file. |
| [on_request_attributes](#on_request_attributes-event-sftpserver-struct) | This event is fired when a get file attributes request is received. |
| [on_server_forwarding_cancel](#on_server_forwarding_cancel-event-sftpserver-struct) | This event is fired when the client cancels a previously negotiated server-side (remote) forwarding. |
| [on_server_forwarding_open_failed](#on_server_forwarding_open_failed-event-sftpserver-struct) | This event is fired when the client rejects the server request to establish a server forwarding channel. |
| [on_server_forwarding_request](#on_server_forwarding_request-event-sftpserver-struct) | This event is fired when the client requests the server to set up server-side (remote) forwarding. |
| [on_session_closed](#on_session_closed-event-sftpserver-struct) | Reports session closure. |
| [on_session_established](#on_session_established-event-sftpserver-struct) | This event is fired when a new session is established. |
| [on_set_attributes](#on_set_attributes-event-sftpserver-struct) | This event is fired when an set file attributes request is received. |
| [on_translate_path](#on_translate_path-event-sftpserver-struct) | This event is fired when a client requests the server to translate a path to its absolute form. |
| [on_write_file](#on_write_file-event-sftpserver-struct) | This event is fired when a file write request is received. |

## Config Settings

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

|  |  |
| --- | --- |
| [AllAlgorithms](#AllAlgorithms) | Returns the list of algorithms enabled in the struct. |
| [AsyncDataWindowManagement](#AsyncDataWindowManagement) | TBD. |
| [AuthMode](#AuthMode) | Controls dual/multi-type authentication mode. |
| [AutoGenerateLongNames](#AutoGenerateLongNames) | TBD. |
| [Banner\[i\]](#Banner[i]) | TBD. |
| [BannerSendStage](#BannerSendStage) | TBD. |
| [CloseIfNoActiveTunnels](#CloseIfNoActiveTunnels) | TBD. |
| [CommandModeEnabled](#CommandModeEnabled) | TBD. |
| [CompressionAlgorithms](#CompressionAlgorithms) | Returns the list of compression algorithms enabled in the struct. |
| [CustomDHGroupIndex](#CustomDHGroupIndex) | Sets a specific Diffie-Hellman group index to enforce. |
| [DefBanner](#DefBanner) | TBD. |
| [DefLanguageTag](#DefLanguageTag) | TBD. |
| [DualStack](#DualStack) | Allows the use of ip4 and ip6 simultaneously. |
| [EncryptionAlgorithms](#EncryptionAlgorithms) | Returns the list of encryption algorithms enabled in the struct. |
| [KexAlgorithms](#KexAlgorithms) | Returns the list of key exchange algorithms enabled in the struct. |
| [LanguageTag\[i\]](#LanguageTag[i]) | TBD. |
| [MacAlgorithms](#MacAlgorithms) | Returns the list of MAC algorithms enabled in the struct. |
| [MaxDHGroupSize](#MaxDHGroupSize) | Sets the maximal Diffie-Hellman group size. |
| [MinDHGroupSize](#MinDHGroupSize) | Sets the minimal Diffie-Hellman group size. |
| [NotifyOnFileOperations](#NotifyOnFileOperations) | Enables low-level file operation notifications. |
| [PublicKeyAlgorithms](#PublicKeyAlgorithms) | Returns the list of public key algorithms enabled in the struct. |
| [RefreshUsers](#RefreshUsers) | Enables or disables real-time propagation of user information. |
| [SFTPModeEnabled](#SFTPModeEnabled) | TBD. |
| [ShellModeEnabled](#ShellModeEnabled) | TBD. |
| [UseStrictKeyExchange](#UseStrictKeyExchange) | Specifies how strict key exchange is supported. |
| [ASN1UseGlobalTagCache](#ASN1UseGlobalTagCache) | Controls whether ASN.1 module should use a global object cache. |
| [AssignSystemSmartCardPins](#AssignSystemSmartCardPins) | Specifies whether CSP-level PINs should be assigned to CNG keys. |
| [CheckKeyIntegrityBeforeUse](#CheckKeyIntegrityBeforeUse) | Enables or disable private key integrity check before use. |
| [CookieCaching](#CookieCaching) | Specifies whether a cookie cache should be used for HTTP(S) transports. |
| [Cookies](#Cookies) | Gets or sets local cookies for the struct. |
| [DefDeriveKeyIterations](#DefDeriveKeyIterations) | Specifies the default key derivation algorithm iteration count. |
| [DNSLocalSuffix](#DNSLocalSuffix) | The suffix to assign for TLD names. |
| [EnableClientSideSSLFFDHE](#EnableClientSideSSLFFDHE) | Enables or disables finite field DHE key exchange support in TLS clients. |
| [EnableSSHMLKEM](#EnableSSHMLKEM) | Enables support for ML-KEM/hybrid key exchange algorithms in SSH client and server structs. |
| [EnableTLSMLKEM](#EnableTLSMLKEM) | Enables support for ML-KEM and hybrid groups in TLS client and server structs. |
| [GlobalCookies](#GlobalCookies) | Gets or sets global cookies for all the HTTP transports. |
| [HardwareCryptoUsePolicy](#HardwareCryptoUsePolicy) | The hardware crypto usage policy. |
| [HttpUserAgent](#HttpUserAgent) | Specifies the user agent name to be used by all HTTP clients. |
| [HttpVersion](#HttpVersion) | The HTTP version to use in any inner HTTP client structs created. |
| [IgnoreExpiredMSCTLSigningCert](#IgnoreExpiredMSCTLSigningCert) | Whether to tolerate the expired Windows Update signing certificate. |
| [ListDelimiter](#ListDelimiter) | The delimiter character for multi-element lists. |
| [LogDestination](#LogDestination) | Specifies the debug log destination. |
| [LogDetails](#LogDetails) | Specifies the debug log details to dump. |
| [LogFile](#LogFile) | Specifies the debug log filename. |
| [LogFilters](#LogFilters) | Specifies the debug log filters. |
| [LogFlushMode](#LogFlushMode) | Specifies the log flush mode. |
| [LogLevel](#LogLevel) | Specifies the debug log level. |
| [LogMaxEventCount](#LogMaxEventCount) | Specifies the maximum number of events to cache before further action is taken. |
| [LogRotationMode](#LogRotationMode) | Specifies the log rotation mode. |
| [MaxASN1BufferLength](#MaxASN1BufferLength) | Specifies the maximal allowed length for ASN.1 primitive tag data. |
| [MaxASN1TreeDepth](#MaxASN1TreeDepth) | Specifies the maximal depth for processed ASN.1 trees. |
| [OCSPHashAlgorithm](#OCSPHashAlgorithm) | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
| [OldClientSideRSAFallback](#OldClientSideRSAFallback) | Specifies whether the SSH client should use a SHA1 fallback. |
| [PKICache](#PKICache) | Specifies which PKI elements (certificates, CRLs, OCSP responses) should be cached. |
| [PKICachePath](#PKICachePath) | Specifies the file system path where cached PKI data is stored. |
| [ProductVersion](#ProductVersion) | Returns the version of the SecureBlackbox library. |
| [ServerSSLDHKeyLength](#ServerSSLDHKeyLength) | Sets the size of the TLS DHE key exchange group. |
| [StaticDNS](#StaticDNS) | Specifies whether static DNS rules should be used. |
| [StaticIPAddress\[domain\]](#StaticIPAddress[domain]) | Gets or sets an IP address for the specified domain name. |
| [StaticIPAddresses](#StaticIPAddresses) | Gets or sets all the static DNS rules. |
| [Tag](#Tag) | Allows to store any custom data. |
| [TLSSessionGroup](#TLSSessionGroup) | Specifies the group name of TLS sessions to be used for session resumption. |
| [TLSSessionLifetime](#TLSSessionLifetime) | Specifies lifetime in seconds of the cached TLS session. |
| [TLSSessionPurgeInterval](#TLSSessionPurgeInterval) | Specifies how often the session cache should remove the expired TLS sessions. |
| [UseCRLObjectCaching](#UseCRLObjectCaching) | Specifies whether reuse of loaded CRL objects is enabled. |
| [UseInternalRandom](#UseInternalRandom) | Switches between SecureBlackbox-own and platform PRNGs. |
| [UseLegacyAdESValidation](#UseLegacyAdESValidation) | Enables legacy AdES validation mode. |
| [UseOCSPResponseObjectCaching](#UseOCSPResponseObjectCaching) | Specifies whether reuse of loaded OCSP response objects is enabled. |
| [UseOwnDNSResolver](#UseOwnDNSResolver) | Specifies whether the client structs should use own DNS resolver. |
| [UseSharedSystemStorages](#UseSharedSystemStorages) | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
| [UseSystemNativeSizeCalculation](#UseSystemNativeSizeCalculation) | An internal CryptoAPI access tweak. |
| [UseSystemOAEPAndPSS](#UseSystemOAEPAndPSS) | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
| [UseSystemRandom](#UseSystemRandom) | Enables or disables the use of the OS PRNG. |
| [XMLRDNDescriptorName\[OID\]](#XMLRDNDescriptorName[OID]) | Defines an OID mapping to descriptor names for the certificate's IssuerRDN or SubjectRDN. |
| [XMLRDNDescriptorPriority\[OID\]](#XMLRDNDescriptorPriority[OID]) | Specifies the priority of descriptor names associated with a specific OID. |
| [XMLRDNDescriptorReverseOrder](#XMLRDNDescriptorReverseOrder) | Specifies whether to reverse the order of descriptors in RDN. |
| [XMLRDNDescriptorSeparator](#XMLRDNDescriptorSeparator) | Specifies the separator used between descriptors in RDN. |

# active property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies whether the SFTP server has started and ready to accept connections.

## Syntax

*Rust Syntax*

```text
fn active(&self ) -> Result<bool, SecureBlackboxError>
```

## Default Value

false

## Remarks

Check this property to find out whether the SFTP server is in active mode. Use [start](#start-method-sftpserver-struct) and [stop](#stop-method-sftpserver-struct) methods to activate or deactivate the server.

This property is read-only.

## Data Type

bool

# auth_types property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Defines allowed authentication types.

## Syntax

*Rust Syntax*

```text
fn auth_types(&self ) -> Result<i32, SecureBlackboxError> fn set_auth_types(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

30

## Remarks

Use this property to define which authentication types are allowed on the server, set of

|  |  |  |
| --- | --- | --- |
| 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 |

## Data Type

i32

# base_dir property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the server's base (root) directory.

## Syntax

*Rust Syntax*

```text
fn base_dir(&self ) -> Result<String, SecureBlackboxError> fn set_base_dir(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_base_dir_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

Use this property to set the base (root) directory on the server.

NOTE: If this property is not specified, it will default to the root of the system drive (C:\ on Windows).

## Data Type

String

# capabilities property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies which elements of the SSH ecosystem the struct must support/enable.

## Syntax

*Rust Syntax*

```text
fn capabilities(&self ) -> Result<i32, SecureBlackboxError> fn set_capabilities(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

1

## Remarks

Use this property to specify the capabilities of the SSH framework the component must support by adjusting the following bit flags:

|  |  |  |
| --- | --- | --- |
| scSFTP | 0x01 | SFTP (secure file transfer) |
| scShell | 0x02 | Remote shell access |
| scCommand | 0x04 | Remote command execution |
| scClientForwarding | 0x08 | Local (client-side) forwarding |
| scServerForwarding | 0x10 | Remote (server-side) forwarding |

## Data Type

i32

# client_file_entry_access_time property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn client_file_entry_access_time(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_access_time(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_access_time_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

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

## Data Type

String

# client_file_entry_creation_time property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains this file's creation time, in UTC.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_creation_time(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_creation_time(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_creation_time_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

Contains this file's creation time, in UTC.

## Data Type

String

# client_file_entry_entry_format property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The file listing format: cfefUnknown 0 cfefUnix 1 cfefWindows 2 cfefMLSD 3 .

## Syntax

*Rust Syntax*

```text
fn client_file_entry_entry_format(&self ) -> Result<i32, SecureBlackboxError> fn set_client_file_entry_entry_format(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Possible Values

```text
0   // Unknown1   // Unix2   // Windows3   // MLSD
```

## Default Value

0

## Remarks

The file listing format:

|  |  |
| --- | --- |
| cfefUnknown | 0 |
| cfefUnix | 1 |
| cfefWindows | 2 |
| cfefMLSD | 3 |

## Data Type

i32

# client_file_entry_file_type property ([SFTPServer](#struct-secureblackboxsftpserver) 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

*Rust Syntax*

```text
fn client_file_entry_file_type(&self ) -> Result<i32, SecureBlackboxError> fn set_client_file_entry_file_type(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Possible Values

```text
0   // Unknown1   // Directory2   // File3   // Symlink4   // Special5   // CurrentDirectory6   // ParentDirectory7   // Socket8   // CharDevice9   // BlockDevice10   // 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 |

## Data Type

i32

# client_file_entry_handle property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Allows to get or set a 'handle', a unique identifier of the underlying property object.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_handle(&self ) -> Result<i64, SecureBlackboxError> fn set_client_file_entry_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.

```text
  pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
```

## Data Type

i64

# client_file_entry_modification_time property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

File last modification date/time.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_modification_time(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_modification_time(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_modification_time_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

File last modification date/time.

## Data Type

String

# client_file_entry_name property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The file or directory name.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_name(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_name(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_name_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

The file or directory name.

## Data Type

String

# client_file_entry_path property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The full path to the file or directory.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_path(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_path(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_path_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

The full path to the file or directory.

## Data Type

String

# client_file_entry_principal property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the owner of the file/directory.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_principal(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_principal(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_principal_ref(&self, value : &String) ->  Option<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.

## Data Type

String

# client_file_entry_size property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

File size in bytes.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_size(&self ) -> Result<i64, SecureBlackboxError> fn set_client_file_entry_size(&self, value : i64) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

File size in bytes.

## Data Type

i64

# client_file_entry_unix_perms property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The file Unix permissions bit mask (e.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_unix_perms(&self ) -> Result<i32, SecureBlackboxError> fn set_client_file_entry_unix_perms(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

511

## Remarks

The file Unix permissions bit mask (e.g. rwxrwxrwx=511 (0777); rwxr--r--=484 (0744)).

## Data Type

i32

# client_file_entry_unparsed_name property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The unparsed entry as returned by the server.

## Syntax

*Rust Syntax*

```text
fn client_file_entry_unparsed_name(&self ) -> Result<String, SecureBlackboxError> fn set_client_file_entry_unparsed_name(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_client_file_entry_unparsed_name_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

The unparsed entry as returned by the server. Sometimes this is also known as "long name".

## Data Type

String

# client_key_fingerprint_sha1 property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn client_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

# client_key_fingerprint_sha256 property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn client_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

# client_key_handle property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Allows to get or set a 'handle', a unique identifier of the underlying property object.

## Syntax

*Rust Syntax*

```text
fn client_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.

```text
  pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
```

This property is read-only.

## Data Type

i64

# compression_level property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the preferable compression level.

## Syntax

*Rust Syntax*

```text
fn compression_level(&self ) -> Result<i32, SecureBlackboxError> fn set_compression_level(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

9

## Remarks

Set this property before starting the server. Possible values range from 0 (lowest compression) to 9 (maximum compression). This property is ignored if compression wasn't accepted.

## Data Type

i32

# external_crypto_async_document_id property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies whether the message hash is to be calculated at the external endpoint.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the request's signature hash algorithm.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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](#external_crypto_key_secret-property-sftpserver-struct) 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:

```text
  signer.ExternalCrypto.KeyID = "MainSigningKey";
  signer.ExternalCrypto.KeySecret = "abcdef0123456789";
```

## Data Type

String

# external_crypto_key_secret property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The pre-shared key used for DC request authentication.

## Syntax

*Rust Syntax*

```text
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](#external_crypto_key_id-property-sftpserver-struct) topic.

## Data Type

String

# external_crypto_method property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the asynchronous signing method.

## Syntax

*Rust Syntax*

```text
fn external_crypto_method(&self ) -> Result<i32, SecureBlackboxError> fn set_external_crypto_method(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Possible Values

```text
0   // PKCS11   // 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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the external cryptography mode.

## Syntax

*Rust Syntax*

```text
fn external_crypto_mode(&self ) -> Result<i32, SecureBlackboxError> fn set_external_crypto_mode(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Possible Values

```text
0   // Default1   // Disabled2   // Generic3   // DCAuth4   // 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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Reserved.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This property specifies whether server explicitly requires data compression.

## Syntax

*Rust Syntax*

```text
fn force_compression(&self ) -> Result<bool, SecureBlackboxError> fn set_force_compression(&self, value : bool) ->  Option<SecureBlackboxError>
```

## Default Value

false

## Remarks

Set this property before starting the server. If it is set to true, the struct will explicitly request data compression. If it is set to False, the struct will support compression, although compression will be used only if the remote party doesn't support algorithms *without* compression.

## Data Type

bool

# host property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies server's host name.

## Syntax

*Rust Syntax*

```text
fn host(&self ) -> Result<String, SecureBlackboxError> fn set_host(&self, value : &str) ->  Option<SecureBlackboxError>
fn set_host_ref(&self, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

Use this property to set the host name for this server.

## Data Type

String

# max_sftp_version property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Maximum SFTP version supported.

## Syntax

*Rust Syntax*

```text
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](#min_sftp_version-property-sftpserver-struct) properties control the range of SFTP protocol versions supported by this server.

## Data Type

i32

# min_sftp_version property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Minimum SFTP version supported.

## Syntax

*Rust Syntax*

```text
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](#max_sftp_version-property-sftpserver-struct) and min_sftp_version properties control the range of SFTP protocol versions supported by this server.

## Data Type

i32

# pinned_client_client_key_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the client's key algorithm.

## Syntax

*Rust Syntax*

```text
fn pinned_client_client_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Specifies the client's key algorithm.

This property is read-only.

## Data Type

String

# pinned_client_client_key_bits property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the length of the client's key.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_client_key_fingerprint property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_close_reason property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains the line sent by the server just before closing the connection.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_compression_algorithm_inbound property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Compression algorithm for the incoming traffic.

## Syntax

*Rust Syntax*

```text
fn pinned_client_compression_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Compression algorithm for the incoming traffic.

This property is read-only.

## Data Type

String

# pinned_client_compression_algorithm_outbound property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Compression algorithm for the outgoing traffic.

## Syntax

*Rust Syntax*

```text
fn pinned_client_compression_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Compression algorithm for the outgoing traffic.

This property is read-only.

## Data Type

String

# pinned_client_encryption_algorithm_inbound property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Encryption algorithm for the incoming traffic.

## Syntax

*Rust Syntax*

```text
fn pinned_client_encryption_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Encryption algorithm for the incoming traffic.

This property is read-only.

## Data Type

String

# pinned_client_encryption_algorithm_outbound property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Encryption algorithm for the outgoing traffic.

## Syntax

*Rust Syntax*

```text
fn pinned_client_encryption_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Encryption algorithm for the outgoing traffic.

This property is read-only.

## Data Type

String

# pinned_client_inbound_encryption_key_bits property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_kex_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The key exchange algorithm used during the SSH handshake.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_kex_bits property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The number of bits used by the key exchange algorithm.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_kex_lines property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The contents of the received KexInit packet.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_mac_algorithm_inbound property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

MAC algorithm used for the incoming connection.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_mac_algorithm_outbound property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

MAC algorithm used for outbound connection.

## Syntax

*Rust Syntax*

```text
fn pinned_client_mac_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

MAC algorithm used for outbound connection.

This property is read-only.

## Data Type

String

# pinned_client_outbound_encryption_key_bits property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_public_key_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_remote_address property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The client's IP address.

## Syntax

*Rust Syntax*

```text
fn pinned_client_remote_address(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

The client's IP address.

This property is read-only.

## Data Type

String

# pinned_client_remote_port property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The remote port of the client connection.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_remote_software_name property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Returns the name (self-advertised) of the SSH software running on the other side.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_server_key_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the server's key algorithm.

## Syntax

*Rust Syntax*

```text
fn pinned_client_server_key_algorithm(&self ) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Specifies the server's key algorithm.

This property is read-only.

## Data Type

String

# pinned_client_server_key_bits property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_server_key_fingerprint property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_total_bytes_received property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Returns the total number of bytes received over this connection.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_total_bytes_sent property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Returns the total number of bytes sent over this connection.

## Syntax

*Rust Syntax*

```text
fn pinned_client_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

# pinned_client_version property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies SSH protocol version.

## Syntax

*Rust Syntax*

```text
fn pinned_client_version(&self ) -> Result<i32, SecureBlackboxError>
```

## Default Value

2

## Remarks

Specifies SSH protocol version.

This property is read-only.

## Data Type

i32

# port property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the listening port number.

## Syntax

*Rust Syntax*

```text
fn port(&self ) -> Result<i32, SecureBlackboxError> fn set_port(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

22

## Remarks

Use this property to specify on which port the struct will be listening to client connections.

## Data Type

i32

# read_only property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies whether files on the server are read-only.

## Syntax

*Rust Syntax*

```text
fn read_only(&self ) -> Result<bool, SecureBlackboxError> fn set_read_only(&self, value : bool) ->  Option<SecureBlackboxError>
```

## Default Value

false

## Remarks

Set this property to true to deny all client requests to change files on the server.

## Data Type

bool

# server_key_count property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The number of records in the ServerKey arrays.

## Syntax

*Rust Syntax*

```text
fn server_key_count(&self ) -> Result<i32, SecureBlackboxError> fn set_server_key_count(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

This property controls the size of the following arrays:

- [server_key_algorithm](#server_key_algorithm-property-sftpserver-struct)
- [server_key_bits](#server_key_bits-property-sftpserver-struct)
- [server_key_fingerprint_md5](#server_key_fingerprint_md5-property-sftpserver-struct)
- [server_key_fingerprint_sha1](#server_key_fingerprint_sha1-property-sftpserver-struct)
- [server_key_handle](#server_key_handle-property-sftpserver-struct)

The array indices start at *0* and end at *server_key_count - 1*.

## Data Type

i32

# server_key_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the key algorithm.

## Syntax

*Rust Syntax*

```text
fn server_key_algorithm(&self , ServerKeyIndex : i32) -> 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

The *ServerKeyIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [ServerKeyCount](#server_key_count-property-sftpserver-struct) property.

This property is read-only.

## Data Type

String

# server_key_bits property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn server_key_bits(&self , ServerKeyIndex : i32) -> Result<i32, SecureBlackboxError>
```

## Default Value

0

## Remarks

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

The *ServerKeyIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [ServerKeyCount](#server_key_count-property-sftpserver-struct) property.

This property is read-only.

## Data Type

i32

# server_key_fingerprint_md5 property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains the MD5 fingerprint (hash) of the key.

## Syntax

*Rust Syntax*

```text
fn server_key_fingerprint_md5(&self , ServerKeyIndex : i32) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

Contains the MD5 fingerprint (hash) of the key.

The *ServerKeyIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [ServerKeyCount](#server_key_count-property-sftpserver-struct) property.

This property is read-only.

## Data Type

String

# server_key_fingerprint_sha1 property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn server_key_fingerprint_sha1(&self , ServerKeyIndex : i32) -> Result<String, SecureBlackboxError>
```

## Default Value

""

## Remarks

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

The *ServerKeyIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [ServerKeyCount](#server_key_count-property-sftpserver-struct) property.

This property is read-only.

## Data Type

String

# server_key_handle property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Allows to get or set a 'handle', a unique identifier of the underlying property object.

## Syntax

*Rust Syntax*

```text
fn server_key_handle(&self , ServerKeyIndex : i32) -> Result<i64, SecureBlackboxError> fn set_server_key_handle(&self, ServerKeyIndex : i32, 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.

```text
  pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
```

The *ServerKeyIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [ServerKeyCount](#server_key_count-property-sftpserver-struct) property.

## Data Type

i64

# socket_incoming_speed_limit property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The local network interface to bind the socket to.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The local port number to bind the socket to.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Enables or disables IP protocol version 6.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) 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

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
fn ssh_settings_base_configuration(&self ) -> Result<i32, SecureBlackboxError> fn set_ssh_settings_base_configuration(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Possible Values

```text
0   // Default1   // Compatible2   // ComprehensiveInsecure3   // 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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A list of session compression algorithms separated with commas or semicolons.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) 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

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A list of session encryption algorithms separated with commas or semicolons.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Whether the SSH client should explicitly request compression.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Enables or disables auth agent forwarding.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A comma-separated list of authentication types.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Switches credential delegation on or off.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The GSS host name, in form of a FQDN (e.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A comma-separated list of GSS mechanisms to use.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A comma-separated list of SSPI protocols.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the maximal time for the SSH handshake to proceed, in seconds.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A list of key exchange algorithms separated with commas or semicolons.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A list of MAC (for message authentication code ) algorithms separated with commas or semicolons.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the maximum length of one SSH packet in bytes.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the minimal internal window size.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Enables or disables handshake obfuscation.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

A list of public key algorithms separated with commas or semicolons.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Whether to request a password change when connecting.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Enables or disables explicit trust to all server keys.

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies enabled SSH protocol versions (1 or 2).

## Syntax

*Rust Syntax*

```text
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

# user_count property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The number of records in the User arrays.

## Syntax

*Rust Syntax*

```text
fn user_count(&self ) -> Result<i32, SecureBlackboxError> fn set_user_count(&self, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

This property controls the size of the following arrays:

- [user_associated_data](#user_associated_data-property-sftpserver-struct)
- [user_base_path](#user_base_path-property-sftpserver-struct)
- [user_certificate](#user_certificate-property-sftpserver-struct)
- [user_data](#user_data-property-sftpserver-struct)
- [user_email](#user_email-property-sftpserver-struct)
- [user_handle](#user_handle-property-sftpserver-struct)
- [user_hash_algorithm](#user_hash_algorithm-property-sftpserver-struct)
- [user_incoming_speed_limit](#user_incoming_speed_limit-property-sftpserver-struct)
- [username](#username-property-sftpserver-struct)
- [user_otp_algorithm](#user_otp_algorithm-property-sftpserver-struct)
- [user_otp_len](#user_otp_len-property-sftpserver-struct)
- [user_otp_value](#user_otp_value-property-sftpserver-struct)
- [user_outgoing_speed_limit](#user_outgoing_speed_limit-property-sftpserver-struct)
- [user_password](#user_password-property-sftpserver-struct)
- [user_shared_secret](#user_shared_secret-property-sftpserver-struct)
- [user_ssh_key](#user_ssh_key-property-sftpserver-struct)

The array indices start at *0* and end at *user_count - 1*.

## Data Type

i32

# user_associated_data property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.

## Syntax

*Rust Syntax*

```text
fn user_associated_data(&self , UserIndex : i32) -> Result<Vec<u8>, SecureBlackboxError> fn set_user_associated_data(&self, UserIndex : i32, value : Vec<u8>) ->  Option<SecureBlackboxError>
fn set_user_associated_data_ref(&self, UserIndex : i32, value : &[u8]) ->  Option<SecureBlackboxError>
```

## Remarks

Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

Vec

# user_base_path property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Base path for this user in the server's file system.

## Syntax

*Rust Syntax*

```text
fn user_base_path(&self , UserIndex : i32) -> Result<String, SecureBlackboxError> fn set_user_base_path(&self, UserIndex : i32, value : &str) ->  Option<SecureBlackboxError>
fn set_user_base_path_ref(&self, UserIndex : i32, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

Base path for this user in the server's file system.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

String

# user_certificate property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains the user's certificate.

## Syntax

*Rust Syntax*

```text
fn user_certificate(&self , UserIndex : i32) -> Result<Vec<u8>, SecureBlackboxError> fn set_user_certificate(&self, UserIndex : i32, value : Vec<u8>) ->  Option<SecureBlackboxError>
fn set_user_certificate_ref(&self, UserIndex : i32, value : &[u8]) ->  Option<SecureBlackboxError>
```

## Remarks

Contains the user's certificate.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

Vec

# user_data property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.

## Syntax

*Rust Syntax*

```text
fn user_data(&self , UserIndex : i32) -> Result<String, SecureBlackboxError> fn set_user_data(&self, UserIndex : i32, value : &str) ->  Option<SecureBlackboxError>
fn set_user_data_ref(&self, UserIndex : i32, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

String

# user_email property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The user's email address.

## Syntax

*Rust Syntax*

```text
fn user_email(&self , UserIndex : i32) -> Result<String, SecureBlackboxError> fn set_user_email(&self, UserIndex : i32, value : &str) ->  Option<SecureBlackboxError>
fn set_user_email_ref(&self, UserIndex : i32, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

The user's email address.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

String

# user_handle property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Allows to get or set a 'handle', a unique identifier of the underlying property object.

## Syntax

*Rust Syntax*

```text
fn user_handle(&self , UserIndex : i32) -> Result<i64, SecureBlackboxError> fn set_user_handle(&self, UserIndex : i32, 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.

```text
  pdfSigner.setSigningCertHandle(certMgr.getCertHandle());
```

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

i64

# user_hash_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user.

## Syntax

*Rust Syntax*

```text
fn user_hash_algorithm(&self , UserIndex : i32) -> Result<String, SecureBlackboxError> fn set_user_hash_algorithm(&self, UserIndex : i32, value : &str) ->  Option<SecureBlackboxError>
fn set_user_hash_algorithm_ref(&self, UserIndex : i32, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

Specifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user. Three HMAC algorithms are supported, with SHA-1, SHA-256, and SHA-512 digests:

|  |  |  |
| --- | --- | --- |
| SB_MAC_ALGORITHM_HMAC_SHA1 | SHA1 |  |
| SB_MAC_ALGORITHM_HMAC_SHA256 | SHA256 |  |
| SB_MAC_ALGORITHM_HMAC_SHA512 | SHA512 |  |

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

String

# user_incoming_speed_limit property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the incoming speed limit for this user.

## Syntax

*Rust Syntax*

```text
fn user_incoming_speed_limit(&self , UserIndex : i32) -> Result<i32, SecureBlackboxError> fn set_user_incoming_speed_limit(&self, UserIndex : i32, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

Specifies the incoming speed limit for this user. The value of 0 (zero) means "no limitation".

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

i32

# user_otp_algorithm property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP).

## Syntax

*Rust Syntax*

```text
fn user_otp_algorithm(&self , UserIndex : i32) -> Result<i32, SecureBlackboxError> fn set_user_otp_algorithm(&self, UserIndex : i32, value : i32) ->  Option<SecureBlackboxError>
```

## Possible Values

```text
0   // None1   // Hmac2   // Time
```

## Default Value

0

## Remarks

The algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP). In the former case, a value of a dedicated counter is used to generate a unique password, while in the latter the password is generated on the basis of the current time value.

|  |  |  |
| --- | --- | --- |
| oaHmac | 0 |  |
| oaTime | 1 |  |

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

i32

# user_otp_len property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the length of the user's OTP password.

## Syntax

*Rust Syntax*

```text
fn user_otp_len(&self , UserIndex : i32) -> Result<i32, SecureBlackboxError> fn set_user_otp_len(&self, UserIndex : i32, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

Specifies the length of the user's OTP password.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

i32

# user_otp_value property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The user's time interval (TOTP) or Counter (HOTP).

## Syntax

*Rust Syntax*

```text
fn user_otp_value(&self , UserIndex : i32) -> Result<i32, SecureBlackboxError> fn set_user_otp_value(&self, UserIndex : i32, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

The user's time interval (TOTP) or Counter (HOTP).

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

i32

# user_outgoing_speed_limit property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies the outgoing speed limit for this user.

## Syntax

*Rust Syntax*

```text
fn user_outgoing_speed_limit(&self , UserIndex : i32) -> Result<i32, SecureBlackboxError> fn set_user_outgoing_speed_limit(&self, UserIndex : i32, value : i32) ->  Option<SecureBlackboxError>
```

## Default Value

0

## Remarks

Specifies the outgoing speed limit for this user. The value of 0 (zero) means "no limitation".

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

i32

# user_password property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The user's authentication password.

## Syntax

*Rust Syntax*

```text
fn user_password(&self , UserIndex : i32) -> Result<String, SecureBlackboxError> fn set_user_password(&self, UserIndex : i32, value : &str) ->  Option<SecureBlackboxError>
fn set_user_password_ref(&self, UserIndex : i32, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

The user's authentication password.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

String

# user_shared_secret property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains the user's secret key, which is essentially a shared secret between the client and server.

## Syntax

*Rust Syntax*

```text
fn user_shared_secret(&self , UserIndex : i32) -> Result<Vec<u8>, SecureBlackboxError> fn set_user_shared_secret(&self, UserIndex : i32, value : Vec<u8>) ->  Option<SecureBlackboxError>
fn set_user_shared_secret_ref(&self, UserIndex : i32, value : &[u8]) ->  Option<SecureBlackboxError>
```

## Remarks

Contains the user's secret key, which is essentially a shared secret between the client and server.

Shared secrets can be used in TLS-driven protocols, as well as in OTP (where it is called a 'key secret') for generating one-time passwords on one side, and validate them on the other.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

Vec

# user_ssh_key property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Contains the user's SSH key.

## Syntax

*Rust Syntax*

```text
fn user_ssh_key(&self , UserIndex : i32) -> Result<Vec<u8>, SecureBlackboxError> fn set_user_ssh_key(&self, UserIndex : i32, value : Vec<u8>) ->  Option<SecureBlackboxError>
fn set_user_ssh_key_ref(&self, UserIndex : i32, value : &[u8]) ->  Option<SecureBlackboxError>
```

## Remarks

Contains the user's SSH key.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

Vec

# username property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

The registered name (login) of the user.

## Syntax

*Rust Syntax*

```text
fn username(&self , UserIndex : i32) -> Result<String, SecureBlackboxError> fn set_username(&self, UserIndex : i32, value : &str) ->  Option<SecureBlackboxError>
fn set_username_ref(&self, UserIndex : i32, value : &String) ->  Option<SecureBlackboxError>
```

## Default Value

""

## Remarks

The registered name (login) of the user.

The *UserIndex* parameter specifies the index of the item in the array. The size of the array is controlled by the [UserCount](#user_count-property-sftpserver-struct) property.

## Data Type

String

# use_utf8 property ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Specifies whether UTF8 conversion is to be used when parsing file names.

## Syntax

*Rust Syntax*

```text
fn use_utf8(&self ) -> Result<bool, SecureBlackboxError> fn set_use_utf8(&self, value : bool) ->  Option<SecureBlackboxError>
```

## Default Value

false

## Remarks

This property specifies whether UTF8 conversion of filenames is used by the server. It is set automatically according to protocol flow, but user could also set it to the desired value.

## Data Type

bool

# cleanup method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Cleans up the server environment by purging expired sessions and cleaning caches.

## Syntax

*Rust Syntax*

```text
fn cleanup(&self) -> Result<(), SecureBlackboxError>
```

## Remarks

Call this method while the server is active to clean up the environment allocated for the server by releasing unused resources and cleaning caches.

# config method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Sets or retrieves a configuration setting.

## Syntax

*Rust Syntax*

```text
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](#config-settings-sftpserver-struct) 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](#config-settings-sftpserver-struct), you must call *Config("PROPERTY")*. The value will be returned as a string.

# do_action method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Performs an additional action.

## Syntax

*Rust Syntax*

```text
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. |

# drop_client method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Terminates a client connection.

## Syntax

*Rust Syntax*

```text
fn drop_client(&self, connection_id : i64, forced : bool) -> Result<(), SecureBlackboxError>
```

## Remarks

Call this method to shut down a connected client. *Forced* indicates whether the connection should be closed in a graceful manner.

# get_client_buffer method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Acquires a piece of operation data.

## Syntax

*Rust Syntax*

```text
fn get_client_buffer(&self, connection_id : i64, handle : &str) ->  Result<Vec<u8>, SecureBlackboxError>
```

## Remarks

Use this method to obtain a piece of data relevant to a transfer operation in a thread-safe way.

A typical place to call this method is inside the [on_write_file](#on_write_file-event-sftpserver-struct) event handler, when implementing customized file transfers.

# get_client_file_entry method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Acquires file entry details from the struct.

## Syntax

*Rust Syntax*

```text
fn get_client_file_entry(&self, connection_id : i64, handle : &str) -> Result<(), SecureBlackboxError>
```

## Remarks

Use this method to acquire the details of a file entry from the server in atomic and thread-safe way. After this method completes, the entry details will be propagated in client_file_entry property.

When calling this method, pass the client connection ID in *ConnectionID* property, and the opened file handle (if needed) in *Handle* property.

# list_clients method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Enumerates the connected clients.

## Syntax

*Rust Syntax*

```text
fn list_clients(&self) ->  Result<String, SecureBlackboxError>
```

## Remarks

This method enumerates the connected clients. It returns a list of strings, with each string being of 'ConnectionID|Address|Port' format, and representing a single connection.

# pin_client method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Takes a snapshot of the connection's properties.

## Syntax

*Rust Syntax*

```text
fn pin_client(&self, connection_id : i64) -> Result<(), SecureBlackboxError>
```

## Remarks

Use this method to take a snapshot of a connected client. The captured properties are populated in pinned_client property.

# reset method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Resets the struct settings.

## Syntax

*Rust Syntax*

```text
fn reset(&self) -> Result<(), SecureBlackboxError>
```

## Remarks

reset is a generic method available in every struct.

# set_client_buffer method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Commits a data buffer to the server struct.

## Syntax

*Rust Syntax*

```text
fn set_client_buffer(&self, connection_id : i64, handle : &str, value : &[u8]) -> Result<(), SecureBlackboxError>
```

## Remarks

Use this method to commit a data buffer passed via the *Value* parameter to the server control in a thread-safe way.

One example where you might need to pass your buffer to the server is when customizing upload operations via [on_read_file](#on_read_file-event-sftpserver-struct) event.

# set_client_file_entry method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Commits the file entry details to the struct.

## Syntax

*Rust Syntax*

```text
fn set_client_file_entry(&self, connection_id : i64, handle : &str) -> Result<(), SecureBlackboxError>
```

## Remarks

Use this method to commit the file entry details configured in client_file_entry property to the server object in a thread-safe way. Pass the client's connection ID via *ConnectionID* property, and the file entry's handle via *Handle*.

# start method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Starts SFTP server operation.

## Syntax

*Rust Syntax*

```text
fn start(&self) -> Result<(), SecureBlackboxError>
```

## Remarks

Call this method to start listening to incoming connections.

# stop method ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Stops SFTP server.

## Syntax

*Rust Syntax*

```text
fn stop(&self) -> Result<(), SecureBlackboxError>
```

## Remarks

Call this method to close all connections and stop listening to clients.

# on_accept event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when new incoming connection is accepted.

## Syntax

*Rust Syntax*

```text
// SFTPServerAcceptEventArgs carries the SFTPServer Accept event's parameters.
pub struct SFTPServerAcceptEventArgs {
  fn remote_address(&self) -> &String
  fn remote_port(&self) -> i32
  fn accept(&self) -> bool
  fn set_accept(&self, value : bool)
}

// SFTPServerAcceptEvent defines the signature of the SFTPServer Accept event's handler function.
pub trait SFTPServerAcceptEvent {
  fn on_accept(&self, sender : SFTPServer, e : &mut SFTPServerAcceptEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_accept(&self) -> &'a dyn SFTPServerAcceptEvent;
  pub fn set_on_accept(&mut self, value : &'a dyn SFTPServerAcceptEvent);
  ...
}
```

## Remarks

This event is fired by the struct before a new incoming connection is accepted. *RemoteAddress* contains the IP address of the connecting client. Use the *Accept* parameter to either accept, or reject the connection.

# on_after_create_directory event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event indicates completion of directory creation request.

## Syntax

*Rust Syntax*

```text
// SFTPServerAfterCreateDirectoryEventArgs carries the SFTPServer AfterCreateDirectory event's parameters.
pub struct SFTPServerAfterCreateDirectoryEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerAfterCreateDirectoryEvent defines the signature of the SFTPServer AfterCreateDirectory event's handler function.
pub trait SFTPServerAfterCreateDirectoryEvent {
  fn on_after_create_directory(&self, sender : SFTPServer, e : &mut SFTPServerAfterCreateDirectoryEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_after_create_directory(&self) -> &'a dyn SFTPServerAfterCreateDirectoryEvent;
  pub fn set_on_after_create_directory(&mut self, value : &'a dyn SFTPServerAfterCreateDirectoryEvent);
  ...
}
```

## Remarks

This event is fired to report completion of a directory creation request. The *ConnectionID* parameter specifies in which session the request was received, the *Path* specifies the directory path, and the *OperationStatus* contains the operation result.

If needed, you can amend the *OperationStatus* to return a different operation result:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_after_remove event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event indicates completion of file removal request.

## Syntax

*Rust Syntax*

```text
// SFTPServerAfterRemoveEventArgs carries the SFTPServer AfterRemove event's parameters.
pub struct SFTPServerAfterRemoveEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerAfterRemoveEvent defines the signature of the SFTPServer AfterRemove event's handler function.
pub trait SFTPServerAfterRemoveEvent {
  fn on_after_remove(&self, sender : SFTPServer, e : &mut SFTPServerAfterRemoveEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_after_remove(&self) -> &'a dyn SFTPServerAfterRemoveEvent;
  pub fn set_on_after_remove(&mut self, value : &'a dyn SFTPServerAfterRemoveEvent);
  ...
}
```

## Remarks

This event is fired when a request to delete a file or directory has been processed by the server. The *ConnectionID* parameter specifies the session in which the request was received. *OperationStatus* contains the operation result.

If needed, you can amend the *OperationStatus* to return a different operation result:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_after_rename_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event indicates completion of a file rename operation.

## Syntax

*Rust Syntax*

```text
// SFTPServerAfterRenameFileEventArgs carries the SFTPServer AfterRenameFile event's parameters.
pub struct SFTPServerAfterRenameFileEventArgs {
  fn connection_id(&self) -> i64
  fn old_path(&self) -> &String
  fn new_path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerAfterRenameFileEvent defines the signature of the SFTPServer AfterRenameFile event's handler function.
pub trait SFTPServerAfterRenameFileEvent {
  fn on_after_rename_file(&self, sender : SFTPServer, e : &mut SFTPServerAfterRenameFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_after_rename_file(&self) -> &'a dyn SFTPServerAfterRenameFileEvent;
  pub fn set_on_after_rename_file(&mut self, value : &'a dyn SFTPServerAfterRenameFileEvent);
  ...
}
```

## Remarks

This event is fired when a request to rename a file (from *OldPath* to *NewPath*) has been processed. The *ConnectionID* parameter specifies in which session the request was received, and *OperationStatus* contains the operation result.

If needed, you can amend the *OperationStatus* to return a different operation result:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_after_request_attributes event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event indicates completion of file attributes request.

## Syntax

*Rust Syntax*

```text
// SFTPServerAfterRequestAttributesEventArgs carries the SFTPServer AfterRequestAttributes event's parameters.
pub struct SFTPServerAfterRequestAttributesEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerAfterRequestAttributesEvent defines the signature of the SFTPServer AfterRequestAttributes event's handler function.
pub trait SFTPServerAfterRequestAttributesEvent {
  fn on_after_request_attributes(&self, sender : SFTPServer, e : &mut SFTPServerAfterRequestAttributesEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_after_request_attributes(&self) -> &'a dyn SFTPServerAfterRequestAttributesEvent;
  pub fn set_on_after_request_attributes(&mut self, value : &'a dyn SFTPServerAfterRequestAttributesEvent);
  ...
}
```

## Remarks

This event is fired when a request for get file attributes has been processed by the server. The *ConnectionID* parameter specifies in which session the request was received. *OperationStatus* contains the result of the operation.

If needed, you can amend the *OperationStatus* to return a different operation result:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_after_set_attributes event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event indicates completion of a set attributes request.

## Syntax

*Rust Syntax*

```text
// SFTPServerAfterSetAttributesEventArgs carries the SFTPServer AfterSetAttributes event's parameters.
pub struct SFTPServerAfterSetAttributesEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerAfterSetAttributesEvent defines the signature of the SFTPServer AfterSetAttributes event's handler function.
pub trait SFTPServerAfterSetAttributesEvent {
  fn on_after_set_attributes(&self, sender : SFTPServer, e : &mut SFTPServerAfterSetAttributesEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_after_set_attributes(&self) -> &'a dyn SFTPServerAfterSetAttributesEvent;
  pub fn set_on_after_set_attributes(&mut self, value : &'a dyn SFTPServerAfterSetAttributesEvent);
  ...
}
```

## Remarks

This event is fired when a request for set file attributes has been processed. The *ConnectionID* parameter specifies in which session the request was received. The *OperationStatus* parameter contains the operation result.

If needed, you can amend the *OperationStatus* to return a different operation result:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_auth_attempt event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Reports a user authentication attempt.

## Syntax

*Rust Syntax*

```text
// SFTPServerAuthAttemptEventArgs carries the SFTPServer AuthAttempt event's parameters.
pub struct SFTPServerAuthAttemptEventArgs {
  fn connection_id(&self) -> i64
  fn username(&self) -> &String
  fn auth_type(&self) -> i32
  fn accept(&self) -> bool
  fn set_accept(&self, value : bool)
}

// SFTPServerAuthAttemptEvent defines the signature of the SFTPServer AuthAttempt event's handler function.
pub trait SFTPServerAuthAttemptEvent {
  fn on_auth_attempt(&self, sender : SFTPServer, e : &mut SFTPServerAuthAttemptEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_auth_attempt(&self) -> &'a dyn SFTPServerAuthAttemptEvent;
  pub fn set_on_auth_attempt(&mut self, value : &'a dyn SFTPServerAuthAttemptEvent);
  ...
}
```

## Remarks

*ConnectionID* identifies the session, *Username* specifies client's username, and *AuthType* specifies the authentication type. Use the *Accept* parameter to accept or decline the attempt.

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 ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Reports user authentication failure.

## Syntax

*Rust Syntax*

```text
// SFTPServerAuthFailedEventArgs carries the SFTPServer AuthFailed event's parameters.
pub struct SFTPServerAuthFailedEventArgs {
  fn connection_id(&self) -> i64
  fn username(&self) -> &String
  fn auth_type(&self) -> i32
}

// SFTPServerAuthFailedEvent defines the signature of the SFTPServer AuthFailed event's handler function.
pub trait SFTPServerAuthFailedEvent {
  fn on_auth_failed(&self, sender : SFTPServer, e : &mut SFTPServerAuthFailedEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_auth_failed(&self) -> &'a dyn SFTPServerAuthFailedEvent;
  pub fn set_on_auth_failed(&mut self, value : &'a dyn SFTPServerAuthFailedEvent);
  ...
}
```

## Remarks

*ConnectionID* identifies the session, *Username* specify client's username, and *AuthType* specifies what authentication type was used.

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_password event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired on password authentication attempt from a client.

## Syntax

*Rust Syntax*

```text
// SFTPServerAuthPasswordEventArgs carries the SFTPServer AuthPassword event's parameters.
pub struct SFTPServerAuthPasswordEventArgs {
  fn connection_id(&self) -> i64
  fn username(&self) -> &String
  fn password(&self) -> &String
  fn accept(&self) -> bool
  fn set_accept(&self, value : bool)
  fn force_change_password(&self) -> bool
  fn set_force_change_password(&self, value : bool)
}

// SFTPServerAuthPasswordEvent defines the signature of the SFTPServer AuthPassword event's handler function.
pub trait SFTPServerAuthPasswordEvent {
  fn on_auth_password(&self, sender : SFTPServer, e : &mut SFTPServerAuthPasswordEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_auth_password(&self) -> &'a dyn SFTPServerAuthPasswordEvent;
  pub fn set_on_auth_password(&mut self, value : &'a dyn SFTPServerAuthPasswordEvent);
  ...
}
```

## Remarks

Parameters *Username* and *Password* contain user credentials. If they are correct, set *Accept* to true. You can request password change by setting *ForceChangePassword* to true.

# on_auth_public_key event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired on public key authentication attempt from a client.

## Syntax

*Rust Syntax*

```text
// SFTPServerAuthPublicKeyEventArgs carries the SFTPServer AuthPublicKey event's parameters.
pub struct SFTPServerAuthPublicKeyEventArgs {
  fn connection_id(&self) -> i64
  fn username(&self) -> &String
  fn accept(&self) -> bool
  fn set_accept(&self, value : bool)
}

// SFTPServerAuthPublicKeyEvent defines the signature of the SFTPServer AuthPublicKey event's handler function.
pub trait SFTPServerAuthPublicKeyEvent {
  fn on_auth_public_key(&self, sender : SFTPServer, e : &mut SFTPServerAuthPublicKeyEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_auth_public_key(&self) -> &'a dyn SFTPServerAuthPublicKeyEvent;
  pub fn set_on_auth_public_key(&mut self, value : &'a dyn SFTPServerAuthPublicKeyEvent);
  ...
}
```

## Remarks

*Username* specifies client's username, and *Accept* is used to accept or reject authentication.

The users public key can be accessed via the client_key property. This event is guarded with a critical section so the property always contains the correct key.

# on_auth_succeeded event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Reports a successful user authentication.

## Syntax

*Rust Syntax*

```text
// SFTPServerAuthSucceededEventArgs carries the SFTPServer AuthSucceeded event's parameters.
pub struct SFTPServerAuthSucceededEventArgs {
  fn connection_id(&self) -> i64
  fn username(&self) -> &String
  fn auth_type(&self) -> i32
}

// SFTPServerAuthSucceededEvent defines the signature of the SFTPServer AuthSucceeded event's handler function.
pub trait SFTPServerAuthSucceededEvent {
  fn on_auth_succeeded(&self, sender : SFTPServer, e : &mut SFTPServerAuthSucceededEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_auth_succeeded(&self) -> &'a dyn SFTPServerAuthSucceededEvent;
  pub fn set_on_auth_succeeded(&mut self, value : &'a dyn SFTPServerAuthSucceededEvent);
  ...
}
```

## Remarks

*ConnectionID* identifies the session, *Username* specify client's username, and *AuthType* specifies what authentication type was used.

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_before_create_directory event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to create a directory.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeCreateDirectoryEventArgs carries the SFTPServer BeforeCreateDirectory event's parameters.
pub struct SFTPServerBeforeCreateDirectoryEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeCreateDirectoryEvent defines the signature of the SFTPServer BeforeCreateDirectory event's handler function.
pub trait SFTPServerBeforeCreateDirectoryEvent {
  fn on_before_create_directory(&self, sender : SFTPServer, e : &mut SFTPServerBeforeCreateDirectoryEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_create_directory(&self) -> &'a dyn SFTPServerBeforeCreateDirectoryEvent;
  pub fn set_on_before_create_directory(&mut self, value : &'a dyn SFTPServerBeforeCreateDirectoryEvent);
  ...
}
```

## Remarks

This event is fired when a request to create a directory has been received. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_download_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a download file request is received.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeDownloadFileEventArgs carries the SFTPServer BeforeDownloadFile event's parameters.
pub struct SFTPServerBeforeDownloadFileEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeDownloadFileEvent defines the signature of the SFTPServer BeforeDownloadFile event's handler function.
pub trait SFTPServerBeforeDownloadFileEvent {
  fn on_before_download_file(&self, sender : SFTPServer, e : &mut SFTPServerBeforeDownloadFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_download_file(&self) -> &'a dyn SFTPServerBeforeDownloadFileEvent;
  pub fn set_on_before_download_file(&mut self, value : &'a dyn SFTPServerBeforeDownloadFileEvent);
  ...
}
```

## Remarks

This event is fired when a request to download file is received from the client. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_find event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to find files and folders in Path.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeFindEventArgs carries the SFTPServer BeforeFind event's parameters.
pub struct SFTPServerBeforeFindEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeFindEvent defines the signature of the SFTPServer BeforeFind event's handler function.
pub trait SFTPServerBeforeFindEvent {
  fn on_before_find(&self, sender : SFTPServer, e : &mut SFTPServerBeforeFindEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_find(&self) -> &'a dyn SFTPServerBeforeFindEvent;
  pub fn set_on_before_find(&mut self, value : &'a dyn SFTPServerBeforeFindEvent);
  ...
}
```

## Remarks

This event is fired when a request to find files and folders in *Path* has been received. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_open_client_forwarding event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to set up client-side (local) forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeOpenClientForwardingEventArgs carries the SFTPServer BeforeOpenClientForwarding event's parameters.
pub struct SFTPServerBeforeOpenClientForwardingEventArgs {
  fn connection_id(&self) -> i64
  fn dest_host(&self) -> &String
  fn set_dest_host(&self, value : &str)
  fn set_dest_host_ref(&self, value : &String)
  fn dest_port(&self) -> i32
  fn set_dest_port(&self, value : i32)
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeOpenClientForwardingEvent defines the signature of the SFTPServer BeforeOpenClientForwarding event's handler function.
pub trait SFTPServerBeforeOpenClientForwardingEvent {
  fn on_before_open_client_forwarding(&self, sender : SFTPServer, e : &mut SFTPServerBeforeOpenClientForwardingEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_open_client_forwarding(&self) -> &'a dyn SFTPServerBeforeOpenClientForwardingEvent;
  pub fn set_on_before_open_client_forwarding(&mut self, value : &'a dyn SFTPServerBeforeOpenClientForwardingEvent);
  ...
}
```

## Remarks

This event is fired when a request to open a client forwarding has been received. The *ConnectionID* parameter specifies in which session the request was received.

If permitted, the server will open a connection to DestHost:DestPort and start forwarding any data received from the client to that endpoint. You can enable or disable client forwarding blanketly via the [capabilities](#capabilities-property-sftpserver-struct) property.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_open_command event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests a command channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeOpenCommandEventArgs carries the SFTPServer BeforeOpenCommand event's parameters.
pub struct SFTPServerBeforeOpenCommandEventArgs {
  fn connection_id(&self) -> i64
  fn command(&self) -> &String
  fn set_command(&self, value : &str)
  fn set_command_ref(&self, value : &String)
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeOpenCommandEvent defines the signature of the SFTPServer BeforeOpenCommand event's handler function.
pub trait SFTPServerBeforeOpenCommandEvent {
  fn on_before_open_command(&self, sender : SFTPServer, e : &mut SFTPServerBeforeOpenCommandEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_open_command(&self) -> &'a dyn SFTPServerBeforeOpenCommandEvent;
  pub fn set_on_before_open_command(&mut self, value : &'a dyn SFTPServerBeforeOpenCommandEvent);
  ...
}
```

## Remarks

This event is fired when a request to open a command has been received. The *ConnectionID* parameter specifies in which session the request was received.

If permitted, the component will launch the command in a separate process. Note that allowing command access to all clients can be dangerous. You can enable or disable command support blanketly via the [capabilities](#capabilities-property-sftpserver-struct) property.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_open_server_forwarding event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when the server has received an incoming connection and needs to set up server-side (remote) forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeOpenServerForwardingEventArgs carries the SFTPServer BeforeOpenServerForwarding event's parameters.
pub struct SFTPServerBeforeOpenServerForwardingEventArgs {
  fn connection_id(&self) -> i64
  fn local_host(&self) -> &String
  fn local_port(&self) -> i32
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeOpenServerForwardingEvent defines the signature of the SFTPServer BeforeOpenServerForwarding event's handler function.
pub trait SFTPServerBeforeOpenServerForwardingEvent {
  fn on_before_open_server_forwarding(&self, sender : SFTPServer, e : &mut SFTPServerBeforeOpenServerForwardingEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_open_server_forwarding(&self) -> &'a dyn SFTPServerBeforeOpenServerForwardingEvent;
  pub fn set_on_before_open_server_forwarding(&mut self, value : &'a dyn SFTPServerBeforeOpenServerForwardingEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

If permitted, the server will accept the connection and ask the client to confirm forwarding to DestHost:DestPort. If that is successful, the server will fire the [on_open_server_forwarding](#on_open_server_forwarding-event-sftpserver-struct) event.

You can enable or disable client forwarding blanketly via the [capabilities](#capabilities-property-sftpserver-struct) property.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_open_shell event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests a shell channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeOpenShellEventArgs carries the SFTPServer BeforeOpenShell event's parameters.
pub struct SFTPServerBeforeOpenShellEventArgs {
  fn connection_id(&self) -> i64
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeOpenShellEvent defines the signature of the SFTPServer BeforeOpenShell event's handler function.
pub trait SFTPServerBeforeOpenShellEvent {
  fn on_before_open_shell(&self, sender : SFTPServer, e : &mut SFTPServerBeforeOpenShellEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_open_shell(&self) -> &'a dyn SFTPServerBeforeOpenShellEvent;
  pub fn set_on_before_open_shell(&mut self, value : &'a dyn SFTPServerBeforeOpenShellEvent);
  ...
}
```

## Remarks

This event is fired when a request to open a shell has been received. The *ConnectionID* parameter specifies in which session the request was received.

If permitted, the client will be able to send commands to the shell. Note that allowing shell access to all clients can be dangerous. You can enable or disable shell access blanketly via the [capabilities](#capabilities-property-sftpserver-struct) property.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_remove event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to delete a file or directory.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeRemoveEventArgs carries the SFTPServer BeforeRemove event's parameters.
pub struct SFTPServerBeforeRemoveEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeRemoveEvent defines the signature of the SFTPServer BeforeRemove event's handler function.
pub trait SFTPServerBeforeRemoveEvent {
  fn on_before_remove(&self, sender : SFTPServer, e : &mut SFTPServerBeforeRemoveEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_remove(&self) -> &'a dyn SFTPServerBeforeRemoveEvent;
  pub fn set_on_before_remove(&mut self, value : &'a dyn SFTPServerBeforeRemoveEvent);
  ...
}
```

## Remarks

This event is fired when a request to delete a file or directory is received from the client. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_rename_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to rename a file.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeRenameFileEventArgs carries the SFTPServer BeforeRenameFile event's parameters.
pub struct SFTPServerBeforeRenameFileEventArgs {
  fn connection_id(&self) -> i64
  fn old_path(&self) -> &String
  fn new_path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeRenameFileEvent defines the signature of the SFTPServer BeforeRenameFile event's handler function.
pub trait SFTPServerBeforeRenameFileEvent {
  fn on_before_rename_file(&self, sender : SFTPServer, e : &mut SFTPServerBeforeRenameFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_rename_file(&self) -> &'a dyn SFTPServerBeforeRenameFileEvent;
  pub fn set_on_before_rename_file(&mut self, value : &'a dyn SFTPServerBeforeRenameFileEvent);
  ...
}
```

## Remarks

This event is fired when a request to rename a file (from *OldPath* to *NewPath*) is received from the client. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_request_attributes event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to get file attributes.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeRequestAttributesEventArgs carries the SFTPServer BeforeRequestAttributes event's parameters.
pub struct SFTPServerBeforeRequestAttributesEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeRequestAttributesEvent defines the signature of the SFTPServer BeforeRequestAttributes event's handler function.
pub trait SFTPServerBeforeRequestAttributesEvent {
  fn on_before_request_attributes(&self, sender : SFTPServer, e : &mut SFTPServerBeforeRequestAttributesEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_request_attributes(&self) -> &'a dyn SFTPServerBeforeRequestAttributesEvent;
  pub fn set_on_before_request_attributes(&mut self, value : &'a dyn SFTPServerBeforeRequestAttributesEvent);
  ...
}
```

## Remarks

This event is fired when a request to get file attributes has been received. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_set_attributes event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to set file attributes.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeSetAttributesEventArgs carries the SFTPServer BeforeSetAttributes event's parameters.
pub struct SFTPServerBeforeSetAttributesEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeSetAttributesEvent defines the signature of the SFTPServer BeforeSetAttributes event's handler function.
pub trait SFTPServerBeforeSetAttributesEvent {
  fn on_before_set_attributes(&self, sender : SFTPServer, e : &mut SFTPServerBeforeSetAttributesEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_set_attributes(&self) -> &'a dyn SFTPServerBeforeSetAttributesEvent;
  pub fn set_on_before_set_attributes(&mut self, value : &'a dyn SFTPServerBeforeSetAttributesEvent);
  ...
}
```

## Remarks

This event is fired when a request to set file attributes has been received. The *ConnectionID* parameter specifies in which session the request was received.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_before_upload_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when an upload file request is received.

## Syntax

*Rust Syntax*

```text
// SFTPServerBeforeUploadFileEventArgs carries the SFTPServer BeforeUploadFile event's parameters.
pub struct SFTPServerBeforeUploadFileEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerBeforeUploadFileEvent defines the signature of the SFTPServer BeforeUploadFile event's handler function.
pub trait SFTPServerBeforeUploadFileEvent {
  fn on_before_upload_file(&self, sender : SFTPServer, e : &mut SFTPServerBeforeUploadFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_before_upload_file(&self) -> &'a dyn SFTPServerBeforeUploadFileEvent;
  pub fn set_on_before_upload_file(&mut self, value : &'a dyn SFTPServerBeforeUploadFileEvent);
  ...
}
```

## Remarks

This event is fired when an upload file request is received from the client. The *ConnectionID* parameter specifies in which session the request was received, and *Path* specifies the location on the server where the file needs to be saved.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_close_client_forwarding event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has closed a previously opened forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerCloseClientForwardingEventArgs carries the SFTPServer CloseClientForwarding event's parameters.
pub struct SFTPServerCloseClientForwardingEventArgs {
  fn connection_id(&self) -> i64
  fn dest_host(&self) -> &String
  fn dest_port(&self) -> i32
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
}

// SFTPServerCloseClientForwardingEvent defines the signature of the SFTPServer CloseClientForwarding event's handler function.
pub trait SFTPServerCloseClientForwardingEvent {
  fn on_close_client_forwarding(&self, sender : SFTPServer, e : &mut SFTPServerCloseClientForwardingEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_close_client_forwarding(&self) -> &'a dyn SFTPServerCloseClientForwardingEvent;
  pub fn set_on_close_client_forwarding(&mut self, value : &'a dyn SFTPServerCloseClientForwardingEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

# on_close_command event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has closed a previously opened SSH command channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerCloseCommandEventArgs carries the SFTPServer CloseCommand event's parameters.
pub struct SFTPServerCloseCommandEventArgs {
  fn connection_id(&self) -> i64
  fn command(&self) -> &String
}

// SFTPServerCloseCommandEvent defines the signature of the SFTPServer CloseCommand event's handler function.
pub trait SFTPServerCloseCommandEvent {
  fn on_close_command(&self, sender : SFTPServer, e : &mut SFTPServerCloseCommandEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_close_command(&self) -> &'a dyn SFTPServerCloseCommandEvent;
  pub fn set_on_close_command(&mut self, value : &'a dyn SFTPServerCloseCommandEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

# on_close_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event instructs the application to close an opened file.

## Syntax

*Rust Syntax*

```text
// SFTPServerCloseFileEventArgs carries the SFTPServer CloseFile event's parameters.
pub struct SFTPServerCloseFileEventArgs {
  fn connection_id(&self) -> i64
  fn handle(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerCloseFileEvent defines the signature of the SFTPServer CloseFile event's handler function.
pub trait SFTPServerCloseFileEvent {
  fn on_close_file(&self, sender : SFTPServer, e : &mut SFTPServerCloseFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_close_file(&self) -> &'a dyn SFTPServerCloseFileEvent;
  pub fn set_on_close_file(&mut self, value : &'a dyn SFTPServerCloseFileEvent);
  ...
}
```

## Remarks

This event is fired upon receipt of a close-file packet from a client. Servers implementing virtualized transfers must close the previously opened local file referenced by *Handle* in this event handler. No further operations are allowed with the closed file.

Set *OperationStatus* to one of the following values to report the result of this operation to the client:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_close_server_forwarding event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has closed a previously opened forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerCloseServerForwardingEventArgs carries the SFTPServer CloseServerForwarding event's parameters.
pub struct SFTPServerCloseServerForwardingEventArgs {
  fn connection_id(&self) -> i64
  fn local_host(&self) -> &String
  fn local_port(&self) -> i32
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
}

// SFTPServerCloseServerForwardingEvent defines the signature of the SFTPServer CloseServerForwarding event's handler function.
pub trait SFTPServerCloseServerForwardingEvent {
  fn on_close_server_forwarding(&self, sender : SFTPServer, e : &mut SFTPServerCloseServerForwardingEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_close_server_forwarding(&self) -> &'a dyn SFTPServerCloseServerForwardingEvent;
  pub fn set_on_close_server_forwarding(&mut self, value : &'a dyn SFTPServerCloseServerForwardingEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

# on_close_shell event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has closed a previously opened shell channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerCloseShellEventArgs carries the SFTPServer CloseShell event's parameters.
pub struct SFTPServerCloseShellEventArgs {
  fn connection_id(&self) -> i64
}

// SFTPServerCloseShellEvent defines the signature of the SFTPServer CloseShell event's handler function.
pub trait SFTPServerCloseShellEvent {
  fn on_close_shell(&self, sender : SFTPServer, e : &mut SFTPServerCloseShellEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_close_shell(&self) -> &'a dyn SFTPServerCloseShellEvent;
  pub fn set_on_close_shell(&mut self, value : &'a dyn SFTPServerCloseShellEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

# on_connect event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a remote connection has been established.

## Syntax

*Rust Syntax*

```text
// SFTPServerConnectEventArgs carries the SFTPServer Connect event's parameters.
pub struct SFTPServerConnectEventArgs {
  fn connection_id(&self) -> i64
  fn remote_address(&self) -> &String
  fn remote_port(&self) -> i32
}

// SFTPServerConnectEvent defines the signature of the SFTPServer Connect event's handler function.
pub trait SFTPServerConnectEvent {
  fn on_connect(&self, sender : SFTPServer, e : &mut SFTPServerConnectEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_connect(&self) -> &'a dyn SFTPServerConnectEvent;
  pub fn set_on_connect(&mut self, value : &'a dyn SFTPServerConnectEvent);
  ...
}
```

## Remarks

*ConnectionID* contains a session identifier, and *RemoteAddress* specifies the client's IP address.

# on_create_directory event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event instructs the application to create a directory.

## Syntax

*Rust Syntax*

```text
// SFTPServerCreateDirectoryEventArgs carries the SFTPServer CreateDirectory event's parameters.
pub struct SFTPServerCreateDirectoryEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerCreateDirectoryEvent defines the signature of the SFTPServer CreateDirectory event's handler function.
pub trait SFTPServerCreateDirectoryEvent {
  fn on_create_directory(&self, sender : SFTPServer, e : &mut SFTPServerCreateDirectoryEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_create_directory(&self) -> &'a dyn SFTPServerCreateDirectoryEvent;
  pub fn set_on_create_directory(&mut self, value : &'a dyn SFTPServerCreateDirectoryEvent);
  ...
}
```

## Remarks

This event is fired when a request to create a directory has been received and needs to be served (virtualized) by the application. The *ConnectionID* parameter specifies the session that has communicated the request, and *Path* contains the name of the directory to be created.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_disconnect event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has disconnected.

## Syntax

*Rust Syntax*

```text
// SFTPServerDisconnectEventArgs carries the SFTPServer Disconnect event's parameters.
pub struct SFTPServerDisconnectEventArgs {
  fn connection_id(&self) -> i64
}

// SFTPServerDisconnectEvent defines the signature of the SFTPServer Disconnect event's handler function.
pub trait SFTPServerDisconnectEvent {
  fn on_disconnect(&self, sender : SFTPServer, e : &mut SFTPServerDisconnectEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_disconnect(&self) -> &'a dyn SFTPServerDisconnectEvent;
  pub fn set_on_disconnect(&mut self, value : &'a dyn SFTPServerDisconnectEvent);
  ...
}
```

## Remarks

This event reports loss of connection to the client within the session specified by *ConnectionID*.

# on_error event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Information about errors during data delivery.

## Syntax

*Rust Syntax*

```text
// SFTPServerErrorEventArgs carries the SFTPServer Error event's parameters.
pub struct SFTPServerErrorEventArgs {
  fn connection_id(&self) -> i64
  fn error_code(&self) -> i32
  fn fatal(&self) -> bool
  fn remote(&self) -> bool
  fn description(&self) -> &String
}

// SFTPServerErrorEvent defines the signature of the SFTPServer Error event's handler function.
pub trait SFTPServerErrorEvent {
  fn on_error(&self, sender : SFTPServer, e : &mut SFTPServerErrorEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_error(&self) -> &'a dyn SFTPServerErrorEvent;
  pub fn set_on_error(&mut self, value : &'a dyn SFTPServerErrorEvent);
  ...
}
```

## Remarks

The event is fired in case of exceptional conditions during message processing.

*ErrorCode* contains an error code and *Description* contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the [SFTP](#trappable-errors-sftpserver-struct) section.

# on_external_sign event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Handles remote or external signing initiated by the server protocol.

## Syntax

*Rust Syntax*

```text
// SFTPServerExternalSignEventArgs carries the SFTPServer ExternalSign event's parameters.
pub struct SFTPServerExternalSignEventArgs {
  fn connection_id(&self) -> i64
  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)
}

// SFTPServerExternalSignEvent defines the signature of the SFTPServer ExternalSign event's handler function.
pub trait SFTPServerExternalSignEvent {
  fn on_external_sign(&self, sender : SFTPServer, e : &mut SFTPServerExternalSignEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_external_sign(&self) -> &'a dyn SFTPServerExternalSignEvent;
  pub fn set_on_external_sign(&mut self, value : &'a dyn SFTPServerExternalSignEvent);
  ...
}
```

## 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:

```text
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_find_close event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event signifies the completion of a custom file listing operation.

## Syntax

*Rust Syntax*

```text
// SFTPServerFindCloseEventArgs carries the SFTPServer FindClose event's parameters.
pub struct SFTPServerFindCloseEventArgs {
  fn connection_id(&self) -> i64
  fn handle(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerFindCloseEvent defines the signature of the SFTPServer FindClose event's handler function.
pub trait SFTPServerFindCloseEvent {
  fn on_find_close(&self, sender : SFTPServer, e : &mut SFTPServerFindCloseEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_find_close(&self) -> &'a dyn SFTPServerFindCloseEvent;
  pub fn set_on_find_close(&mut self, value : &'a dyn SFTPServerFindCloseEvent);
  ...
}
```

## Remarks

on_find_close notifies your code about the completion of a custom file listing request. Use it in conjunction with [on_find_first](#on_find_first-event-sftpserver-struct) and [on_find_next](#on_find_next-event-sftpserver-struct) to handle file listing requests manually.

See [on_find_first](#on_find_first-event-sftpserver-struct) topic for the details on implementing customized file listing request processing.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_find_first event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event signifies the start of the custom file listing retrieval mechanism.

## Syntax

*Rust Syntax*

```text
// SFTPServerFindFirstEventArgs carries the SFTPServer FindFirst event's parameters.
pub struct SFTPServerFindFirstEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
  fn handle(&self) -> &String
  fn set_handle(&self, value : &str)
  fn set_handle_ref(&self, value : &String)
}

// SFTPServerFindFirstEvent defines the signature of the SFTPServer FindFirst event's handler function.
pub trait SFTPServerFindFirstEvent {
  fn on_find_first(&self, sender : SFTPServer, e : &mut SFTPServerFindFirstEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_find_first(&self) -> &'a dyn SFTPServerFindFirstEvent;
  pub fn set_on_find_first(&mut self, value : &'a dyn SFTPServerFindFirstEvent);
  ...
}
```

## Remarks

on_find_first, [on_find_next](#on_find_next-event-sftpserver-struct), and [on_find_close](#on_find_close-event-sftpserver-struct) events represent a mechanism for providing customized file listings to struct. They are only fired if *Action* parameter of the preceding [on_before_find](#on_before_find-event-sftpserver-struct) event was set to *fraCustom*.

The behaviour of these events mimics that of the standard FindFirst/FindNext/FindClose functions found in many operating systems/frameworks. on_find_first fires once to request the first list entry; [on_find_next](#on_find_next-event-sftpserver-struct) then fires continuously in a loop to request all subsequent entries. To indicate that the listing is over, set *OperationStatus* parameter to *ostEOF*. Not doing so may lead to an endless loop and session freeze, as the component would continue firing [on_find_next](#on_find_next-event-sftpserver-struct) infinitely waiting for the EOF marker.

The handlers for both on_find_first and [on_find_next](#on_find_next-event-sftpserver-struct) events should be implemented in the following way: if there are more entries in the directory to pass back to the server component,

- set *OperationStatus* to *ostOK*,
- fill in client_file_entry with the details of the next entry,
- commit the entry to the server using [set_client_file_entry](#set_client_file_entry-method-sftpserver-struct) method.

 When all the entries from the requested directory have been passed to the server component, set *OperationStatus* to *ostEOF*. The server will then fire [on_find_close](#on_find_close-event-sftpserver-struct) event to notify your code that the file listing is completed.

Use the by-ref *Handle* parameter to assign a handle (a unique identifier) to the file listing procedure inside the on_find_first event handler. This identifier will then be passed to all subsequent [on_find_next](#on_find_next-event-sftpserver-struct) and [on_find_close](#on_find_close-event-sftpserver-struct) calls to let your code chain the events together.

The *ConnectionID* parameter specifies in which SFTP session the request was received, and *Path* indicates the requested directory.

The following operation status constants are available, besides the ones referenced above:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_find_next event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event retrieves the next entry of a custom file listing.

## Syntax

*Rust Syntax*

```text
// SFTPServerFindNextEventArgs carries the SFTPServer FindNext event's parameters.
pub struct SFTPServerFindNextEventArgs {
  fn connection_id(&self) -> i64
  fn handle(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerFindNextEvent defines the signature of the SFTPServer FindNext event's handler function.
pub trait SFTPServerFindNextEvent {
  fn on_find_next(&self, sender : SFTPServer, e : &mut SFTPServerFindNextEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_find_next(&self) -> &'a dyn SFTPServerFindNextEvent;
  pub fn set_on_find_next(&mut self, value : &'a dyn SFTPServerFindNextEvent);
  ...
}
```

## Remarks

This event is fired repeatedly after [on_find_first](#on_find_first-event-sftpserver-struct) to retrieve the directory contents entry-by-entry. Please see the [on_find_first](#on_find_first-event-sftpserver-struct) topic for more details about implementing a handler of this event.

Remember to set *OperationStatus* to *ostEOF* when there are no more entries left to close the listing operation. If there are more entries to pass, set it to *ostOK*. Other possible values are given in the table below:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_listening_started event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Fires when the server has started accepting connections on a local port.

## Syntax

*Rust Syntax*

```text
// SFTPServerListeningStartedEventArgs carries the SFTPServer ListeningStarted event's parameters.
pub struct SFTPServerListeningStartedEventArgs {
  fn host(&self) -> &String
  fn port(&self) -> i32
}

// SFTPServerListeningStartedEvent defines the signature of the SFTPServer ListeningStarted event's handler function.
pub trait SFTPServerListeningStartedEvent {
  fn on_listening_started(&self, sender : SFTPServer, e : &mut SFTPServerListeningStartedEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_listening_started(&self) -> &'a dyn SFTPServerListeningStartedEvent;
  pub fn set_on_listening_started(&mut self, value : &'a dyn SFTPServerListeningStartedEvent);
  ...
}
```

## Remarks

This event is fired when the server is ready to accept incoming SSH/SFTP connections.

# on_listening_stopped event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Fires when the server has stopped accepting connections on a local port.

## Syntax

*Rust Syntax*

```text
// SFTPServerListeningStoppedEventArgs carries the SFTPServer ListeningStopped event's parameters.
pub struct SFTPServerListeningStoppedEventArgs {
  fn host(&self) -> &String
  fn port(&self) -> i32
}

// SFTPServerListeningStoppedEvent defines the signature of the SFTPServer ListeningStopped event's handler function.
pub trait SFTPServerListeningStoppedEvent {
  fn on_listening_stopped(&self, sender : SFTPServer, e : &mut SFTPServerListeningStoppedEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_listening_stopped(&self) -> &'a dyn SFTPServerListeningStoppedEvent;
  pub fn set_on_listening_stopped(&mut self, value : &'a dyn SFTPServerListeningStoppedEvent);
  ...
}
```

## Remarks

This event is fired when the server has closed the listening socket and can no longer accept incoming SSH/SFTP connections.

# on_notification event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

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

## Syntax

*Rust Syntax*

```text
// SFTPServerNotificationEventArgs carries the SFTPServer Notification event's parameters.
pub struct SFTPServerNotificationEventArgs {
  fn event_id(&self) -> &String
  fn event_param(&self) -> &String
}

// SFTPServerNotificationEvent defines the signature of the SFTPServer Notification event's handler function.
pub trait SFTPServerNotificationEvent {
  fn on_notification(&self, sender : SFTPServer, e : &mut SFTPServerNotificationEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_notification(&self) -> &'a dyn SFTPServerNotificationEvent;
  pub fn set_on_notification(&mut self, value : &'a dyn SFTPServerNotificationEvent);
  ...
}
```

## 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.

This struct can fire this event with the following *EventID* values:

|  |  |
| --- | --- |
| FileOpen | Notifies your code about the file being opened, which is typically an indicator of the initiation of the transfer operation. The EventParam value passed with this EventID is a string of the following format: ConnectionID=3;Path=/dir/file;Handle=x5DshAk8;Modes=48;Access=0;DesiredAccess=8 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| FileRead | Notifies your code about the file chunk being requested. The EventParam value passed with this EventID is a string of the following format: ConnectionID=7;Handle=x5DshAk8;Offset=2048;Count=1024;Read=1021 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| FileWrite | Notifies your code about the file chunk being received. The EventParam value passed with this EventID is a string of the following format: ConnectionID=7;Handle=x5DshAk8;Offset=2048;Count=1024 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| FileClose | Notifies your code about the closure of an opened file. The EventParam value passed with this EventID is a string of the following format: ConnectionID=7;Handle=x5DshAk8;Modes=48 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| OpenShell | Notifies your code about an opened shell tunnel. The EventParam has the following format: ConnectionID=9;LocalChannel=1;RemoteChannel=2 |
| OpenCommand | Notifies your code about an opened command tunnel. The EventParam value has the following format: ConnectionID=8;LocalChannel=3;RemoteChannel=3;Command=ls -l |
| CloseShell | Indicates the closure of a shell tunnel. The EventParam format is the same as with the OpenShell event ID. |
| CloseCommand | Indicates the closure of a command tunnel. The EventParam format is the same as with the OpenCommand event ID. |
| Banner | Notifies the application that the banner has been prepared and is about to be sent to the other side. The application can adjust the content of the banner by using Banner[ConnID] and Lang[ConnID] configuration settings. |
| ListeningStarted | Notifies the application that the server has started listening for incoming connections. |
| ListeningStopped | Notifies the application that the server has stopped listening to incoming connections. |

# on_open_client_forwarding event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client opens a client-side (local) forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerOpenClientForwardingEventArgs carries the SFTPServer OpenClientForwarding event's parameters.
pub struct SFTPServerOpenClientForwardingEventArgs {
  fn connection_id(&self) -> i64
  fn dest_host(&self) -> &String
  fn dest_port(&self) -> i32
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
}

// SFTPServerOpenClientForwardingEvent defines the signature of the SFTPServer OpenClientForwarding event's handler function.
pub trait SFTPServerOpenClientForwardingEvent {
  fn on_open_client_forwarding(&self, sender : SFTPServer, e : &mut SFTPServerOpenClientForwardingEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_open_client_forwarding(&self) -> &'a dyn SFTPServerOpenClientForwardingEvent;
  pub fn set_on_open_client_forwarding(&mut self, value : &'a dyn SFTPServerOpenClientForwardingEvent);
  ...
}
```

## Remarks

This event notifies the application that a client-side forwarding channel has been set up. The *ConnectionID* parameter specifies in which session the request was received.

The *DestHost* and *DestPort* parameters specify the address that the data received from the client will be forwarded to. The *SrcHost* and *SrcPort* specify the connection origin that is reported by the client. Note that the details of the origin cannot be verified.

# on_open_command event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has opened an SSH command channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerOpenCommandEventArgs carries the SFTPServer OpenCommand event's parameters.
pub struct SFTPServerOpenCommandEventArgs {
  fn connection_id(&self) -> i64
  fn command(&self) -> &String
}

// SFTPServerOpenCommandEvent defines the signature of the SFTPServer OpenCommand event's handler function.
pub trait SFTPServerOpenCommandEvent {
  fn on_open_command(&self, sender : SFTPServer, e : &mut SFTPServerOpenCommandEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_open_command(&self) -> &'a dyn SFTPServerOpenCommandEvent;
  pub fn set_on_open_command(&mut self, value : &'a dyn SFTPServerOpenCommandEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

The component fires [on_close_command](#on_close_command-event-sftpserver-struct) when the command channel is closed.

# on_open_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event instructs the application to handle the file open request.

## Syntax

*Rust Syntax*

```text
// SFTPServerOpenFileEventArgs carries the SFTPServer OpenFile event's parameters.
pub struct SFTPServerOpenFileEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn modes(&self) -> i32
  fn access(&self) -> i32
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
  fn handle(&self) -> &String
  fn set_handle(&self, value : &str)
  fn set_handle_ref(&self, value : &String)
}

// SFTPServerOpenFileEvent defines the signature of the SFTPServer OpenFile event's handler function.
pub trait SFTPServerOpenFileEvent {
  fn on_open_file(&self, sender : SFTPServer, e : &mut SFTPServerOpenFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_open_file(&self) -> &'a dyn SFTPServerOpenFileEvent;
  pub fn set_on_open_file(&mut self, value : &'a dyn SFTPServerOpenFileEvent);
  ...
}
```

## Remarks

This event is fired when a file open request is received from the client and needs to be handled (virtualized) by the server. The *ConnectionID* parameter specifies in which session the request was received, and *Path* specifies the location of the file.

*Modes* can be a combination of one or several file open mode flags:

|  |  |
| --- | --- |
| cfmRead | 1 |
| cfmWrite | 2 |
| cfmAppend | 4 |
| cfmCreate | 8 |
| cfmTruncate | 16 |
| cfmExcl | 32 |
| cfmText | 64 |
| cfmOpenOrCreate | 128 |
| cfmAppendAtomic | 256 |
| cfmNoFollow | 512 |
| cfmDeleteOnClose | 1024 |

Different client applications may provide different selections of mode flags. For example, some clients specify (cfmCreate + cfmTruncate) when overwriting files, whereas others would specify cfmOpenOrCreate. Please make sure your code is prepared to receive different combinations of flags here and handles them gracefully.

The *Access* parameter provides additional file access modifiers:

|  |  |
| --- | --- |
| cfaReadLock | 1 |
| cfaWriteLock | 2 |
| cfaDeleteLock | 4 |
| cfaBlockAdvisory | 8 |

 These parameter may also contain a combination of the above flags. Access modifiers are only supported in SFTPv6, and in practice are rarely used by client applications.

The *Handle* string represents a unique identifier of the opened file, similar to file handles used in Windows or Unix APIs. Handles are unique across all files opened at the same time. Struct generates handles automatically, but you can update the auto-generated values with your own in this event handler (just remember to keep them unique).

Set *OperationStatus* parameter in accordance with the outcome of the operation to one of the values given below:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_open_server_forwarding event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when the server opens a server-side (remote) forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerOpenServerForwardingEventArgs carries the SFTPServer OpenServerForwarding event's parameters.
pub struct SFTPServerOpenServerForwardingEventArgs {
  fn connection_id(&self) -> i64
  fn local_host(&self) -> &String
  fn local_port(&self) -> i32
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
}

// SFTPServerOpenServerForwardingEvent defines the signature of the SFTPServer OpenServerForwarding event's handler function.
pub trait SFTPServerOpenServerForwardingEvent {
  fn on_open_server_forwarding(&self, sender : SFTPServer, e : &mut SFTPServerOpenServerForwardingEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_open_server_forwarding(&self) -> &'a dyn SFTPServerOpenServerForwardingEvent;
  pub fn set_on_open_server_forwarding(&mut self, value : &'a dyn SFTPServerOpenServerForwardingEvent);
  ...
}
```

## Remarks

This event notifies the application that a server-side forwarding channel has been set up. The *ConnectionID* parameter specifies in which session the request was received.

The *DestHost* and *DestPort* parameters specify the address that the data received from the connection accepted by the server will be forwarded to, according to the client. The *SrcHost* and *SrcPort* specify the connection origin.

# on_open_shell event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client has opened a shell channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerOpenShellEventArgs carries the SFTPServer OpenShell event's parameters.
pub struct SFTPServerOpenShellEventArgs {
  fn connection_id(&self) -> i64
}

// SFTPServerOpenShellEvent defines the signature of the SFTPServer OpenShell event's handler function.
pub trait SFTPServerOpenShellEvent {
  fn on_open_shell(&self, sender : SFTPServer, e : &mut SFTPServerOpenShellEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_open_shell(&self) -> &'a dyn SFTPServerOpenShellEvent;
  pub fn set_on_open_shell(&mut self, value : &'a dyn SFTPServerOpenShellEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received.

The component fires [on_close_shell](#on_close_shell-event-sftpserver-struct) when the shell channel is closed.

# on_read_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a file read request is received.

## Syntax

*Rust Syntax*

```text
// SFTPServerReadFileEventArgs carries the SFTPServer ReadFile event's parameters.
pub struct SFTPServerReadFileEventArgs {
  fn connection_id(&self) -> i64
  fn handle(&self) -> &String
  fn offset(&self) -> i64
  fn size(&self) -> i32
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerReadFileEvent defines the signature of the SFTPServer ReadFile event's handler function.
pub trait SFTPServerReadFileEvent {
  fn on_read_file(&self, sender : SFTPServer, e : &mut SFTPServerReadFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_read_file(&self) -> &'a dyn SFTPServerReadFileEvent;
  pub fn set_on_read_file(&mut self, value : &'a dyn SFTPServerReadFileEvent);
  ...
}
```

## Remarks

This event is fired when a request to read block from a file is received from the client. The *ConnectionID* parameter specifies in which session the request was received, and *Handle* indicates an opened file handle. *Offset* and *Size* denote the location and size of the file piece.

Inside the event handler, pass the appropriate file chunk to the component via [set_client_buffer](#set_client_buffer-method-sftpserver-struct) method.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_remove event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to delete a file or directory.

## Syntax

*Rust Syntax*

```text
// SFTPServerRemoveEventArgs carries the SFTPServer Remove event's parameters.
pub struct SFTPServerRemoveEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerRemoveEvent defines the signature of the SFTPServer Remove event's handler function.
pub trait SFTPServerRemoveEvent {
  fn on_remove(&self, sender : SFTPServer, e : &mut SFTPServerRemoveEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_remove(&self) -> &'a dyn SFTPServerRemoveEvent;
  pub fn set_on_remove(&mut self, value : &'a dyn SFTPServerRemoveEvent);
  ...
}
```

## Remarks

This event is fired when a request to delete a file or directory is received from the client. The *ConnectionID* parameter specifies in which session the request was received.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_rename_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests to rename a file.

## Syntax

*Rust Syntax*

```text
// SFTPServerRenameFileEventArgs carries the SFTPServer RenameFile event's parameters.
pub struct SFTPServerRenameFileEventArgs {
  fn connection_id(&self) -> i64
  fn old_path(&self) -> &String
  fn new_path(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerRenameFileEvent defines the signature of the SFTPServer RenameFile event's handler function.
pub trait SFTPServerRenameFileEvent {
  fn on_rename_file(&self, sender : SFTPServer, e : &mut SFTPServerRenameFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_rename_file(&self) -> &'a dyn SFTPServerRenameFileEvent;
  pub fn set_on_rename_file(&mut self, value : &'a dyn SFTPServerRenameFileEvent);
  ...
}
```

## Remarks

This event is fired when a request to rename a file (from *OldPath* to *NewPath*) is received from the client. The *ConnectionID* parameter specifies in which session the request was received.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_request_attributes event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a get file attributes request is received.

## Syntax

*Rust Syntax*

```text
// SFTPServerRequestAttributesEventArgs carries the SFTPServer RequestAttributes event's parameters.
pub struct SFTPServerRequestAttributesEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn handle(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerRequestAttributesEvent defines the signature of the SFTPServer RequestAttributes event's handler function.
pub trait SFTPServerRequestAttributesEvent {
  fn on_request_attributes(&self, sender : SFTPServer, e : &mut SFTPServerRequestAttributesEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_request_attributes(&self) -> &'a dyn SFTPServerRequestAttributesEvent;
  pub fn set_on_request_attributes(&mut self, value : &'a dyn SFTPServerRequestAttributesEvent);
  ...
}
```

## Remarks

This event is fired when a request to get file attributes is received from the client. The *ConnectionID* parameter specifies in which session the request was received, and *Path* specifies the file location where the attributes need to be retrieved.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_server_forwarding_cancel event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when the client cancels a previously negotiated server-side (remote) forwarding.

## Syntax

*Rust Syntax*

```text
// SFTPServerServerForwardingCancelEventArgs carries the SFTPServer ServerForwardingCancel event's parameters.
pub struct SFTPServerServerForwardingCancelEventArgs {
  fn connection_id(&self) -> i64
  fn local_host(&self) -> &String
  fn local_port(&self) -> i32
}

// SFTPServerServerForwardingCancelEvent defines the signature of the SFTPServer ServerForwardingCancel event's handler function.
pub trait SFTPServerServerForwardingCancelEvent {
  fn on_server_forwarding_cancel(&self, sender : SFTPServer, e : &mut SFTPServerServerForwardingCancelEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_server_forwarding_cancel(&self) -> &'a dyn SFTPServerServerForwardingCancelEvent;
  pub fn set_on_server_forwarding_cancel(&mut self, value : &'a dyn SFTPServerServerForwardingCancelEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received. The *LocalHost*:*LocalPort* specify the endpoint that the server is listening on.

After receiving the cancellation request the server will no longer listen to connections at the mentioned endpoint.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_server_forwarding_open_failed event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when the client rejects the server request to establish a server forwarding channel.

## Syntax

*Rust Syntax*

```text
// SFTPServerServerForwardingOpenFailedEventArgs carries the SFTPServer ServerForwardingOpenFailed event's parameters.
pub struct SFTPServerServerForwardingOpenFailedEventArgs {
  fn connection_id(&self) -> i64
  fn local_host(&self) -> &String
  fn local_port(&self) -> i32
  fn src_host(&self) -> &String
  fn src_port(&self) -> i32
}

// SFTPServerServerForwardingOpenFailedEvent defines the signature of the SFTPServer ServerForwardingOpenFailed event's handler function.
pub trait SFTPServerServerForwardingOpenFailedEvent {
  fn on_server_forwarding_open_failed(&self, sender : SFTPServer, e : &mut SFTPServerServerForwardingOpenFailedEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_server_forwarding_open_failed(&self) -> &'a dyn SFTPServerServerForwardingOpenFailedEvent;
  pub fn set_on_server_forwarding_open_failed(&mut self, value : &'a dyn SFTPServerServerForwardingOpenFailedEvent);
  ...
}
```

## Remarks

This event can follow the [on_before_open_server_forwarding](#on_before_open_server_forwarding-event-sftpserver-struct) and [on_open_server_forwarding](#on_open_server_forwarding-event-sftpserver-struct) if the client rejects the server request to forward an accepted TCP connection.

The *ConnectionID* parameter specifies in which session the request was received. The *LocalHost*:*LocalPort* specify the endpoint that the server has received the connection on.

# on_server_forwarding_request event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when the client requests the server to set up server-side (remote) forwarding.

## Syntax

*Rust Syntax*

```text
// SFTPServerServerForwardingRequestEventArgs carries the SFTPServer ServerForwardingRequest event's parameters.
pub struct SFTPServerServerForwardingRequestEventArgs {
  fn connection_id(&self) -> i64
  fn local_host(&self) -> &String
  fn local_port(&self) -> i32
  fn set_local_port(&self, value : i32)
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerServerForwardingRequestEvent defines the signature of the SFTPServer ServerForwardingRequest event's handler function.
pub trait SFTPServerServerForwardingRequestEvent {
  fn on_server_forwarding_request(&self, sender : SFTPServer, e : &mut SFTPServerServerForwardingRequestEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_server_forwarding_request(&self) -> &'a dyn SFTPServerServerForwardingRequestEvent;
  pub fn set_on_server_forwarding_request(&mut self, value : &'a dyn SFTPServerServerForwardingRequestEvent);
  ...
}
```

## Remarks

The *ConnectionID* parameter specifies in which session the request was received. The *LocalHost*:*LocalPort* specify the endpoint that the client expects the server to listen on. The server may choose to use a different port, in which case please adjust the *LocalPort* in the event handler.

If permitted, the server will open the requested port and start listening to incoming connections. All such connections will be reported via [on_before_open_server_forwarding](#on_before_open_server_forwarding-event-sftpserver-struct) and [on_open_server_forwarding](#on_open_server_forwarding-event-sftpserver-struct) events.

You can enable or disable server forwarding blanketly via the [capabilities](#capabilities-property-sftpserver-struct) property.

Choose *Action* as one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_session_closed event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

Reports session closure.

## Syntax

*Rust Syntax*

```text
// SFTPServerSessionClosedEventArgs carries the SFTPServer SessionClosed event's parameters.
pub struct SFTPServerSessionClosedEventArgs {
  fn connection_id(&self) -> i64
}

// SFTPServerSessionClosedEvent defines the signature of the SFTPServer SessionClosed event's handler function.
pub trait SFTPServerSessionClosedEvent {
  fn on_session_closed(&self, sender : SFTPServer, e : &mut SFTPServerSessionClosedEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_session_closed(&self) -> &'a dyn SFTPServerSessionClosedEvent;
  pub fn set_on_session_closed(&mut self, value : &'a dyn SFTPServerSessionClosedEvent);
  ...
}
```

## Remarks

This event is fired when a connection identified by *ConnectionID* has been gracefully closed.

# on_session_established event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a new session is established.

## Syntax

*Rust Syntax*

```text
// SFTPServerSessionEstablishedEventArgs carries the SFTPServer SessionEstablished event's parameters.
pub struct SFTPServerSessionEstablishedEventArgs {
  fn connection_id(&self) -> i64
}

// SFTPServerSessionEstablishedEvent defines the signature of the SFTPServer SessionEstablished event's handler function.
pub trait SFTPServerSessionEstablishedEvent {
  fn on_session_established(&self, sender : SFTPServer, e : &mut SFTPServerSessionEstablishedEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_session_established(&self) -> &'a dyn SFTPServerSessionEstablishedEvent;
  pub fn set_on_session_established(&mut self, value : &'a dyn SFTPServerSessionEstablishedEvent);
  ...
}
```

## Remarks

This event is fired when a new connection identified by *ConnectionID* has been established with a client.

# on_set_attributes event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when an set file attributes request is received.

## Syntax

*Rust Syntax*

```text
// SFTPServerSetAttributesEventArgs carries the SFTPServer SetAttributes event's parameters.
pub struct SFTPServerSetAttributesEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn handle(&self) -> &String
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerSetAttributesEvent defines the signature of the SFTPServer SetAttributes event's handler function.
pub trait SFTPServerSetAttributesEvent {
  fn on_set_attributes(&self, sender : SFTPServer, e : &mut SFTPServerSetAttributesEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_set_attributes(&self) -> &'a dyn SFTPServerSetAttributesEvent;
  pub fn set_on_set_attributes(&mut self, value : &'a dyn SFTPServerSetAttributesEvent);
  ...
}
```

## Remarks

This event is fired when a request to set file attributes is received from the client. The *ConnectionID* parameter specifies in which session the request was received, and *Path* specifies the file location which the attributes needs to be set.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# on_translate_path event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a client requests the server to translate a path to its absolute form.

## Syntax

*Rust Syntax*

```text
// SFTPServerTranslatePathEventArgs carries the SFTPServer TranslatePath event's parameters.
pub struct SFTPServerTranslatePathEventArgs {
  fn connection_id(&self) -> i64
  fn path(&self) -> &String
  fn absolute_path(&self) -> &String
  fn set_absolute_path(&self, value : &str)
  fn set_absolute_path_ref(&self, value : &String)
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SFTPServerTranslatePathEvent defines the signature of the SFTPServer TranslatePath event's handler function.
pub trait SFTPServerTranslatePathEvent {
  fn on_translate_path(&self, sender : SFTPServer, e : &mut SFTPServerTranslatePathEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_translate_path(&self) -> &'a dyn SFTPServerTranslatePathEvent;
  pub fn set_on_translate_path(&mut self, value : &'a dyn SFTPServerTranslatePathEvent);
  ...
}
```

## Remarks

This event is fired when a request to translate a relative path to the corresponding absolute path is received. The *ConnectionID* parameter specifies the session in which the request was received.

You can let the server do the translation automatically according to the default file system rules, or take care of it yourself. Use the *Action* parameter to specify who is responsible for the translation. If doing the translation manually, return the translated path via the *AbsolutePath* parameter. *Action* can take one of the following values:

|  |  |  |
| --- | --- | --- |
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |

# on_write_file event ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

This event is fired when a file write request is received.

## Syntax

*Rust Syntax*

```text
// SFTPServerWriteFileEventArgs carries the SFTPServer WriteFile event's parameters.
pub struct SFTPServerWriteFileEventArgs {
  fn connection_id(&self) -> i64
  fn handle(&self) -> &String
  fn offset(&self) -> i64
  fn operation_status(&self) -> i32
  fn set_operation_status(&self, value : i32)
}

// SFTPServerWriteFileEvent defines the signature of the SFTPServer WriteFile event's handler function.
pub trait SFTPServerWriteFileEvent {
  fn on_write_file(&self, sender : SFTPServer, e : &mut SFTPServerWriteFileEventArgs);
}

impl <'a> SFTPServer<'a> {
  pub fn on_write_file(&self) -> &'a dyn SFTPServerWriteFileEvent;
  pub fn set_on_write_file(&mut self, value : &'a dyn SFTPServerWriteFileEvent);
  ...
}
```

## Remarks

This event is fired when a request to write a data block to a file is received from the client. The *ConnectionID* parameter specifies the session the request originates from. The *Handle* parameter references the opened file where the block should be written to. *Offset* references the position in the file where the block of data should be written.

Use [get_client_buffer](#get_client_buffer-method-sftpserver-struct) method to obtain the piece of data that should be written to the file.

Set *OperationStatus* to one of the below values according to the outcome of the request processing:

|  |  |  |
| --- | --- | --- |
| ostOk | 1 |  |
| ostNoSuchFile | 2 |  |
| ostAccessDenied | 3 |  |
| ostWriteProtect | 4 |  |
| ostUnsupported | 5 |  |
| ostInvalidParameter | 6 |  |
| ostEOF | 7 |  |

# Config Settings ([SFTPServer](#struct-secureblackboxsftpserver) 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](#config-method-sftpserver-struct) method.

### SFTPServer Config Settings

**AllAlgorithms**: Returns the list of algorithms enabled in the component.Use this configuration setting to obtain the list of algorithms currently enabled in the component in the *kexinit* format.

**AsyncDataWindowManagement**: TBD.TBD

**AuthMode**: Controls dual/multi-type authentication mode.Use this setting to adjust dual/multi-step authentication mode. The value of 0 indicates that either of supported authentication methods is sufficient to authenticate the user ("any of"). The value of 1 specifies that the user should pass all the enabled methods to authenticate themselves (MFA, or "all of").

**AutoGenerateLongNames**: TBD.TBD

**Banner[i]**: TBD.TBD

**BannerSendStage**: TBD.TBD

**CloseIfNoActiveTunnels**: TBD.TBD

**CommandModeEnabled**: TBD.TBD

**CompressionAlgorithms**: Returns the list of compression algorithms enabled in the component.Use this configuration setting to get the list of compression algorithms currently enabled in the component, as a respective *kexinit* block line.

**CustomDHGroupIndex**: Sets a specific Diffie-Hellman group index to enforce.Use this property to specify a specific DH group index to enforce for key exchange. The value of -1 enables automatic group selection, and any value between 0 and 227 specifies a particular DH group supported by SecureBlackbox. This is largely a debug setting, use it with extreme care.

**DefBanner**: TBD.TBD

**DefLanguageTag**: TBD.TBD

**DualStack**: Allows the use of ip4 and ip6 simultaneously.This setting specifies a socket can use ip4 and ip6 simultaneously.

**EncryptionAlgorithms**: Returns the list of encryption algorithms enabled in the component.Use this configuration setting to get the list of symmetric encryption algorithms currently enabled in the component, as a respective *kexinit* block line.

**KexAlgorithms**: Returns the list of key exchange algorithms enabled in the component.Use this configuration setting to get the list of key exchange algorithms currently enabled in the component, as a respective *kexinit* block line.

**LanguageTag[i]**: TBD.TBD

**MacAlgorithms**: Returns the list of MAC algorithms enabled in the component.Use this configuration setting to get the list of MAC algorithms currently enabled in the component, as a respective *kexinit* block line.

**MaxDHGroupSize**: Sets the maximal Diffie-Hellman group size.This property specifies the maximal DH group size, in bits. The larger the group size, the strong the key, however, longer groups put extra burden on the computational resources. SecureBlackbox supports groups between 1024 and 8192 bits. The default value is 8192.

**MinDHGroupSize**: Sets the minimal Diffie-Hellman group size.This property specifies the minimal DH group size, in bits. The larger the group size, the strong the key, however, longer groups put extra burden on the computational resources. SecureBlackbox supports groups between 1024 and 8192 bits. The default value is 2048.

**NotifyOnFileOperations**: Enables low-level file operation notifications.If set, the component will report low-level file operations, such as Open, Read, Write, and Close, via its Notification event.

**PublicKeyAlgorithms**: Returns the list of public key algorithms enabled in the component.Use this configuration setting to get the list of public key algorithms currently enabled in the component, as a respective *kexinit* block line.

**RefreshUsers**: Enables or disables real-time propagation of user information.Set this property to true to make the content of the Users property propagate to the server immediately. The default setting is false, which delays the effect of any changes in the Users setting until the server is restarted.

**SFTPModeEnabled**: TBD.TBD

**ShellModeEnabled**: TBD.TBD

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

Since both client and server must implement strict key exchange to effectively mitigate the Terrapin attack, the 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

**ASN1UseGlobalTagCache**: Controls whether ASN.1 module should use a global object cache.This is a performance setting. It is unlikely that you will ever need to adjust it.

**AssignSystemSmartCardPins**: Specifies whether CSP-level PINs should be assigned to CNG keys.This is a low-level tweak for certain cryptographic providers. It is unlikely that you will ever need to adjust it.

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

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

**CookieCaching**: Specifies whether a cookie cache should be used for HTTP(S) transports.Set this property to enable or disable cookies caching for the struct.

Supported values are:

|  |  |  |
| --- | --- | --- |
| off |  | No caching (default) |
| local |  | Local caching |
| global |  | Global caching |

**Cookies**: Gets or sets local cookies for the struct.Use this property to get cookies from the internal cookie storage of the struct and/or restore them back between application sessions.

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

**DNSLocalSuffix**: The suffix to assign for TLD names.Use this global setting to adjust the default suffix to assign to top-level domain names. The default is *.local*.

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

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

**EnableSSHMLKEM**: Enables support for ML-KEM/hybrid key exchange algorithms in SSH client and server components.Use this setting to enable hybrid key exchange algorithms in client and server SSH and SFTP components. This is a global setting that enables ML-KEM blanketly in all SSH-dependent components.

**EnableTLSMLKEM**: Enables support for ML-KEM and hybrid groups in TLS client and server components.Use this setting to enable ML-KEM and hybrid key exchange groups in client and server TLS components. This is a global setting that enables ML-KEM blanketly in all TLS-dependent components.

**GlobalCookies**: Gets or sets global cookies for all the HTTP transports.Use this property to get cookies from the GLOBAL cookie storage or restore them back between application sessions. These cookies will be used by all the structs that have its *CookieCaching* property set to "global".

**HardwareCryptoUsePolicy**: The hardware crypto usage policy.This global setting controls the hardware cryptography usage policy.

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. |

**HttpUserAgent**: Specifies the user agent name to be used by all HTTP clients.This global setting defines the User-Agent field of the HTTP request provides information about the software that initiates the request. This value will be used by all the HTTP clients including the ones used internally in other structs.

**HttpVersion**: The HTTP version to use in any inner HTTP client components created.Set this property to 1.0 or 1.1 to indicate the HTTP version that any internal HTTP clients should use.

**IgnoreExpiredMSCTLSigningCert**: Whether to tolerate the expired Windows Update signing certificate.It is not uncommon for Microsoft Windows Update Certificate Trust List to be signed with an expired Microsoft certificate. Setting this global property to true makes SBB ignore the expired factor and take the Trust List into account.

**ListDelimiter**: The delimiter character for multi-element lists.Allows to set the delimiter for any multi-entry values returned by the component as a string object, such as file lists. For most of the components, this property is set to a newline sequence.

**LogDestination**: Specifies the debug log destination.Contains a comma-separated list of values that specifies where debug log should be dumped.

Supported values are:

|  |  |  |
| --- | --- | --- |
| file |  | File |
| console |  | Console |
| systemlog |  | System Log (supported for Android only) |
| debugger |  | Debugger (supported for VCL for Windows and .Net) |

**LogDetails**: Specifies the debug log details to dump.Contains a comma-separated list of values that specifies which debug log details to dump.

Supported values are:

|  |  |  |
| --- | --- | --- |
| 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 |

**LogFile**: Specifies the debug log filename.Use this property to provide a path to the log file.

**LogFilters**: Specifies the debug log filters.Contains a comma-separated list of value pairs ("name:value") that describe filters.

Supported filter names are:

|  |  |  |
| --- | --- | --- |
| exclude-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 |

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

|  |  |  |
| --- | --- | --- |
| none |  | No flush (caching only) |
| immediate |  | Immediate flush (real-time logging) |
| maxcount |  | Flush cached entries upon reaching LogMaxEventCount entries in the cache. |

**LogLevel**: Specifies the debug log level.Use this property to provide the desired debug log level.

Supported values are:

|  |  |  |
| --- | --- | --- |
| 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. |

**LogMaxEventCount**: Specifies the maximum number of events to cache before further action is taken.Use this property to specify the log event number threshold. This threshold may have different effects, depending on the rotation setting and/or the flush mode.

The default value of this setting is 100.

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

|  |  |  |
| --- | --- | --- |
| 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) |

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

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

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

**OldClientSideRSAFallback**: Specifies whether the SSH client should use a SHA1 fallback.Tells the SSH client to use a legacy ssh-rsa authentication even if the server indicates support for newer algorithms, such as rsa-sha-256. This is a backward-compatibility tweak.

**PKICache**: Specifies which PKI elements (certificates, CRLs, OCSP responses) should be cached.The PKICache setting specifies which Public Key Infrastructure (PKI) elements should be cached to optimize performance and reduce retrieval times. It supports comma-separated values to indicate the specific types of PKI data that should be cached.

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):

```text
PKICache=certificate,crl,ocsp
```

 In this example, the component caches certificates, CRLs, and OCSP responses.

**PKICachePath**: Specifies the file system path where cached PKI data is stored.The PKICachePath setting defines the file system path where cached PKI data (e.g., certificates, CRLs, OCSP responses and Trusted Lists) will be stored. This allows the system to persistently save and retrieve PKI cache data, even across application restarts.

The default value is an empty string - no cached PKI data is stored on disk.

Example:

```text
PKICachePath=C:\Temp\cache
```

 In this example, the cached PKI data is stored in the C:\Temp\cache directory.

**ProductVersion**: Returns the version of the SecureBlackbox library.This property returns the long version string of the SecureBlackbox library being used (major.minor.build.revision).

**ServerSSLDHKeyLength**: Sets the size of the TLS DHE key exchange group.Use this property to adjust the length, in bits, of the DHE prime to be used by the TLS server.

**StaticDNS**: Specifies whether static DNS rules should be used.Set this property to enable or disable static DNS rules for the struct. Works only if *UseOwnDNSResolver* is set to *true*.

Supported values are:

|  |  |  |
| --- | --- | --- |
| none |  | No static DNS rules (default) |
| local |  | Local static DNS rules |
| global |  | Global static DNS rules |

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

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

**Tag**: Allows to store any custom data.Use this config property to store any custom data.

**TLSSessionGroup**: Specifies the group name of TLS sessions to be used for session resumption.Use this property to limit the search of cached TLS sessions to the specified group. Sessions from other groups will be ignored. By default, all sessions are cached with an empty group name and available to all the structs.

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

**TLSSessionPurgeInterval**: Specifies how often the session cache should remove the expired TLS sessions.Use this property to specify the time interval of purging the expired TLS sessions from the session cache. Default value is 60 seconds (1 minute).

**UseCRLObjectCaching**: Specifies whether reuse of loaded CRL objects is enabled.This setting enables or disables the caching of CRL objects. When set to true (the default value), the system checks if a CRL object is already loaded in memory before attempting to load a new instance. If the object is found, the existing instance is reused, and its reference count is incremented to track its usage. When the reference count reaches zero, indicating that no references to the object remain, the system will free the object from memory. This setting enhances performance by minimizing unnecessary object instantiation and promotes efficient memory management, particularly in scenarios where CRL objects are frequently used.

**UseInternalRandom**: Switches between SecureBlackbox-own and platform PRNGs.Allows to switch between internal/native PRNG implementation and the one provided by the platform.

**UseLegacyAdESValidation**: Enables legacy AdES validation mode.Use this setting to switch the AdES component to the validation approach that was used in SBB 2020/SBB 2022 (less attention to temporal details).

**UseOCSPResponseObjectCaching**: Specifies whether reuse of loaded OCSP response objects is enabled.This setting enables or disables the caching of OCSP response objects. When set to true (the default value), the system checks if a OCSP response object is already loaded in memory before attempting to load a new instance. If the object is found, the existing instance is reused, and its reference count is incremented to track its usage. When the reference count reaches zero, indicating that no references to the object remain, the system will free the object from memory. This setting enhances performance by minimizing unnecessary object instantiation and promotes efficient memory management, particularly in scenarios where OCSP response objects are frequently used.

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

**UseSharedSystemStorages**: Specifies whether the validation engine should use a global per-process copy of the system certificate stores.Set this global property to false to make each validation run use its own copy of system certificate stores.

**UseSystemNativeSizeCalculation**: An internal CryptoAPI access tweak.This is an internal setting. Please do not use it unless instructed by the support team.

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

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

**UseSystemRandom**: Enables or disables the use of the OS PRNG.Use this global property to enable or disable the use of operating system-driven pseudorandom number generation.

**XMLRDNDescriptorName[OID]**: Defines an OID mapping to descriptor names for the certificate's IssuerRDN or SubjectRDN.This property defines custom mappings between Object Identifiers (OIDs) and descriptor names. This mapping specifies how the certificate's issuer and subject information (ds:IssuerRDN and ds:SubjectRDN elements respectively) are represented in XML signatures.

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:

```text
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:

```text
Config("XMLRDNDescriptorName[2.5.4.5]=SERIALNUMBER");
```

Map OID 1.2.840.113549.1.9.1 to E, with aliases EMAIL and EMAILADDRESS:

```text
Config("XMLRDNDescriptorName[1.2.840.113549.1.9.1]=E,EMAIL,EMAILADDRESS");
```

**XMLRDNDescriptorPriority[OID]**: Specifies the priority of descriptor names associated with a specific OID.This property specifies the priority of descriptor names associated with a specific OID that allows to reorder descriptors in the ds:IssuerRDN and ds:SubjectRDN elements during signing.

**XMLRDNDescriptorReverseOrder**: Specifies whether to reverse the order of descriptors in RDN.Specifies whether to reverse the order of descriptors in the ds:IssuerRDN and ds:SubjectRDN elements during XML signing. By default, this property is set to true (as specified in RFC 2253, 2.1).

**XMLRDNDescriptorSeparator**: Specifies the separator used between descriptors in RDN.Specifies the separator used between descriptors in the ds:IssuerRDN and ds:SubjectRDN elements during XML signing. By default, this property is set to ", " value.

# Trappable Errors ([SFTPServer](#struct-secureblackboxsftpserver) Struct)

### SFTPServer Errors

|  |  |
| --- | --- |
| 1048577 | Invalid parameter ([SB_ERROR_INVALID_PARAMETER](constants.md#const_SBERRORINVALIDPARAMETER)) |
| 1048578 | Invalid configuration ([SB_ERROR_INVALID_SETUP](constants.md#const_SBERRORINVALIDSETUP)) |
| 1048579 | Invalid state ([SB_ERROR_INVALID_STATE](constants.md#const_SBERRORINVALIDSTATE)) |
| 1048580 | Invalid value ([SB_ERROR_INVALID_VALUE](constants.md#const_SBERRORINVALIDVALUE)) |
| 1048581 | Private key not found ([SB_ERROR_NO_PRIVATE_KEY](constants.md#const_SBERRORNOPRIVATEKEY)) |
| 1048582 | Cancelled by the user ([SB_ERROR_CANCELLED_BY_USER](constants.md#const_SBERRORCANCELLEDBYUSER)) |
| 1048583 | The file was not found ([SB_ERROR_NO_SUCH_FILE](constants.md#const_SBERRORNOSUCHFILE)) |
| 1048584 | Unsupported feature or operation ([SB_ERROR_UNSUPPORTED_FEATURE](constants.md#const_SBERRORUNSUPPORTEDFEATURE)) |
| 1048585 | General error ([SB_ERROR_GENERAL_ERROR](constants.md#const_SBERRORGENERALERROR)) |
| 31457281 | Unsupported file operation ([SB_ERROR_SFTP_UNSUPPORTED_FILE_OPERATION](constants.md#const_SBERRORSFTPUNSUPPORTEDFILEOPERATION)) |
| 31457282 | Invalid authentication type ([SB_ERROR_SFTP_INVALID_AUTH_TYPE](constants.md#const_SBERRORSFTPINVALIDAUTHTYPE)) |
