Struct secureblackbox::SSHClient

Properties   Methods   Events   Config Settings   Errors  

The SSHClient struct provides client-side SSH protocol functionality.

Syntax

secureblackbox::SSHClient

Remarks

Use SSHClient to establish terminal-like connections to remote systems and run commands remotely. The component supports most of third-party implementations out there, and is capable of working in "shell" and "command" modes.

Start with assigning your sign-in credentials to username and password properties. Where public key authentication is to be used, assign your private authentication key to key property (remember to set username in this case too). Subscribe to events to be notified of the session progress. on_auth_failed, on_auth_succeeded, and on_connect are among those particularly useful.

Special attention should be paid to setting up the server key trust. Struct only allows connections to servers whose public keys are recognized as trusted, much like any other SSH clients do. Assign a path to the file containing the list of trusted keys to trusted_keys_file property. If you don't have such file, or if you would like to make trust decisions on the fly, subscribe to on_known_key_received and on_unknown_key_received events. These are fired whenever a trusted or untrusted key is received from the server. For unknown/untrusted keys, you need to set the Action parameter in your on_unknown_key_received event handler to catAcceptOnce (1) or catAcceptPermanently (2) for the connection to proceed.

Once you are all set up, you can go ahead by calling the connect method. This launches the SSH handshake and, if everything has been set up right, establishes a connection to the server. You can now use send and receive methods to exchange information with the server. You can exchange data in synchronous or asynchronous way; see the description in async_mode topic to learn more about each mode.

When you are done with the session, call disconnect to shut the connection down.

Hint: If you are only interested in a quick-and-dirty execution of a simple, non-interactive command, SSHClient offers a handy shortcut. connect_and_exec method is a self-contained mechanism which sets up a connection, performs the data exchange internally, and returns the command output. Please keep in mind that you still need to set up the server trust settings as described above for this method to work.

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

async_modeControls the SSH clients mode of work.
auth_attemptsSpecifies the number of SSH password authentication attempts.
commandsSpecifies the list of commands to execute.
connectedSpecifies whether the client is connected to the SFTP server.
conn_info_client_key_algorithmSpecifies the client's key algorithm.
conn_info_client_key_bitsSpecifies the length of the client's key.
conn_info_client_key_fingerprintThe fingerprint (hash value) of the client's public key.
conn_info_close_reasonContains the line sent by the server just before closing the connection.
conn_info_compression_algorithm_inboundCompression algorithm for the incoming traffic.
conn_info_compression_algorithm_outboundCompression algorithm for the outgoing traffic.
conn_info_encryption_algorithm_inboundEncryption algorithm for the incoming traffic.
conn_info_encryption_algorithm_outboundEncryption algorithm for the outgoing traffic.
conn_info_inbound_encryption_key_bitsSpecifies the length of the key used to encrypt the incoming traffic.
conn_info_kex_algorithmThe key exchange algorithm used during the SSH handshake.
conn_info_kex_bitsThe number of bits used by the key exchange algorithm.
conn_info_kex_linesThe contents of the received KexInit packet.
conn_info_mac_algorithm_inboundMAC algorithm used for the incoming connection.
conn_info_mac_algorithm_outboundMAC algorithm used for outbound connection.
conn_info_outbound_encryption_key_bitsSpecifies the length of the key used to encrypt the outgoing traffic.
conn_info_public_key_algorithmSpecifies the public key algorithm which was used during the SSH handshake.
conn_info_remote_addressThe client's IP address.
conn_info_remote_portThe remote port of the client connection.
conn_info_remote_software_nameReturns the name (self-advertised) of the SSH software running on the other side.
conn_info_server_key_algorithmSpecifies the server's key algorithm.
conn_info_server_key_bitsSpecifies the number of bits in the server's key.
conn_info_server_key_fingerprintThe fingerprint (hash value) of the server's public key.
conn_info_total_bytes_receivedReturns the total number of bytes received over this connection.
conn_info_total_bytes_sentReturns the total number of bytes sent over this connection.
conn_info_versionSpecifies SSH protocol version.
exit_messageContains the last commands exit message.
exit_signalContains the last commands exit signal.
exit_statusContains the last commands exit status.
external_crypto_async_document_idSpecifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls.
external_crypto_custom_paramsCustom parameters to be passed to the signing service (uninterpreted).
external_crypto_dataAdditional data to be included in the async state and mirrored back by the requestor.
external_crypto_external_hash_calculationSpecifies whether the message hash is to be calculated at the external endpoint.
external_crypto_hash_algorithmSpecifies the request's signature hash algorithm.
external_crypto_key_idThe ID of the pre-shared key used for DC request authentication.
external_crypto_key_secretThe pre-shared key used for DC request authentication.
external_crypto_methodSpecifies the asynchronous signing method.
external_crypto_modeSpecifies the external cryptography mode.
external_crypto_public_key_algorithmProvide the public key algorithm here if the certificate is not available on the pre-signing stage.
fips_modeReserved.
key_fingerprint_sha1Contains the SHA-1 fingerprint (hash) of the key.
key_fingerprint_sha256Contains the SHA-256 fingerprint (hash) of the key.
key_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
passwordSpecifies user's password on the server.
proxy_settings_addressThe IP address of the proxy server.
proxy_settings_authenticationThe authentication type used by the proxy server.
proxy_settings_passwordThe password to authenticate to the proxy server.
proxy_settings_portThe port on the proxy server to connect to.
proxy_settings_proxy_typeThe type of the proxy server.
proxy_settings_request_headersContains HTTP request headers for WebTunnel and HTTP proxy.
proxy_settings_response_bodyContains the HTTP or HTTPS (WebTunnel) proxy response body.
proxy_settings_response_headersContains response headers received from an HTTP or HTTPS (WebTunnel) proxy server.
proxy_settings_use_ipv6Specifies whether IPv6 should be used when connecting through the proxy.
proxy_settings_usernameSpecifies the username credential for proxy authentication.
server_key_algorithmSpecifies the key algorithm.
server_key_bitsThe number of bits in the key: the more the better, 2048 or 4096 are typical values.
server_key_commentThe comment for the public key.
server_key_curveSpecifies the elliptical curve when EC cryptography is used.
server_key_extractableWhether the key is extractable (e.
server_key_fingerprint_md5Contains the MD5 fingerprint (hash) of the key.
server_key_fingerprint_sha1Contains the SHA-1 fingerprint (hash) of the key.
server_key_fingerprint_sha256Contains the SHA-256 fingerprint (hash) of the key.
server_key_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
server_key_key_formatSpecifies the format in which the key is stored.
server_key_key_protection_algorithmSpecifies the key protection algorithm.
server_key_privateWhether this key is a private key or not.
server_key_publicWhether this key is a public key or not.
server_key_subjectSpecifies the public key owner (subject).
socket_dns_modeSelects the DNS resolver to use: the struct's (secure) built-in one, or the one provided by the system.
socket_dns_portSpecifies the port number to be used for sending queries to the DNS server.
socket_dns_query_timeoutThe timeout (in milliseconds) for each DNS query.
socket_dns_serversThe addresses of DNS servers to use for address resolution, separated by commas or semicolons.
socket_dns_total_timeoutThe timeout (in milliseconds) for the whole resolution process.
socket_incoming_speed_limitThe maximum number of bytes to read from the socket, per second.
socket_local_addressThe local network interface to bind the socket to.
socket_local_portThe local port number to bind the socket to.
socket_outgoing_speed_limitThe maximum number of bytes to write to the socket, per second.
socket_timeoutThe maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
socket_use_ipv6Enables or disables IP protocol version 6.
ssh_settings_auto_adjust_ciphersWhether 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_configurationAllows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
ssh_settings_compression_algorithmsA list of session compression algorithms separated with commas or semicolons.
ssh_settings_compression_levelPossible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).
ssh_settings_default_window_sizeThe 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_algorithmsA list of session encryption algorithms separated with commas or semicolons.
ssh_settings_force_compressionWhether the SSH client should explicitly request compression.
ssh_settings_forward_auth_agentEnables or disables auth agent forwarding.
ssh_settings_gss_auth_typesA comma-separated list of authentication types.
ssh_settings_gss_delegate_credsSwitches credential delegation on or off.
ssh_settings_gss_hostnameThe GSS host name, in form of a FQDN (e.
ssh_settings_gss_libA path to the GSS-API library (DLL or SO).
ssh_settings_gss_mechanismsA comma-separated list of GSS mechanisms to use.
ssh_settings_gss_protocolsA comma-separated list of SSPI protocols.
ssh_settings_handshake_timeoutSpecifies the maximal time for the SSH handshake to proceed, in seconds.
ssh_settings_kex_algorithmsA list of key exchange algorithms separated with commas or semicolons.
ssh_settings_mac_algorithmsA list of MAC (for message authentication code ) algorithms separated with commas or semicolons.
ssh_settings_max_ssh_packet_sizeSpecifies the maximum length of one SSH packet in bytes.
ssh_settings_min_window_sizeSpecifies the minimal internal window size.
ssh_settings_obfuscate_handshakeEnables or disables handshake obfuscation.
ssh_settings_obfuscation_passwordSpecifies the password used to encrypt the handshake when ObfuscateHandshake is set.
ssh_settings_public_key_algorithmsA list of public key algorithms separated with commas or semicolons.
ssh_settings_request_password_changeWhether to request a password change when connecting.
ssh_settings_software_nameThe name to be used by the struct to identify itself.
ssh_settings_trust_all_keysEnables or disables explicit trust to all server keys.
ssh_settings_use_auth_agentEnables or disables the use of external key agent, such as Putty key agent.
ssh_settings_versionsSpecifies enabled SSH protocol versions (1 or 2).
subsystemSpecifies the subsystem to request from the server.
terminal_colsSpecifies the width of the pseudoterminal, in characters.
terminal_environmentSpecifies the list of environment variables.
terminal_eol_charSpecifies the End-of-Line character or sequence.
terminal_heightSpecifies the height of the pseudoterminal, in pixels.
terminal_opcodesSpecifies the operation codes specific for the terminal.
terminal_protocolThe terminal protocol name.
terminal_request_ptySpecifies whether to request a pseudoterminal for the session.
terminal_rowsSpecifies the height of the pseudoterminal, in lines.
terminal_widthSpecifies the width of the pseudoterminal, in pixels.
trusted_keys_filePath to the file containing public keys of authorized servers.
usernameSpecifies client's username on the server.

Method List


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

configSets or retrieves a configuration setting.
connectEstablishes connection to an SSH server.
connect_and_execConnects to an SSH server and executes a command in one go.
disconnectCloses connection to the SSH server.
do_actionPerforms an additional action.
pingSends a keep-alive request to the SSH server.
pollChecks whether there is any inbound data readily available.
receiveReads a portion of received data into a string.
receive_bytesReads a portion of received data into a byte array.
receive_bytes_fromReads a portion of data received via a specific channel into a byte array.
receive_fromReads a portion of data received via a specific channel into a string.
resetResets the struct settings.
sendSends a string to the server.
send_bytesSends an array of bytes to the server.
send_specialSends a special character to the server or remote command.

Event List


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

on_auth_attemptFires when a single authentication attempt is performed.
on_auth_failedFires when a single authentication attempt is failed.
on_auth_succeededReports a successful authentication.
on_bannerReports the receipt of the Hello message from the server.
on_command_completedSignifies completion of the command execution.
on_command_startMarks the commencement of a command execution.
on_connectThis event is fired when an SSH session has been established.
on_data_receivedReports receipt of another chunk of data from the server.
on_data_sentNotifies the application that a piece of data has been sent to the server.
on_disconnectThis event is fired when the SFTP subsystem connection is closed.
on_errorInformation about errors during SFTP connection.
on_external_signHandles remote or external signing initiated by the SignExternal method or other source.
on_known_key_receivedSignals that the server has introduced itself with a known key.
on_notificationThis event notifies the application about an underlying control flow event.
on_password_change_requestThis event is fired when a password change is requested.
on_private_key_neededThis event is fired when client's public key was accepted by the server, but the corresponding secret key is not available.
on_unknown_key_receivedSignals that the server has introduced itself with an unknown key.

Config Settings


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

AllAlgorithmsReturns the list of algorithms enabled in the struct.
BlockSizeThe data block size.
CommandTimeoutSpecifies the command timeout.
CompressionAlgorithmsReturns the list of compression algorithms enabled in the struct.
EarlyIdStringEnables the proactive approach to SSH handshake.
EncryptionAlgorithmsReturns the list of encryption algorithms enabled in the struct.
ErrorOriginSpecifies whether the error is local or remote.
ErrorSeveritySpecifies whether the error is fatal.
KexAlgorithmsReturns the list of key exchange algorithms enabled in the struct.
LocalCharsetCharset used on the client machine.
MacAlgorithmsReturns the list of MAC algorithms enabled in the struct.
PublicKeyAlgorithmsReturns the list of public key algorithms enabled in the struct.
RemoteCharsetCharset used on the server.
SendCommandEOFDefines whether EOF control character should be sent after the command data.
ThrottleControlEnables or disables throttle control for the connection.
UseStrictKeyExchangeSpecifies how strict key exchange is supported.
ASN1UseGlobalTagCacheControls whether ASN.1 module should use a global object cache.
AssignSystemSmartCardPinsSpecifies whether CSP-level PINs should be assigned to CNG keys.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the struct.
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
DNSLocalSuffixThe suffix to assign for TLD names.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
EnableSSHMLKEMEnables support for ML-KEM/hybrid key exchange algorithms in SSH client and server structs.
EnableTLSMLKEMEnables support for ML-KEM and hybrid groups in TLS client and server structs.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HardwareCryptoUsePolicyThe hardware crypto usage policy.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
HttpVersionThe HTTP version to use in any inner HTTP client structs created.
IgnoreExpiredMSCTLSigningCertWhether to tolerate the expired Windows Update signing certificate.
ListDelimiterThe delimiter character for multi-element lists.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
OldClientSideRSAFallbackSpecifies whether the SSH client should use a SHA1 fallback.
PKICacheSpecifies which PKI elements (certificates, CRLs, OCSP responses) should be cached.
PKICachePathSpecifies the file system path where cached PKI data is stored.
ProductVersionReturns the version of the SecureBlackbox library.
ServerSSLDHKeyLengthSets the size of the TLS DHE key exchange group.
StaticDNSSpecifies whether static DNS rules should be used.
StaticIPAddress[domain]Gets or sets an IP address for the specified domain name.
StaticIPAddressesGets or sets all the static DNS rules.
TagAllows to store any custom data.
TLSSessionGroupSpecifies the group name of TLS sessions to be used for session resumption.
TLSSessionLifetimeSpecifies lifetime in seconds of the cached TLS session.
TLSSessionPurgeIntervalSpecifies how often the session cache should remove the expired TLS sessions.
UseCRLObjectCachingSpecifies whether reuse of loaded CRL objects is enabled.
UseInternalRandomSwitches between SecureBlackbox-own and platform PRNGs.
UseLegacyAdESValidationEnables legacy AdES validation mode.
UseOCSPResponseObjectCachingSpecifies whether reuse of loaded OCSP response objects is enabled.
UseOwnDNSResolverSpecifies whether the client structs should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemNativeSizeCalculationAn internal CryptoAPI access tweak.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.
XMLRDNDescriptorName[OID]Defines an OID mapping to descriptor names for the certificate's IssuerRDN or SubjectRDN.
XMLRDNDescriptorPriority[OID]Specifies the priority of descriptor names associated with a specific OID.
XMLRDNDescriptorReverseOrderSpecifies whether to reverse the order of descriptors in RDN.
XMLRDNDescriptorSeparatorSpecifies the separator used between descriptors in RDN.

async_mode property (SSHClient Struct)

Controls the SSH clients mode of work.

Syntax

fn async_mode(&self ) -> Result<bool, SecureBlackboxError> 
fn set_async_mode(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

This property defines the way in which the struct communicates with the application/user code. async_mode set to false makes the component use synchronous single-thread approach. Synchronous mode is generally simpler to integrate and use, but please keep in mind that the calls like connect, receive or send_bytes may block until their execution completes. In asynchronous mode all operations return immediately, but more care should be taken about handling them in your code properly.

Here are a few highlights of each mode.

Synchronous mode:

  • All operations are performed within the caller thread context
  • Operations like connect or send_bytes may block
  • Use poll to check for the availability of data before reading it out with receive or receive_bytes
  • Return of a call guarantees completion of the operation
  • Connection errors are reported straight from the methods via exceptions

Asynchronous mode:

  • All operations are performed in a separate thread (and so are the event calls!)
  • Methods like send return immediately
  • Use on_data_sent and on_data_received events to be notified about actual data transmissions
  • Return of call only marks the beginning of the operation and does not guarantee its successful completion
  • Connection errors are reported via on_error event, often followed by on_disconnect.

Please note that this is a very important and sensitive property, which has a wide-scale effect on the way the SSH client works and co-operates with the application. Depending on the value assigned to this setting you may need to work with the component very differently.

When setting this property to true, please make sure that your code is prepared to handle events coming from the context of a different thread.

Data Type

bool

auth_attempts property (SSHClient Struct)

Specifies the number of SSH password authentication attempts.

Syntax

fn auth_attempts(&self ) -> Result<i32, SecureBlackboxError> 
fn set_auth_attempts(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

1

Remarks

In case of password authentication failure provide new password inside the on_auth_failed event handler.

Data Type

i32

commands property (SSHClient Struct)

Specifies the list of commands to execute.

Syntax

fn commands(&self ) -> Result<String, SecureBlackboxError> 
fn set_commands(&self, value : &str) -> Option<SecureBlackboxError> fn set_commands_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Use this property to provide a list of commands to execute remotely. Separate different commands with EOL characters.

When this property is set, the component works in the command mode, meaning each command is executed in its own virtual terminal session. No shell connection is established.

If no commands are provided via this property, the component will establish a shell session.

Data Type

String

connected property (SSHClient Struct)

Specifies whether the client is connected to the SFTP server.

Syntax

fn connected(&self ) -> Result<bool, SecureBlackboxError> 

Default Value

false

Remarks

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

This property is read-only.

Data Type

bool

conn_info_client_key_algorithm property (SSHClient Struct)

Specifies the client's key algorithm.

Syntax

fn conn_info_client_key_algorithm(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Specifies the client's key algorithm.

This property is read-only.

Data Type

String

conn_info_client_key_bits property (SSHClient Struct)

Specifies the length of the client's key.

Syntax

fn conn_info_client_key_bits(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

Specifies the length of the client's key.

This property is read-only.

Data Type

i32

conn_info_client_key_fingerprint property (SSHClient Struct)

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

Syntax

fn conn_info_client_key_fingerprint(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

conn_info_close_reason property (SSHClient Struct)

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

Syntax

fn conn_info_close_reason(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

conn_info_compression_algorithm_inbound property (SSHClient Struct)

Compression algorithm for the incoming traffic.

Syntax

fn conn_info_compression_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Compression algorithm for the incoming traffic.

This property is read-only.

Data Type

String

conn_info_compression_algorithm_outbound property (SSHClient Struct)

Compression algorithm for the outgoing traffic.

Syntax

fn conn_info_compression_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Compression algorithm for the outgoing traffic.

This property is read-only.

Data Type

String

conn_info_encryption_algorithm_inbound property (SSHClient Struct)

Encryption algorithm for the incoming traffic.

Syntax

fn conn_info_encryption_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Encryption algorithm for the incoming traffic.

This property is read-only.

Data Type

String

conn_info_encryption_algorithm_outbound property (SSHClient Struct)

Encryption algorithm for the outgoing traffic.

Syntax

fn conn_info_encryption_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Encryption algorithm for the outgoing traffic.

This property is read-only.

Data Type

String

conn_info_inbound_encryption_key_bits property (SSHClient Struct)

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

Syntax

fn conn_info_inbound_encryption_key_bits(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

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

This property is read-only.

Data Type

i32

conn_info_kex_algorithm property (SSHClient Struct)

The key exchange algorithm used during the SSH handshake.

Syntax

fn conn_info_kex_algorithm(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

The key exchange algorithm used during the SSH handshake.

This property is read-only.

Data Type

String

conn_info_kex_bits property (SSHClient Struct)

The number of bits used by the key exchange algorithm.

Syntax

fn conn_info_kex_bits(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

The number of bits used by the key exchange algorithm.

This property is read-only.

Data Type

i32

conn_info_kex_lines property (SSHClient Struct)

The contents of the received KexInit packet.

Syntax

fn conn_info_kex_lines(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

The contents of the received KexInit packet.

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

This property is read-only.

Data Type

String

conn_info_mac_algorithm_inbound property (SSHClient Struct)

MAC algorithm used for the incoming connection.

Syntax

fn conn_info_mac_algorithm_inbound(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

MAC algorithm used for the incoming connection.

This property is read-only.

Data Type

String

conn_info_mac_algorithm_outbound property (SSHClient Struct)

MAC algorithm used for outbound connection.

Syntax

fn conn_info_mac_algorithm_outbound(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

MAC algorithm used for outbound connection.

This property is read-only.

Data Type

String

conn_info_outbound_encryption_key_bits property (SSHClient Struct)

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

Syntax

fn conn_info_outbound_encryption_key_bits(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

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

This property is read-only.

Data Type

i32

conn_info_public_key_algorithm property (SSHClient Struct)

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

Syntax

fn conn_info_public_key_algorithm(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

conn_info_remote_address property (SSHClient Struct)

The client's IP address.

Syntax

fn conn_info_remote_address(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

The client's IP address.

This property is read-only.

Data Type

String

conn_info_remote_port property (SSHClient Struct)

The remote port of the client connection.

Syntax

fn conn_info_remote_port(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

The remote port of the client connection.

This property is read-only.

Data Type

i32

conn_info_remote_software_name property (SSHClient Struct)

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

Syntax

fn conn_info_remote_software_name(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

conn_info_server_key_algorithm property (SSHClient Struct)

Specifies the server's key algorithm.

Syntax

fn conn_info_server_key_algorithm(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Specifies the server's key algorithm.

This property is read-only.

Data Type

String

conn_info_server_key_bits property (SSHClient Struct)

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

Syntax

fn conn_info_server_key_bits(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

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

This property is read-only.

Data Type

i32

conn_info_server_key_fingerprint property (SSHClient Struct)

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

Syntax

fn conn_info_server_key_fingerprint(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

conn_info_total_bytes_received property (SSHClient Struct)

Returns the total number of bytes received over this connection.

Syntax

fn conn_info_total_bytes_received(&self ) -> Result<i64, SecureBlackboxError> 

Default Value

0

Remarks

Returns the total number of bytes received over this connection.

This property is read-only.

Data Type

i64

conn_info_total_bytes_sent property (SSHClient Struct)

Returns the total number of bytes sent over this connection.

Syntax

fn conn_info_total_bytes_sent(&self ) -> Result<i64, SecureBlackboxError> 

Default Value

0

Remarks

Returns the total number of bytes sent over this connection.

This property is read-only.

Data Type

i64

conn_info_version property (SSHClient Struct)

Specifies SSH protocol version.

Syntax

fn conn_info_version(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

2

Remarks

Specifies SSH protocol version.

This property is read-only.

Data Type

i32

exit_message property (SSHClient Struct)

Contains the last commands exit message.

Syntax

fn exit_message(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Use this property to access the exit message of the last command or shell session. This property normally gets assigned if the command or shell was closed due to an error.

This property is read-only.

Data Type

String

exit_signal property (SSHClient Struct)

Contains the last commands exit signal.

Syntax

fn exit_signal(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Use this property to access the exit signal of the last command or shell session. This property normally gets assigned if the command or shell was closed due to an error.

This property is read-only.

Data Type

String

exit_status property (SSHClient Struct)

Contains the last commands exit status.

Syntax

fn exit_status(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

Check this property to obtain the exit status (also sometimes referred to as errorlevel) of the last command or shell session.

This property is read-only.

Data Type

i32

external_crypto_async_document_id property (SSHClient Struct)

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

Syntax

fn external_crypto_async_document_id(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_async_document_id(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_async_document_id_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

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

Data Type

String

external_crypto_custom_params property (SSHClient Struct)

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

Syntax

fn external_crypto_custom_params(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_custom_params(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_custom_params_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

external_crypto_data property (SSHClient Struct)

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

Syntax

fn external_crypto_data(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_data(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_data_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

external_crypto_external_hash_calculation property (SSHClient Struct)

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

Syntax

fn external_crypto_external_hash_calculation(&self ) -> Result<bool, SecureBlackboxError> 
fn set_external_crypto_external_hash_calculation(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

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

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

Data Type

bool

external_crypto_hash_algorithm property (SSHClient Struct)

Specifies the request's signature hash algorithm.

Syntax

fn external_crypto_hash_algorithm(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_hash_algorithm(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_hash_algorithm_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

"SHA256"

Remarks

Specifies the request's signature hash algorithm.

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

Data Type

String

external_crypto_key_id property (SSHClient Struct)

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

Syntax

fn external_crypto_key_id(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_key_id(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_key_id_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

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

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

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

Data Type

String

external_crypto_key_secret property (SSHClient Struct)

The pre-shared key used for DC request authentication.

Syntax

fn external_crypto_key_secret(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_key_secret(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_key_secret_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Read more about configuring authentication in the external_crypto_key_id topic.

Data Type

String

external_crypto_method property (SSHClient Struct)

Specifies the asynchronous signing method.

Syntax

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

Possible Values

0   // PKCS1
1 // PKCS7

Default Value

0

Remarks

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

Available options:

asmdPKCS10
asmdPKCS71

Data Type

i32

external_crypto_mode property (SSHClient Struct)

Specifies the external cryptography mode.

Syntax

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

Possible Values

0   // Default
1 // Disabled
2 // Generic
3 // DCAuth
4 // DCAuthJSON

Default Value

0

Remarks

Specifies the external cryptography mode.

Available options:

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

Data Type

i32

external_crypto_public_key_algorithm property (SSHClient Struct)

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

Syntax

fn external_crypto_public_key_algorithm(&self ) -> Result<String, SecureBlackboxError> 
fn set_external_crypto_public_key_algorithm(&self, value : &str) -> Option<SecureBlackboxError> fn set_external_crypto_public_key_algorithm_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

Data Type

String

fips_mode property (SSHClient Struct)

Reserved.

Syntax

fn fips_mode(&self ) -> Result<bool, SecureBlackboxError> 
fn set_fips_mode(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

This property is reserved for future use.

Data Type

bool

key_fingerprint_sha1 property (SSHClient Struct)

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

Syntax

fn key_fingerprint_sha1(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

key_fingerprint_sha256 property (SSHClient Struct)

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

Syntax

fn key_fingerprint_sha256(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

key_handle property (SSHClient Struct)

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

Syntax

fn key_handle(&self ) -> Result<i64, SecureBlackboxError> 
fn set_key_handle(&self, value : i64) -> Option<SecureBlackboxError>

Default Value

0

Remarks

Allows to get or set a 'handle', a unique identifier of the underlying property object. Use this property to assign objects of the same type in a quicker manner, without copying them fieldwise.

When you pass a handle of one object to another, the source object is copied to the destination rather than assigned. It is safe to get rid of the original object after such operation. pdfSigner.setSigningCertHandle(certMgr.getCertHandle());

Data Type

i64

password property (SSHClient Struct)

Specifies user's password on the server.

Syntax

fn password(&self ) -> Result<String, SecureBlackboxError> 
fn set_password(&self, value : &str) -> Option<SecureBlackboxError> fn set_password_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Invalid password fires the on_auth_failed event.

Data Type

String

proxy_settings_address property (SSHClient Struct)

The IP address of the proxy server.

Syntax

fn proxy_settings_address(&self ) -> Result<String, SecureBlackboxError> 
fn set_proxy_settings_address(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_settings_address_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

The IP address of the proxy server.

Data Type

String

proxy_settings_authentication property (SSHClient Struct)

The authentication type used by the proxy server.

Syntax

fn proxy_settings_authentication(&self ) -> Result<i32, SecureBlackboxError> 
fn set_proxy_settings_authentication(&self, value : i32) -> Option<SecureBlackboxError>

Possible Values

0   // NoAuthentication
1 // Basic
2 // Digest
3 // NTLM

Default Value

0

Remarks

The authentication type used by the proxy server.

patNoAuthentication0
patBasic1
patDigest2
patNTLM3

Data Type

i32

proxy_settings_password property (SSHClient Struct)

The password to authenticate to the proxy server.

Syntax

fn proxy_settings_password(&self ) -> Result<String, SecureBlackboxError> 
fn set_proxy_settings_password(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_settings_password_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

The password to authenticate to the proxy server.

Data Type

String

proxy_settings_port property (SSHClient Struct)

The port on the proxy server to connect to.

Syntax

fn proxy_settings_port(&self ) -> Result<i32, SecureBlackboxError> 
fn set_proxy_settings_port(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

The port on the proxy server to connect to.

Data Type

i32

proxy_settings_proxy_type property (SSHClient Struct)

The type of the proxy server.

Syntax

fn proxy_settings_proxy_type(&self ) -> Result<i32, SecureBlackboxError> 
fn set_proxy_settings_proxy_type(&self, value : i32) -> Option<SecureBlackboxError>

Possible Values

0   // None
1 // Socks4
2 // Socks5
3 // WebTunnel
4 // HTTP

Default Value

0

Remarks

The type of the proxy server.

cptNone0
cptSocks41
cptSocks52
cptWebTunnel3
cptHTTP4

Data Type

i32

proxy_settings_request_headers property (SSHClient Struct)

Contains HTTP request headers for WebTunnel and HTTP proxy.

Syntax

fn proxy_settings_request_headers(&self ) -> Result<String, SecureBlackboxError> 
fn set_proxy_settings_request_headers(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_settings_request_headers_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Contains HTTP request headers for WebTunnel and HTTP proxy.

Data Type

String

proxy_settings_response_body property (SSHClient Struct)

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

Syntax

fn proxy_settings_response_body(&self ) -> Result<String, SecureBlackboxError> 
fn set_proxy_settings_response_body(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_settings_response_body_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

proxy_settings_response_headers property (SSHClient Struct)

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

Syntax

fn proxy_settings_response_headers(&self ) -> Result<String, SecureBlackboxError> 
fn set_proxy_settings_response_headers(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_settings_response_headers_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

proxy_settings_use_ipv6 property (SSHClient Struct)

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

Syntax

fn proxy_settings_use_ipv6(&self ) -> Result<bool, SecureBlackboxError> 
fn set_proxy_settings_use_ipv6(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

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

Data Type

bool

proxy_settings_username property (SSHClient Struct)

Specifies the username credential for proxy authentication.

Syntax

fn proxy_settings_username(&self ) -> Result<String, SecureBlackboxError> 
fn set_proxy_settings_username(&self, value : &str) -> Option<SecureBlackboxError> fn set_proxy_settings_username_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Specifies the username credential for proxy authentication.

Data Type

String

server_key_algorithm property (SSHClient Struct)

Specifies the key algorithm.

Syntax

fn server_key_algorithm(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Specifies the key algorithm.

The following key algorithms are currently supported and can be returned by this property:

  • RSA
  • DSS
  • ECDSA
  • EDDSA
  • MLDSA
  • ECDSA-SK
  • EDDSA-SK

This property is read-only.

Data Type

String

server_key_bits property (SSHClient Struct)

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

Syntax

fn server_key_bits(&self ) -> Result<i32, SecureBlackboxError> 

Default Value

0

Remarks

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

This property is read-only.

Data Type

i32

server_key_comment property (SSHClient Struct)

The comment for the public key.

Syntax

fn server_key_comment(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

The comment for the public key.

This property is read-only.

Data Type

String

server_key_curve property (SSHClient Struct)

Specifies the elliptical curve when EC cryptography is used.

Syntax

fn server_key_curve(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Specifies the elliptical curve when EC cryptography is used.

The following curves are currently supported:

  • NISTP256
  • NISTP384
  • NISTP521
  • NISTK163
  • NISTP192
  • NISTP224
  • NISTK233
  • NISTB233
  • NISTK283
  • NISTK409
  • NISTB409
  • NISTK571
  • CURVE25519 (EdDSA curve)
  • CURVE448 (EdDSA curve)

This property is read-only.

Data Type

String

server_key_extractable property (SSHClient Struct)

Whether the key is extractable (e.

Syntax

fn server_key_extractable(&self ) -> Result<bool, SecureBlackboxError> 

Default Value

false

Remarks

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

This property is read-only.

Data Type

bool

server_key_fingerprint_md5 property (SSHClient Struct)

Contains the MD5 fingerprint (hash) of the key.

Syntax

fn server_key_fingerprint_md5(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Contains the MD5 fingerprint (hash) of the key.

This property is read-only.

Data Type

String

server_key_fingerprint_sha1 property (SSHClient Struct)

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

Syntax

fn server_key_fingerprint_sha1(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

server_key_fingerprint_sha256 property (SSHClient Struct)

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

Syntax

fn server_key_fingerprint_sha256(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

server_key_handle property (SSHClient Struct)

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

Syntax

fn server_key_handle(&self ) -> Result<i64, SecureBlackboxError> 

Default Value

0

Remarks

Allows to get or set a 'handle', a unique identifier of the underlying property object. Use this property to assign objects of the same type in a quicker manner, without copying them fieldwise.

When you pass a handle of one object to another, the source object is copied to the destination rather than assigned. It is safe to get rid of the original object after such operation. pdfSigner.setSigningCertHandle(certMgr.getCertHandle());

This property is read-only.

Data Type

i64

server_key_key_format property (SSHClient Struct)

Specifies the format in which the key is stored.

Syntax

fn server_key_key_format(&self ) -> Result<i32, SecureBlackboxError> 

Possible Values

0   // OpenSSH
1 // OpenSSH2
2 // IETF
3 // PuTTY
4 // X509
5 // Binary
6 // SSH1
7 // PGP
8 // PKCS8
9 // PuTTY3
10 // OpenSSHCert

Default Value

0

Remarks

Specifies the format in which the key is stored.

ckfOpenSSH0
ckfOpenSSH21
ckfIETF2
ckfPuTTY3
ckfX5094
ckfBinary5
ckfSSH16
ckfPGP7
ckfPKCS88
ckfPuTTY39
ckfOpenSSHCert10

This property is read-only.

Data Type

i32

server_key_key_protection_algorithm property (SSHClient Struct)

Specifies the key protection algorithm.

Syntax

fn server_key_key_protection_algorithm(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

Specifies the key protection algorithm.

This property is read-only.

Data Type

String

server_key_private property (SSHClient Struct)

Whether this key is a private key or not.

Syntax

fn server_key_private(&self ) -> Result<bool, SecureBlackboxError> 

Default Value

false

Remarks

Whether this key is a private key or not.

This property is read-only.

Data Type

bool

server_key_public property (SSHClient Struct)

Whether this key is a public key or not.

Syntax

fn server_key_public(&self ) -> Result<bool, SecureBlackboxError> 

Default Value

false

Remarks

Whether this key is a public key or not.

This property is read-only.

Data Type

bool

server_key_subject property (SSHClient Struct)

Specifies the public key owner (subject).

Syntax

fn server_key_subject(&self ) -> Result<String, SecureBlackboxError> 

Default Value

""

Remarks

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

This property is read-only.

Data Type

String

socket_dns_mode property (SSHClient Struct)

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

Syntax

fn socket_dns_mode(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_dns_mode(&self, value : i32) -> Option<SecureBlackboxError>

Possible Values

0   // Auto
1 // Platform
2 // Own
3 // OwnSecure

Default Value

0

Remarks

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

dmAuto0
dmPlatform1
dmOwn2
dmOwnSecure3

Data Type

i32

socket_dns_port property (SSHClient Struct)

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

Syntax

fn socket_dns_port(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_dns_port(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

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

Data Type

i32

socket_dns_query_timeout property (SSHClient Struct)

The timeout (in milliseconds) for each DNS query.

Syntax

fn socket_dns_query_timeout(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_dns_query_timeout(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

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

Data Type

i32

socket_dns_servers property (SSHClient Struct)

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

Syntax

fn socket_dns_servers(&self ) -> Result<String, SecureBlackboxError> 
fn set_socket_dns_servers(&self, value : &str) -> Option<SecureBlackboxError> fn set_socket_dns_servers_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

socket_dns_total_timeout property (SSHClient Struct)

The timeout (in milliseconds) for the whole resolution process.

Syntax

fn socket_dns_total_timeout(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_dns_total_timeout(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

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

Data Type

i32

socket_incoming_speed_limit property (SSHClient Struct)

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

Syntax

fn socket_incoming_speed_limit(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_incoming_speed_limit(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

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

Data Type

i32

socket_local_address property (SSHClient Struct)

The local network interface to bind the socket to.

Syntax

fn socket_local_address(&self ) -> Result<String, SecureBlackboxError> 
fn set_socket_local_address(&self, value : &str) -> Option<SecureBlackboxError> fn set_socket_local_address_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

The local network interface to bind the socket to.

Data Type

String

socket_local_port property (SSHClient Struct)

The local port number to bind the socket to.

Syntax

fn socket_local_port(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_local_port(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

The local port number to bind the socket to.

Data Type

i32

socket_outgoing_speed_limit property (SSHClient Struct)

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

Syntax

fn socket_outgoing_speed_limit(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_outgoing_speed_limit(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

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

Data Type

i32

socket_timeout property (SSHClient Struct)

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

Syntax

fn socket_timeout(&self ) -> Result<i32, SecureBlackboxError> 
fn set_socket_timeout(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

60000

Remarks

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

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

Data Type

i32

socket_use_ipv6 property (SSHClient Struct)

Enables or disables IP protocol version 6.

Syntax

fn socket_use_ipv6(&self ) -> Result<bool, SecureBlackboxError> 
fn set_socket_use_ipv6(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

Enables or disables IP protocol version 6.

Data Type

bool

ssh_settings_auto_adjust_ciphers property (SSHClient Struct)

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

Syntax

fn ssh_settings_auto_adjust_ciphers(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_auto_adjust_ciphers(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

true

Remarks

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

Data Type

bool

ssh_settings_base_configuration property (SSHClient Struct)

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

Syntax

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

Possible Values

0   // Default
1 // Compatible
2 // ComprehensiveInsecure
3 // HighlySecure

Default Value

0

Remarks

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

Data Type

i32

ssh_settings_compression_algorithms property (SSHClient Struct)

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

Syntax

fn ssh_settings_compression_algorithms(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_compression_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_compression_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

  • none
  • zlib
  • zlib@openssh.com

Data Type

String

ssh_settings_compression_level property (SSHClient Struct)

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

Syntax

fn ssh_settings_compression_level(&self ) -> Result<i32, SecureBlackboxError> 
fn set_ssh_settings_compression_level(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

6

Remarks

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

Data Type

i32

ssh_settings_default_window_size property (SSHClient Struct)

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

Syntax

fn ssh_settings_default_window_size(&self ) -> Result<i32, SecureBlackboxError> 
fn set_ssh_settings_default_window_size(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

2048000

Remarks

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

Data Type

i32

ssh_settings_encryption_algorithms property (SSHClient Struct)

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

Syntax

fn ssh_settings_encryption_algorithms(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_encryption_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_encryption_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

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

Data Type

String

ssh_settings_force_compression property (SSHClient Struct)

Whether the SSH client should explicitly request compression.

Syntax

fn ssh_settings_force_compression(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_force_compression(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

Whether the SSH client should explicitly request compression.

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

Data Type

bool

ssh_settings_forward_auth_agent property (SSHClient Struct)

Enables or disables auth agent forwarding.

Syntax

fn ssh_settings_forward_auth_agent(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_forward_auth_agent(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

Enables or disables auth agent forwarding. This allows the struct to connect to the second and subsequent servers in the chain with the key agent available on the client computer.

Data Type

bool

ssh_settings_gss_auth_types property (SSHClient Struct)

A comma-separated list of authentication types.

Syntax

fn ssh_settings_gss_auth_types(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_gss_auth_types(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_auth_types_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

ssh_settings_gss_delegate_creds property (SSHClient Struct)

Switches credential delegation on or off.

Syntax

fn ssh_settings_gss_delegate_creds(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_gss_delegate_creds(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

Switches credential delegation on or off.

Data Type

bool

ssh_settings_gss_hostname property (SSHClient Struct)

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

Syntax

fn ssh_settings_gss_hostname(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_gss_hostname(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_hostname_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

ssh_settings_gss_lib property (SSHClient Struct)

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

Syntax

fn ssh_settings_gss_lib(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_gss_lib(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_lib_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

ssh_settings_gss_mechanisms property (SSHClient Struct)

A comma-separated list of GSS mechanisms to use.

Syntax

fn ssh_settings_gss_mechanisms(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_gss_mechanisms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_mechanisms_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

ssh_settings_gss_protocols property (SSHClient Struct)

A comma-separated list of SSPI protocols.

Syntax

fn ssh_settings_gss_protocols(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_gss_protocols(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_gss_protocols_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

ssh_settings_handshake_timeout property (SSHClient Struct)

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

Syntax

fn ssh_settings_handshake_timeout(&self ) -> Result<i32, SecureBlackboxError> 
fn set_ssh_settings_handshake_timeout(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

45

Remarks

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

Data Type

i32

ssh_settings_kex_algorithms property (SSHClient Struct)

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

Syntax

fn ssh_settings_kex_algorithms(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_kex_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_kex_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

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

Data Type

String

ssh_settings_mac_algorithms property (SSHClient Struct)

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

Syntax

fn ssh_settings_mac_algorithms(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_mac_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_mac_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

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

Data Type

String

ssh_settings_max_ssh_packet_size property (SSHClient Struct)

Specifies the maximum length of one SSH packet in bytes.

Syntax

fn ssh_settings_max_ssh_packet_size(&self ) -> Result<i32, SecureBlackboxError> 
fn set_ssh_settings_max_ssh_packet_size(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

262144

Remarks

Specifies the maximum length of one SSH packet in bytes.

Data Type

i32

ssh_settings_min_window_size property (SSHClient Struct)

Specifies the minimal internal window size.

Syntax

fn ssh_settings_min_window_size(&self ) -> Result<i32, SecureBlackboxError> 
fn set_ssh_settings_min_window_size(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

2048

Remarks

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

Data Type

i32

ssh_settings_obfuscate_handshake property (SSHClient Struct)

Enables or disables handshake obfuscation.

Syntax

fn ssh_settings_obfuscate_handshake(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_obfuscate_handshake(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

Enables or disables handshake obfuscation.

Data Type

bool

ssh_settings_obfuscation_password property (SSHClient Struct)

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

Syntax

fn ssh_settings_obfuscation_password(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_obfuscation_password(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_obfuscation_password_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

Data Type

String

ssh_settings_public_key_algorithms property (SSHClient Struct)

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

Syntax

fn ssh_settings_public_key_algorithms(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_public_key_algorithms(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_public_key_algorithms_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

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

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

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

Data Type

String

ssh_settings_request_password_change property (SSHClient Struct)

Whether to request a password change when connecting.

Syntax

fn ssh_settings_request_password_change(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_request_password_change(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

Whether to request a password change when connecting.

Data Type

bool

ssh_settings_software_name property (SSHClient Struct)

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

Syntax

fn ssh_settings_software_name(&self ) -> Result<String, SecureBlackboxError> 
fn set_ssh_settings_software_name(&self, value : &str) -> Option<SecureBlackboxError> fn set_ssh_settings_software_name_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

"SecureBlackbox"

Remarks

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

Data Type

String

ssh_settings_trust_all_keys property (SSHClient Struct)

Enables or disables explicit trust to all server keys.

Syntax

fn ssh_settings_trust_all_keys(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_trust_all_keys(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

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

Data Type

bool

ssh_settings_use_auth_agent property (SSHClient Struct)

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

Syntax

fn ssh_settings_use_auth_agent(&self ) -> Result<bool, SecureBlackboxError> 
fn set_ssh_settings_use_auth_agent(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

false

Remarks

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

Data Type

bool

ssh_settings_versions property (SSHClient Struct)

Specifies enabled SSH protocol versions (1 or 2).

Syntax

fn ssh_settings_versions(&self ) -> Result<i32, SecureBlackboxError> 
fn set_ssh_settings_versions(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

1

Remarks

Specifies enabled SSH protocol versions (1 or 2).

Data Type

i32

subsystem property (SSHClient Struct)

Specifies the subsystem to request from the server.

Syntax

fn subsystem(&self ) -> Result<String, SecureBlackboxError> 
fn set_subsystem(&self, value : &str) -> Option<SecureBlackboxError> fn set_subsystem_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Subsystem is a special form of an SSH channel. It is typically used to transfer third-party protocol data, with SFTP being the most widely known.

You can tell struct to set up a subsystem connection (rather than a shell or command) by assigning the subsystem name to this property.

Data Type

String

terminal_cols property (SSHClient Struct)

Specifies the width of the pseudoterminal, in characters.

Syntax

fn terminal_cols(&self ) -> Result<i32, SecureBlackboxError> 
fn set_terminal_cols(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

80

Remarks

Specifies the width of the pseudoterminal, in characters.

Data Type

i32

terminal_environment property (SSHClient Struct)

Specifies the list of environment variables.

Syntax

fn terminal_environment(&self ) -> Result<String, SecureBlackboxError> 
fn set_terminal_environment(&self, value : &str) -> Option<SecureBlackboxError> fn set_terminal_environment_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Specifies the list of environment variables.

Data Type

String

terminal_eol_char property (SSHClient Struct)

Specifies the End-of-Line character or sequence.

Syntax

fn terminal_eol_char(&self ) -> Result<Vec<u8>, SecureBlackboxError> 
fn set_terminal_eol_char(&self, value : Vec<u8>) -> Option<SecureBlackboxError> fn set_terminal_eol_char_ref(&self, value : &[u8]) -> Option<SecureBlackboxError>

Remarks

Specifies the End-of-Line character or sequence.

Data Type

Vec

terminal_height property (SSHClient Struct)

Specifies the height of the pseudoterminal, in pixels.

Syntax

fn terminal_height(&self ) -> Result<i32, SecureBlackboxError> 
fn set_terminal_height(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

Specifies the height of the pseudoterminal, in pixels.

Data Type

i32

terminal_opcodes property (SSHClient Struct)

Specifies the operation codes specific for the terminal.

Syntax

fn terminal_opcodes(&self ) -> Result<String, SecureBlackboxError> 
fn set_terminal_opcodes(&self, value : &str) -> Option<SecureBlackboxError> fn set_terminal_opcodes_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Specifies the operation codes specific for the terminal.

Data Type

String

terminal_protocol property (SSHClient Struct)

The terminal protocol name.

Syntax

fn terminal_protocol(&self ) -> Result<String, SecureBlackboxError> 
fn set_terminal_protocol(&self, value : &str) -> Option<SecureBlackboxError> fn set_terminal_protocol_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

"vt100"

Remarks

The terminal protocol name.

Data Type

String

terminal_request_pty property (SSHClient Struct)

Specifies whether to request a pseudoterminal for the session.

Syntax

fn terminal_request_pty(&self ) -> Result<bool, SecureBlackboxError> 
fn set_terminal_request_pty(&self, value : bool) -> Option<SecureBlackboxError>

Default Value

true

Remarks

Specifies whether to request a pseudoterminal for the session.

Data Type

bool

terminal_rows property (SSHClient Struct)

Specifies the height of the pseudoterminal, in lines.

Syntax

fn terminal_rows(&self ) -> Result<i32, SecureBlackboxError> 
fn set_terminal_rows(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

25

Remarks

Specifies the height of the pseudoterminal, in lines.

Data Type

i32

terminal_width property (SSHClient Struct)

Specifies the width of the pseudoterminal, in pixels.

Syntax

fn terminal_width(&self ) -> Result<i32, SecureBlackboxError> 
fn set_terminal_width(&self, value : i32) -> Option<SecureBlackboxError>

Default Value

0

Remarks

Specifies the width of the pseudoterminal, in pixels.

Data Type

i32

trusted_keys_file property (SSHClient Struct)

Path to the file containing public keys of authorized servers.

Syntax

fn trusted_keys_file(&self ) -> Result<String, SecureBlackboxError> 
fn set_trusted_keys_file(&self, value : &str) -> Option<SecureBlackboxError> fn set_trusted_keys_file_ref(&self, value : &String) -> Option<SecureBlackboxError>

Default Value

""

Remarks

Path to the file containing public keys of authorized servers.

Data Type

String

username property (SSHClient Struct)

Specifies client's username on the server.

Syntax

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

Default Value

""

Remarks

Client's password is set by password property. ;

Data Type

String

config method (SSHClient Struct)

Sets or retrieves a configuration setting.

Syntax

fn config(&self, configuration_string : &str) ->  Result<String, SecureBlackboxError>

Remarks

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

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

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

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

connect method (SSHClient Struct)

Establishes connection to an SSH server.

Syntax

fn connect(&self, address : &str, port : i32) -> Result<(), SecureBlackboxError>

Remarks

Use this method to connect to the SSH server by providing its Address and Port.

Before connecting to the server you might want to set up your credentials using username and password properties. You might also need to configure the server key validation routine. You can do this by subscribing to on_known_key_received and on_unknown_key_received events and implementing the event handlers as required.

Adjust async_mode before connecting to switch the component to either synchronous or asynchronous mode. In synchronous mode, all the calls to the component, such as connect or send_bytes, are executed within the context of the caller thread, and block until the action completes. In asynchronous mode, the component runs the SSH session in a background thread, which makes all such calls return immediately. Find out more about the modes in the async_mode topic.

connect_and_exec method (SSHClient Struct)

Connects to an SSH server and executes a command in one go.

Syntax

fn connect_and_exec(&self, address : &str, port : i32, command : &str, want_stdout : bool, want_std_err : bool) ->  Result<Vec<u8>, SecureBlackboxError>

Remarks

Use this method to connect to an SSH server at Address and Port and execute a command. The method returns the output of the executed command.

This method is a handy shortcut for running non-interactive commands. It encapsulates calls to connect, receive, disconnect internally to save you time and space.

Please note that connect_and_exec always runs synchronously, thus ignoring the async_mode setting.

disconnect method (SSHClient Struct)

Closes connection to the SSH server.

Syntax

fn disconnect(&self) -> Result<(), SecureBlackboxError>

Remarks

Call this method to terminate the active SSH connection.

Please note that in some cases the component may still have some inbound data cached internally even after the connection is closed. You can read that data out using receive and/or receive_bytes methods.

do_action method (SSHClient Struct)

Performs an additional action.

Syntax

fn do_action(&self, action_id : &str, action_params : &str) ->  Result<String, SecureBlackboxError>

Remarks

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

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

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

Common ActionIDs:

ActionParametersReturned valueDescription
ResetTrustedListCachenonenoneClears the cached list of trusted lists.
ResetCertificateCachenonenoneClears the cached certificates.
ResetCRLCachenonenoneClears the cached CRLs.
ResetOCSPResponseCachenonenoneClears the cached OCSP responses.

ping method (SSHClient Struct)

Sends a keep-alive request to the SSH server.

Syntax

fn ping(&self) -> Result<(), SecureBlackboxError>

Remarks

Use this method to send a keep-alive message to the SSH server. Keep-alive messages are empty data packets which carry no useful information but are a handy way of checking if the connection is still alive.

poll method (SSHClient Struct)

Checks whether there is any inbound data readily available.

Syntax

fn poll(&self, milliseconds : i32) ->  Result<bool, SecureBlackboxError>

Remarks

Use this method to check whether there is any incoming data available in the connection. If this method returns true, you can read the data with receive or receive_bytes calls.

Use the Milliseconds parameter to tell the component how long it can wait for the data to arrive.

receive method (SSHClient Struct)

Reads a portion of received data into a string.

Syntax

fn receive(&self) ->  Result<String, SecureBlackboxError>

Remarks

Use this method to read out a piece of data received from the server into a string.

Note that in synchronous mode this method may block in the absence of any inbound data until the next piece of data is received from the server. Use poll to check if there is any data in the connection that is immediately available for reading.

In asynchronous mode a good time to call this method is upon receiving a read notification in on_data_received event handler. When working in asynchronous mode, this call returns immediately.

This method only returns data that arrives via the stdout channel. Use receive_from to read stderr data.

receive_bytes method (SSHClient Struct)

Reads a portion of received data into a byte array.

Syntax

fn receive_bytes(&self, max_len : i32) ->  Result<Vec<u8>, SecureBlackboxError>

Remarks

Use this method to read out a piece of data received from the server into a byte array. Control the maximum length of the data chunk with the MaxLen parameter.

Note that in synchronous mode this method may block in the absence of any inbound data until the next piece of data is received from the server. Use poll to check if there is any data in the connection that is immediately available for reading.

In asynchronous mode a good time to call this method is upon receiving a read notification in on_data_received event handler. When working in asynchronous mode, this call returns immediately.

This method only returns data that arrives via the stdout channel. Use receive_bytes_from to read stderr data.

receive_bytes_from method (SSHClient Struct)

Reads a portion of data received via a specific channel into a byte array.

Syntax

fn receive_bytes_from(&self, channel : i32, max_len : i32) ->  Result<Vec<u8>, SecureBlackboxError>

Remarks

Use this method to read out a piece of data received from the server into a byte array. Specify the channel that you are interested in reading from (0 for stdout, 1 for stderr) via the Channel parameter, and control the maximum length of the data chunk with the MaxLen parameter.

Note that in synchronous mode this method may block in the absence of any inbound data until the next piece of data is received from the server. Use poll to check if there is any data in the connection that is immediately available for reading.

In asynchronous mode a good time to call this method is upon receiving a read notification in on_data_received event handler. When working in asynchronous mode, this call returns immediately.

Please also note that stdout and stderr channels are fully independent, which implies that data arriving via each channel should be read out separately.

receive_from method (SSHClient Struct)

Reads a portion of data received via a specific channel into a string.

Syntax

fn receive_from(&self, channel : i32) ->  Result<String, SecureBlackboxError>

Remarks

Use this method to read out a piece of data received from the server into a string. Use the Channel parameter to specify the channel that you would like to read from (0 for stdout, 1 for stderr).

Note that in synchronous mode this method may block in the absence of any inbound data until the next piece of data is received from the server. Use poll to check if there is any data in the connection that is immediately available for reading.

In asynchronous mode a good time to call this method is upon receiving a read notification in on_data_received event handler. When working in asynchronous mode, this call returns immediately.

reset method (SSHClient Struct)

Resets the struct settings.

Syntax

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

Remarks

reset is a generic method available in every struct.

send method (SSHClient Struct)

Sends a string to the server.

Syntax

fn send(&self, data_str : &str, add_eol : bool) -> Result<(), SecureBlackboxError>

Remarks

Use this method to send DataStr to the remote command's stdin channel. Set the AddEOL parameter to true to append the end-of-line character to the string automatically.

Note that in synchronous mode this method may block until the whole string is committed to the network connection. In asynchronous mode this method returns immediately; the application is eventually notified that the data has been sent via the on_data_sent event.

send_bytes method (SSHClient Struct)

Sends an array of bytes to the server.

Syntax

fn send_bytes(&self, data : &[u8]) -> Result<(), SecureBlackboxError>

Remarks

Use this method to send Data to the remote command's stdin channel.

Note that in synchronous mode this method may block until the whole byte array is committed to the network connection. In asynchronous mode this method returns immediately; the application is eventually notified that the data has been sent via the on_data_sent event.

send_special method (SSHClient Struct)

Sends a special character to the server or remote command.

Syntax

fn send_special(&self, special_char : &str) -> Result<(), SecureBlackboxError>

Remarks

Use this method to send a special or control character to the SSH server or the command being executed. Specify the character id via the SpecialChar parameter.

Currently the only supported special character is "eof", which is sometimes used as a way to close the stdin channel gracefully.

on_auth_attempt event (SSHClient Struct)

Fires when a single authentication attempt is performed.

Syntax

// SSHClientAuthAttemptEventArgs carries the SSHClient AuthAttempt event's parameters.
pub struct SSHClientAuthAttemptEventArgs {
  fn auth_type(&self) -> i32
}

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

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

Remarks

This event is fired each time a single authentication attempt is performed. AuthType parameter specifies the type of authentication. Note, this event could be fired more than once if the client tries different authentication methods one after another.

on_auth_failed event (SSHClient Struct)

Fires when a single authentication attempt is failed.

Syntax

// SSHClientAuthFailedEventArgs carries the SSHClient AuthFailed event's parameters.
pub struct SSHClientAuthFailedEventArgs {
  fn authentication_type(&self) -> i32
}

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

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

Remarks

This event is fired each time a single authentication attempt fails. AuthType parameter specifies the type of authentication.

As SSH may try a number of authentication attempts of different types or with different parameters (such as public keys) during one session, this event may be fired more than once. It is not critical and may not lead to closing of the connection.

on_auth_succeeded event (SSHClient Struct)

Reports a successful authentication.

Syntax

// SSHClientAuthSucceededEventArgs carries the SSHClient AuthSucceeded event's parameters.
pub struct SSHClientAuthSucceededEventArgs {
}

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

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

Remarks

This event may be preceded by some on_auth_failed events if the client tries different authentication methods one after another.

on_banner event (SSHClient Struct)

Reports the receipt of the Hello message from the server.

Syntax

// SSHClientBannerEventArgs carries the SSHClient Banner event's parameters.
pub struct SSHClientBannerEventArgs {
  fn text(&self) -> &[u8]
  fn language(&self) -> &[u8]
}

// SSHClientBannerEvent defines the signature of the SSHClient Banner event's handler function.
pub trait SSHClientBannerEvent {
  fn on_banner(&self, sender : SSHClient, e : &mut SSHClientBannerEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_banner(&self) -> &'a dyn SSHClientBannerEvent;
  pub fn set_on_banner(&mut self, value : &'a dyn SSHClientBannerEvent);
  ...
}

Remarks

SFTPClient fires this event when it receives hello message from the server.

on_command_completed event (SSHClient Struct)

Signifies completion of the command execution.

Syntax

// SSHClientCommandCompletedEventArgs carries the SSHClient CommandCompleted event's parameters.
pub struct SSHClientCommandCompletedEventArgs {
  fn command(&self) -> &String
  fn exit_status(&self) -> i32
  fn exit_message(&self) -> &String
  fn exit_signal(&self) -> &String
}

// SSHClientCommandCompletedEvent defines the signature of the SSHClient CommandCompleted event's handler function.
pub trait SSHClientCommandCompletedEvent {
  fn on_command_completed(&self, sender : SSHClient, e : &mut SSHClientCommandCompletedEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_command_completed(&self) -> &'a dyn SSHClientCommandCompletedEvent;
  pub fn set_on_command_completed(&mut self, value : &'a dyn SSHClientCommandCompletedEvent);
  ...
}

Remarks

Subscribe to this event to be notified about completion of the remote command execution. This event fires for every command in the commands list. The Command parameter indicates the command being completed.

ExitStatus specifies the command's return code. ExitMessage or ExitSignal parameters provide error details if the command execution was terminated forcefully,

on_command_start event (SSHClient Struct)

Marks the commencement of a command execution.

Syntax

// SSHClientCommandStartEventArgs carries the SSHClient CommandStart event's parameters.
pub struct SSHClientCommandStartEventArgs {
  fn command(&self) -> &String
}

// SSHClientCommandStartEvent defines the signature of the SSHClient CommandStart event's handler function.
pub trait SSHClientCommandStartEvent {
  fn on_command_start(&self, sender : SSHClient, e : &mut SSHClientCommandStartEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_command_start(&self) -> &'a dyn SSHClientCommandStartEvent;
  pub fn set_on_command_start(&mut self, value : &'a dyn SSHClientCommandStartEvent);
  ...
}

Remarks

Subscribe to this event to be notified about the start of execution of a remote command. The Command parameter indicates the command being started.

This event is fired for all commands in the commands list, in order. The completion of the command is reported via the on_command_completed event.

on_connect event (SSHClient Struct)

This event is fired when an SSH session has been established.

Syntax

// SSHClientConnectEventArgs carries the SSHClient Connect event's parameters.
pub struct SSHClientConnectEventArgs {
}

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

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

Remarks

Use this event to track the moment when SSH session has been set up.

on_data_received event (SSHClient Struct)

Reports receipt of another chunk of data from the server.

Syntax

// SSHClientDataReceivedEventArgs carries the SSHClient DataReceived event's parameters.
pub struct SSHClientDataReceivedEventArgs {
  fn channel(&self) -> i32
  fn bytes_received(&self) -> i32
  fn total_bytes_pending(&self) -> i32
}

// SSHClientDataReceivedEvent defines the signature of the SSHClient DataReceived event's handler function.
pub trait SSHClientDataReceivedEvent {
  fn on_data_received(&self, sender : SSHClient, e : &mut SSHClientDataReceivedEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_data_received(&self) -> &'a dyn SSHClientDataReceivedEvent;
  pub fn set_on_data_received(&mut self, value : &'a dyn SSHClientDataReceivedEvent);
  ...
}

Remarks

This event fires in asynchronous mode to report the receipt of another chunk of data from the server. Use receive or receive_bytes methods to read out the received data.

The Channel parameter indicates the channel on which the data was received: stdout (0) or stderr (1). BytesReceived specify the size of the newly received chunk, and TotalBytesPending contain the total number of bytes available for reading.

Please note that just like other asynchronous mode events this event may fire from a secondary thread. Please make sure your code is prepared for that by using appropriate synchronization facilities.

This event does not fire in synchronous mode.

on_data_sent event (SSHClient Struct)

Notifies the application that a piece of data has been sent to the server.

Syntax

// SSHClientDataSentEventArgs carries the SSHClient DataSent event's parameters.
pub struct SSHClientDataSentEventArgs {
  fn bytes_sent(&self) -> i32
  fn bytes_pending(&self) -> i32
}

// SSHClientDataSentEvent defines the signature of the SSHClient DataSent event's handler function.
pub trait SSHClientDataSentEvent {
  fn on_data_sent(&self, sender : SSHClient, e : &mut SSHClientDataSentEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_data_sent(&self) -> &'a dyn SSHClientDataSentEvent;
  pub fn set_on_data_sent(&mut self, value : &'a dyn SSHClientDataSentEvent);
  ...
}

Remarks

Subscribe to this event to be notified about the outbound data flow. This event fires following a call to send or send_bytes methods to notify the application that the data provided has been sent to the server. This event may fire more than once for each send or send_bytes call, subject to the volume of data being sent and the settings of the server.

The BytesSent parameter specifies the number of bytes that has just been sent to the server. The BytesPending indicate the number of bytes that remain cached in the internal buffer. Any bytes cached in such way will be sent again on the next available opportunity and reported via a separate on_data_sent event invocation.

Please note that just like other asynchronous mode events this event may fire from a secondary thread. Please make sure your code is prepared for that by using appropriate synchronization facilities.

This event does not fire in synchronous mode.

on_disconnect event (SSHClient Struct)

This event is fired when the SFTP subsystem connection is closed.

Syntax

// SSHClientDisconnectEventArgs carries the SSHClient Disconnect event's parameters.
pub struct SSHClientDisconnectEventArgs {
  fn close_reason(&self) -> i32
}

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

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

Remarks

Do not perform any file operations after this event has been fired.

on_error event (SSHClient Struct)

Information about errors during SFTP connection.

Syntax

// SSHClientErrorEventArgs carries the SSHClient Error event's parameters.
pub struct SSHClientErrorEventArgs {
  fn error_code(&self) -> i32
  fn description(&self) -> &String
}

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

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

Remarks

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

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

on_external_sign event (SSHClient Struct)

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

Syntax

// SSHClientExternalSignEventArgs carries the SSHClient ExternalSign event's parameters.
pub struct SSHClientExternalSignEventArgs {
  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)
}

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

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

Remarks

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

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

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

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

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

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

on_known_key_received event (SSHClient Struct)

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

Syntax

// SSHClientKnownKeyReceivedEventArgs carries the SSHClient KnownKeyReceived event's parameters.
pub struct SSHClientKnownKeyReceivedEventArgs {
  fn algorithm(&self) -> &String
  fn bits(&self) -> i32
  fn fingerprint_sha256(&self) -> &String
}

// SSHClientKnownKeyReceivedEvent defines the signature of the SSHClient KnownKeyReceived event's handler function.
pub trait SSHClientKnownKeyReceivedEvent {
  fn on_known_key_received(&self, sender : SSHClient, e : &mut SSHClientKnownKeyReceivedEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_known_key_received(&self) -> &'a dyn SSHClientKnownKeyReceivedEvent;
  pub fn set_on_known_key_received(&mut self, value : &'a dyn SSHClientKnownKeyReceivedEvent);
  ...
}

Remarks

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

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

Use server_key to access more key details.

on_notification event (SSHClient Struct)

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

Syntax

// SSHClientNotificationEventArgs carries the SSHClient Notification event's parameters.
pub struct SSHClientNotificationEventArgs {
  fn event_id(&self) -> &String
  fn event_param(&self) -> &String
}

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

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

Remarks

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

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

on_password_change_request event (SSHClient Struct)

This event is fired when a password change is requested.

Syntax

// SSHClientPasswordChangeRequestEventArgs carries the SSHClient PasswordChangeRequest event's parameters.
pub struct SSHClientPasswordChangeRequestEventArgs {
  fn prompt(&self) -> &String
  fn new_password(&self) -> &String
  fn set_new_password(&self, value : &str)
  fn set_new_password_ref(&self, value : &String)
  fn cancel(&self) -> bool
  fn set_cancel(&self, value : bool)
}

// SSHClientPasswordChangeRequestEvent defines the signature of the SSHClient PasswordChangeRequest event's handler function.
pub trait SSHClientPasswordChangeRequestEvent {
  fn on_password_change_request(&self, sender : SSHClient, e : &mut SSHClientPasswordChangeRequestEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_password_change_request(&self) -> &'a dyn SSHClientPasswordChangeRequestEvent;
  pub fn set_on_password_change_request(&mut self, value : &'a dyn SSHClientPasswordChangeRequestEvent);
  ...
}

Remarks

This event is fired by the struct when a password change is requested by the server. Prompt contains the password prompt message. Handler should either provide the new password via NewPassword, or deny the request by setting Cancel to true.

on_private_key_needed event (SSHClient Struct)

This event is fired when client's public key was accepted by the server, but the corresponding secret key is not available.

Syntax

// SSHClientPrivateKeyNeededEventArgs carries the SSHClient PrivateKeyNeeded event's parameters.
pub struct SSHClientPrivateKeyNeededEventArgs {
  fn skip(&self) -> bool
  fn set_skip(&self, value : bool)
}

// SSHClientPrivateKeyNeededEvent defines the signature of the SSHClient PrivateKeyNeeded event's handler function.
pub trait SSHClientPrivateKeyNeededEvent {
  fn on_private_key_needed(&self, sender : SSHClient, e : &mut SSHClientPrivateKeyNeededEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_private_key_needed(&self) -> &'a dyn SSHClientPrivateKeyNeededEvent;
  pub fn set_on_private_key_needed(&mut self, value : &'a dyn SSHClientPrivateKeyNeededEvent);
  ...
}

Remarks

Set Skip to true when it is not possible to load the missing key for some reason.

on_unknown_key_received event (SSHClient Struct)

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

Syntax

// SSHClientUnknownKeyReceivedEventArgs carries the SSHClient UnknownKeyReceived event's parameters.
pub struct SSHClientUnknownKeyReceivedEventArgs {
  fn algorithm(&self) -> &String
  fn bits(&self) -> i32
  fn fingerprint_sha256(&self) -> &String
  fn action(&self) -> i32
  fn set_action(&self, value : i32)
}

// SSHClientUnknownKeyReceivedEvent defines the signature of the SSHClient UnknownKeyReceived event's handler function.
pub trait SSHClientUnknownKeyReceivedEvent {
  fn on_unknown_key_received(&self, sender : SSHClient, e : &mut SSHClientUnknownKeyReceivedEventArgs);
}

impl <'a> SSHClient<'a> {
  pub fn on_unknown_key_received(&self) -> &'a dyn SSHClientUnknownKeyReceivedEvent;
  pub fn set_on_unknown_key_received(&mut self, value : &'a dyn SSHClientUnknownKeyReceivedEvent);
  ...
}

Remarks

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

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

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

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

Config Settings (SSHClient Struct)

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

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

BlockSize:   The data block size.

This property specifies the data block size to use.

CommandTimeout:   Specifies the command timeout.

Specifies the command timeout (the maximum time to expect the result from the SSH command), in milliseconds.

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.

EarlyIdString:   Enables the proactive approach to SSH handshake.

The rule of thumb in the majority of SSH environments is for the server to initiate the handshake with its identification string (and for the client to respond). By setting this property to true you can tell the client to initiate the handshake by sending out the identification string proactively without waiting for the server to send one in. This setting may help in situations where your SSH or SFTP connection fails unexpectedly due to a timeout or network error.

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.

ErrorOrigin:   Specifies whether the error is local or remote.

Use this property to check where the error took place.

ErrorSeverity:   Specifies whether the error is fatal.

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

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.

LocalCharset:   Charset used on the client machine.

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

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.

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.

RemoteCharset:   Charset used on the server.

This property specifies the charset used on the server.

SendCommandEOF:   Defines whether EOF control character should be sent after the command data.

Enable this property to enforce sending of a trailing EOF character after the command data.

ThrottleControl:   Enables or disables throttle control for the connection.

Use this property to enable or disable throttle control.

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:

0Disabled. 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.
2Enabled, but reject affected algorithms if the remote host does not support strict key exchange. If the remote host supports strict key exchange all algorithms may be used. If the remote host does not support strict key exchange the connection will only continue if the selected encryption and MAC algorithms are not affected by the Terrapin attack.
3Required. If the remote host does not support strict key exchange the connection will fail.

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:

offNo caching (default)
localLocal caching
globalGlobal 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).
enableAlways attempt to use hardware cryptography. If unavailable, exception will be thrown.
disableDo 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:

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

LogDetails:   Specifies the debug log details to dump.

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

Supported values are:

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

LogFile:   Specifies the debug log filename.

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

LogFilters:   Specifies the debug log filters.

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

Supported filter names are:

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

LogFlushMode:   Specifies the log flush mode.

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

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

LogLevel:   Specifies the debug log level.

Use this property to provide the desired debug log level.

Supported values are:

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

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

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

The default value of this setting is 100.

LogRotationMode:   Specifies the log rotation mode.

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

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

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

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

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

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

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

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

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:

certificateEnables caching of certificates.
crlEnables caching of Certificate Revocation Lists (CRLs).
ocspEnables caching of OCSP (Online Certificate Status Protocol) responses.

Example (default value): PKICache=certificate,crl,ocsp In this example, the component caches certificates, CRLs, and OCSP responses.

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

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

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

Use this property to get or set an IP address for the specified domain name in the internal (of the 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: Config("XMLRDNDescriptorName[OID]=PrimaryName,Alias1,Alias2");

Where:

OID: The Object Identifier from the certificate's IssuerRDN or SubjectRDN that you want to map.

PrimaryName: The main descriptor name used in the XML signature when the OID is encountered.

Alias1, Alias2, ...: Optional alternative names recognized during parsing.

Usage Examples:

Map OID 2.5.4.5 to SERIALNUMBER: Config("XMLRDNDescriptorName[2.5.4.5]=SERIALNUMBER");

Map OID 1.2.840.113549.1.9.1 to E, with aliases EMAIL and EMAILADDRESS: Config("XMLRDNDescriptorName[1.2.840.113549.1.9.1]=E,EMAIL,EMAILADDRESS");

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 (SSHClient Struct)