SecureBlackbox 2020 iOS Edition

Questions / Feedback?

SFTPServer Class

Properties   Methods   Events   Configuration Settings   Errors  

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

Syntax

SecureBlackboxSFTPServer
SecureBlackboxSFTPServerSwift

Remarks

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

Property List


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

- activeSpecifies whether the SFTP server has started and ready to accept connections.
- authTypesDefines allowed authentication types.
- baseDirSpecifies the server's base (root) directory.
- clientFileEntryATimeContains the last access time for this file, in UTC.
- clientFileEntryCTimeContains this file's creation time, in UTC.
- clientFileEntryDirectorySpecifies whether this entry is a directory.
- clientFileEntryFileTypeSpecifies the type of this entry, one of the following: cftFile 0 cftDirectory 1 cftSymblink 2 cftSpecial 3 cftUnknown 4 cftSocket 5 cftCharDevice 6 cftBlockDevice 7 cftFIFO 8 .
- clientFileEntryGroupExecuteControls file execution permission for the group users.
- clientFileEntryGroupReadControls file read permission for the group users.
- clientFileEntryGroupWriteControls file write permission for the group users.
- clientFileEntryHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
- clientFileEntryLongNameContains the long name of the file (human-readable, ftp-like).
- clientFileEntryMTimeSpecifies the last modification time, in UTC.
- clientFileEntryNameSpecifies the file name.
- clientFileEntryOtherExecuteControls file execution permission for other users (users that are neither owners, nor belong to the same group).
- clientFileEntryOtherReadControls file read permission for other users (users that are neither owners, nor belong to the same group).
- clientFileEntryOtherWriteControls file write permission for other users (users that are neither owners, nor belong to the same group).
- clientFileEntryOwnerSpecifies the owner of the file/directory.
- clientFileEntryPathContains the full path to the file.
- clientFileEntrySizeThe size of the file in bytes.
- clientFileEntryUserExecuteControls file execution permission for the file owner.
- clientFileEntryUserReadControls file read permission for the file owner.
- clientFileEntryUserWriteControls file write permission for the file owner.
- compressionLevelSpecifies the preferable compression level.
- externalCryptoCustomParamsCustom parameters to be passed to the signing service (uninterpreted).
- externalCryptoDataAdditional data to be included in the async state and mirrored back by the requestor.
- externalCryptoExternalHashCalculationSpecifies whether the message hash is to be calculated at the external endpoint.
- externalCryptoHashAlgorithmSpecifies the request's signature hash algorithm.
- externalCryptoKeyIDThe ID of the pre-shared key used for DC request authentication.
- externalCryptoKeySecretThe pre-shared key used for DC request authentication.
- externalCryptoMethodSpecifies the asynchronous signing method.
- externalCryptoModeSpecifies the external cryptography mode.
- externalCryptoPublicKeyAlgorithmProvide public key algorithm here if the certificate is not available on the pre-signing stage.
- forceCompressionThis property specifies whether server explicitly requires data compression.
- hostSpecifies server's host name.
- keyFingerprintSHA1Contains the SHA-1 fingerprint (hash) of the key.
- keyFingerprintSHA256Contains the SHA-256 fingerprint (hash) of the key.
- keyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
- maxSFTPVersionMaximum SFTP version supported.
- minSFTPVersionMinimum SFTP version supported.
- pinnedClientAddressThe client's IP address.
- pinnedClientClientKeyAlgorithmSpecifies the client's key algorithm.
- pinnedClientClientKeyBitsSpecifies the length of the client's key.
- pinnedClientClientKeyFingerprintThe fingerprint (hash value) of the client's public key.
- pinnedClientClientSoftwareNameReturns the name of the SSH software running on the client side.
- pinnedClientCloseReasonContains the line sent by the client just before closing the connection.
- pinnedClientCompressionAlgorithmInboundCompression algorithm for the incoming traffic.
- pinnedClientCompressionAlgorithmOutboundCompression algorithm for the outgoing traffic.
- pinnedClientEncryptionAlgorithmInboundEncryption algorithm for the incoming traffic.
- pinnedClientEncryptionAlgorithmOutboundEncryption algorithm for the outgoing traffic.
- pinnedClientIDThe client connection's unique identifier.
- pinnedClientInboundEncryptionKeyBitsSpecifies the length of the key used to encrypt the incoming traffic.
- pinnedClientKexAlgorithmThe key exchange algorithm used during the SSH handshake.
- pinnedClientKexBitsThe number of bits used by the key exchange algorithm.
- pinnedClientKexLinesThe contents of the received KexInit packet.
- pinnedClientMacAlgorithmInboundMAC algorithm used for the incoming connection.
- pinnedClientMacAlgorithmOutboundMAC algorithm used for outbound connection.
- pinnedClientOutboundEncryptionKeyBitsSpecifies the length of the key used to encrypt the outgoing traffic.
- pinnedClientPortThe remote port of the client connection.
- pinnedClientPublicKeyAlgorithmSpecifies the public key algorithm which was used during the SSH handshake.
- pinnedClientServerKeyBitsSpecifies the number of bits in the server's key.
- pinnedClientServerKeyFingerprintThe fingerprint (hash value) of the server's public key.
- pinnedClientTotalBytesReceivedReturns the total number of bytes received over this connection.
- pinnedClientTotalBytesSentReturns the total number of bytes sent over this connection.
- pinnedClientVersionSpecifies SSH protocol version.
- portSpecifies the listening port number.
- readOnlySpecifies whether files on the server are read-only.
- serverKeyCountThe number of records in the ServerKey arrays.
- serverKeyAlgorithm:(int)serverKeyIndexSpecifies the key algorithm.
- serverKeyBits:(int)serverKeyIndexThe number of bits in the key: the more the better, 2048 or 4096 are typical values.
- serverKeyFingerprintMD5:(int)serverKeyIndexContains the MD5 fingerprint (hash) of the key.
- serverKeyFingerprintSHA1:(int)serverKeyIndexContains the SHA-1 fingerprint (hash) of the key.
- serverKeyHandle:(int)serverKeyIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- socketIncomingSpeedLimitThe maximum number of bytes to read from the socket, per second.
- socketLocalAddressThe local network interface to bind the socket to.
- socketLocalPortThe local port number to bind the socket to.
- socketOutgoingSpeedLimitThe maximum number of bytes to write to the socket, per second.
- socketTimeoutThe maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
- socketUseIPv6Enables or disables IP protocol version 6.
- SSHSettingsAutoAdjustCiphersWhether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.
- SSHSettingsBaseConfigurationAllows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
- SSHSettingsCompressionAlgorithmsA list of session compression algorithms separated with commas or semicolons.
- SSHSettingsCompressionLevelPossible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).
- SSHSettingsDefaultWindowSizeThe 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.
- SSHSettingsEncryptionAlgorithmsA list of session encryption algorithms separated with commas or semicolons.
- SSHSettingsForceCompressionWhether the SSH client should explicitly request compression.
- SSHSettingsGSSAuthTypesA comma-separated list of authentication types.
- SSHSettingsGSSDelegateCredsSwitches credential delegation on or off.
- SSHSettingsGSSHostnameThe GSS host name, in form of a FQDN (e.
- SSHSettingsGSSLibA path to the GSS-API library (DLL or SO).
- SSHSettingsGSSMechanismsA comma-separated list of GSS mechanisms to use.
- SSHSettingsGSSProtocolsA comma-separated list of SSPI protocols.
- SSHSettingsHandshakeTimeoutSpecifies the maximal time for the SSH handshake to proceed, in seconds.
- SSHSettingsKexAlgorithmsA list of key exchange algorithms separated with commas or semicolons.
- SSHSettingsMacAlgorithmsA list of MAC (for message authentication code ) algorithms separated with commas or semicolons.
- SSHSettingsMaxSSHPacketSizeSpecifies the maximum length of one SSH packet in bytes.
- SSHSettingsMinWindowSizeSpecifies the minimal internal window size.
- SSHSettingsObfuscateHandshakeEnables or disables handshake obfuscation.
- SSHSettingsObfuscationPasswordSpecifies the password used to encrypt the handshake when ObfuscateHandshake is set.
- SSHSettingsPublicKeyAlgorithmsA list of public key algorithms separated with commas or semicolons.
- SSHSettingsRequestPasswordChangeWhether to request a password change when connecting.
- SSHSettingsSoftwareNameThe name to be used by the class to identify itself.
- SSHSettingsTrustAllKeysEnables or disables explicit trust to all server keys.
- SSHSettingsUseAuthAgentEnables or disables the use of external key agent, such as Putty key agent.
- SSHSettingsVersionsSpecifies enabled SSH protocol versions (1 or 2).
- userCountThe number of records in the User arrays.
- userAssociatedData:(int)userIndexContains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
- userBasePath:(int)userIndexBase path for this user in the server's file system.
- userCert:(int)userIndexContains the user's certificate.
- userData:(int)userIndexContains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
- userHandle:(int)userIndexAllows to get or set a 'handle', a unique identifier of the underlying property object.
- userHashAlgorithm:(int)userIndexSpecifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user.
- userIncomingSpeedLimit:(int)userIndexSpecifies the incoming speed limit for this user.
- userOtpAlgorithm:(int)userIndexThe algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP).
- userOtpValue:(int)userIndexThe user's time interval (TOTP) or Counter (HOTP).
- userOutgoingSpeedLimit:(int)userIndexSpecifies the outgoing speed limit for this user.
- userPassword:(int)userIndexThe user's authentication password.
- userPasswordLen:(int)userIndexSpecifies the length of the user's OTP password.
- userSharedSecret:(int)userIndexContains the user's secret key, which is essentially a shared secret between the client and server.
- userSSHKey:(int)userIndexContains the user's SSH key.
- userUsername:(int)userIndexThe registered name (login) of the user.
- useUTF8Specifies whether UTF8 conversion is to be used when parsing file names.

Method List


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

- configSets or retrieves a configuration setting.
- dropClientTerminates a client connection.
- getClientBufferAcquires a piece of operation data.
- getClientFileEntryAcquires file entry details from the class.
- listClientsEnumerates the connected clients.
- pinClientTakes a snapshot of the connection's properties.
- setClientBufferCommits a data buffer to the server class.
- setClientFileEntryCommits the file entry details to the class.
- startStarts SFTP server operation.
- stopStops SFTP server.

Event List


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

- onAcceptThis event is fired when new incoming connection is accepted.
- onAfterCreateDirectoryThis event indicates completion of directory creation request.
- onAfterRemoveThis event indicates completion of file removal request.
- onAfterRenameFileThis event indicates completion of a file rename operation.
- onAfterRequestAttributesThis event indicates completion of file attributes request.
- onAfterSetAttributesThis event indicates completion of a set attributes request.
- onAuthAttemptReports a user authentication attempt.
- onAuthFailedReports user authentication failure.
- onAuthPasswordThis event is fired on password authentication attempt from a client.
- onAuthPublicKeyThis event is fired on public key authentication attempt from a client.
- onAuthSucceededReports a successful user authentication.
- onBeforeCreateDirectoryThis event is fired when a client requests to create a directory.
- onBeforeDownloadFileThis event is fired when a download file request is received.
- onBeforeFindThis event is fired when a client requests to find files and folders in Path.
- onBeforeRemoveThis event is fired when a client requests to delete a file or directory.
- onBeforeRenameFileThis event is fired when a client requests to rename a file.
- onBeforeRequestAttributesThis event is fired when a client requests to get file attributes.
- onBeforeSetAttributesThis event is fired when a client requests to set file attributes.
- onBeforeUploadFileThis event is fired when an upload file request is received.
- onCloseFileThis event instructs the application to close an opened file.
- onConnectThis event is fired when a remote connection has been established.
- onCreateDirectoryThis event instructs the application to create a directory.
- onDisconnectThis event is fired when a client has disconnected.
- onErrorInformation about errors during data delivery.
- onExternalSignHandles remote or external signing initiated by the server protocol.
- onFindCloseThis event signifies the completion of a custom file listing operation.
- onFindFirstThis event signifies the start of the custom file listing retrieval mechanism.
- onFindNextThis event retrieves the next entry of a custom file listing.
- onNotificationThis event notifies the application about an underlying control flow event.
- onOpenFileThis event instructs the application to handle the file open request.
- onReadFileThis event is fired when a file read request is received.
- onRemoveThis event is fired when a client requests to delete a file or directory.
- onRenameFileThis event is fired when a client requests to rename a file.
- onRequestAttributesThis event is fired when a get file attributes request is received.
- onSessionClosedReports session closure.
- onSessionEstablishedThis event is fired when a new session is established.
- onSetAttributesThis event is fired when an set file attributes request is received.
- onWriteFileThis event is fired when a file write request is received.

Configuration Settings


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

AuthModeControls dual/multi-type authentication mode.
CustomDHGroupIndexSets a specific Diffie-Hellman group index to enforce.
DualStackAllows the use of ip4 and ip6 simultaneously.
MaxDHGroupSizeSets the maximal Diffie-Hellman group size.
MinDHGroupSizeSets the minimal Diffie-Hellman group size.
NotifyOnFileOperationsEnables low-level file operation notifications.
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 class (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client classes should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 iOS Edition - Version 20.0 [Build 8166]