SFTPServer Component
Properties Methods Events Config Settings Errors
The SFTPServer class provides server-side functionality for SFTP connections.
Syntax
secureblackbox.SFTPServer
Remarks
SFTPServer is an implementation for SSH File Transfer Protocol server. It works over a secure SSH channel, and should not be confused with the FTP/FTPS protocol.
Property List
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
| Active | Specifies whether the SFTP server has started and ready to accept connections. |
| AuthTypes | Defines allowed authentication types. |
| BaseDir | Specifies the server's base (root) directory. |
| Capabilities | Specifies which elements of the SSH ecosystem the class must support/enable. |
| ClientFileEntryAccessTime | Contains the last access time for this file, in UTC. |
| ClientFileEntryCreationTime | Contains this file's creation time, in UTC. |
| ClientFileEntryEntryFormat | The file listing format: cfefUnknown 0 cfefUnix 1 cfefWindows 2 cfefMLSD 3 . |
| ClientFileEntryFileType | The type of the entry: fetUnknown 0 fetDirectory 1 fetFile 2 fetSymlink 3 fetSpecial 4 fetCurrentDirectory 5 fetParentDirectory 6 fetSocket 7 fetCharDevice 8 fetBlockDevice 9 fetFIFO 10 . |
| ClientFileEntryHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| ClientFileEntryModificationTime | File last modification date/time. |
| ClientFileEntryName | The file or directory name. |
| ClientFileEntryPath | The full path to the file or directory. |
| ClientFileEntryPrincipal | Specifies the owner of the file/directory. |
| ClientFileEntrySize | File size in bytes. |
| ClientFileEntryUnixPerms | The file Unix permissions bit mask (e. |
| ClientFileEntryUnparsedName | The unparsed entry as returned by the server. |
| ClientKeyFingerprintSHA1 | Contains the SHA-1 fingerprint (hash) of the key. |
| ClientKeyFingerprintSHA256 | Contains the SHA-256 fingerprint (hash) of the key. |
| ClientKeyHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| CompressionLevel | Specifies the preferable compression level. |
| ExternalCryptoAsyncDocumentID | Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls. |
| ExternalCryptoCustomParams | Custom parameters to be passed to the signing service (uninterpreted). |
| ExternalCryptoData | Additional data to be included in the async state and mirrored back by the requestor. |
| ExternalCryptoExternalHashCalculation | Specifies whether the message hash is to be calculated at the external endpoint. |
| ExternalCryptoHashAlgorithm | Specifies the request's signature hash algorithm. |
| ExternalCryptoKeyID | The ID of the pre-shared key used for DC request authentication. |
| ExternalCryptoKeySecret | The pre-shared key used for DC request authentication. |
| ExternalCryptoMethod | Specifies the asynchronous signing method. |
| ExternalCryptoMode | Specifies the external cryptography mode. |
| ExternalCryptoPublicKeyAlgorithm | Provide the public key algorithm here if the certificate is not available on the pre-signing stage. |
| FIPSMode | Reserved. |
| ForceCompression | This property specifies whether server explicitly requires data compression. |
| Host | Specifies server's host name. |
| MaxSFTPVersion | Maximum SFTP version supported. |
| MinSFTPVersion | Minimum SFTP version supported. |
| PinnedClientClientKeyAlgorithm | Specifies the client's key algorithm. |
| PinnedClientClientKeyBits | Specifies the length of the client's key. |
| PinnedClientClientKeyFingerprint | The fingerprint (hash value) of the client's public key. |
| PinnedClientCloseReason | Contains the line sent by the server just before closing the connection. |
| PinnedClientCompressionAlgorithmInbound | Compression algorithm for the incoming traffic. |
| PinnedClientCompressionAlgorithmOutbound | Compression algorithm for the outgoing traffic. |
| PinnedClientEncryptionAlgorithmInbound | Encryption algorithm for the incoming traffic. |
| PinnedClientEncryptionAlgorithmOutbound | Encryption algorithm for the outgoing traffic. |
| PinnedClientInboundEncryptionKeyBits | Specifies the length of the key used to encrypt the incoming traffic. |
| PinnedClientKexAlgorithm | The key exchange algorithm used during the SSH handshake. |
| PinnedClientKexBits | The number of bits used by the key exchange algorithm. |
| PinnedClientKexLines | The contents of the received KexInit packet. |
| PinnedClientMacAlgorithmInbound | MAC algorithm used for the incoming connection. |
| PinnedClientMacAlgorithmOutbound | MAC algorithm used for outbound connection. |
| PinnedClientOutboundEncryptionKeyBits | Specifies the length of the key used to encrypt the outgoing traffic. |
| PinnedClientPublicKeyAlgorithm | Specifies the public key algorithm which was used during the SSH handshake. |
| PinnedClientRemoteAddress | The client's IP address. |
| PinnedClientRemotePort | The remote port of the client connection. |
| PinnedClientRemoteSoftwareName | Returns the name (self-advertised) of the SSH software running on the other side. |
| PinnedClientServerKeyAlgorithm | Specifies the server's key algorithm. |
| PinnedClientServerKeyBits | Specifies the number of bits in the server's key. |
| PinnedClientServerKeyFingerprint | The fingerprint (hash value) of the server's public key. |
| PinnedClientTotalBytesReceived | Returns the total number of bytes received over this connection. |
| PinnedClientTotalBytesSent | Returns the total number of bytes sent over this connection. |
| PinnedClientVersion | Specifies SSH protocol version. |
| Port | Specifies the listening port number. |
| ReadOnly | Specifies whether files on the server are read-only. |
| ServerKeyCount | The number of records in the ServerKey arrays. |
| ServerKeyAlgorithm | Specifies the key algorithm. |
| ServerKeyBits | The number of bits in the key: the more the better, 2048 or 4096 are typical values. |
| ServerKeyFingerprintMD5 | Contains the MD5 fingerprint (hash) of the key. |
| ServerKeyFingerprintSHA1 | Contains the SHA-1 fingerprint (hash) of the key. |
| ServerKeyHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| SocketIncomingSpeedLimit | The maximum number of bytes to read from the socket, per second. |
| SocketLocalAddress | The local network interface to bind the socket to. |
| SocketLocalPort | The local port number to bind the socket to. |
| SocketOutgoingSpeedLimit | The maximum number of bytes to write to the socket, per second. |
| SocketTimeout | The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful. |
| SocketUseIPv6 | Enables or disables IP protocol version 6. |
| SSHSettingsAutoAdjustCiphers | Whether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to. |
| SSHSettingsBaseConfiguration | Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility. |
| SSHSettingsCompressionAlgorithms | A list of session compression algorithms separated with commas or semicolons. |
| SSHSettingsCompressionLevel | Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression). |
| SSHSettingsDefaultWindowSize | 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. |
| SSHSettingsEncryptionAlgorithms | A list of session encryption algorithms separated with commas or semicolons. |
| SSHSettingsForceCompression | Whether the SSH client should explicitly request compression. |
| SSHSettingsForwardAuthAgent | Enables or disables auth agent forwarding. |
| SSHSettingsGSSAuthTypes | A comma-separated list of authentication types. |
| SSHSettingsGSSDelegateCreds | Switches credential delegation on or off. |
| SSHSettingsGSSHostname | The GSS host name, in form of a FQDN (e. |
| SSHSettingsGSSLib | A path to the GSS-API library (DLL or SO). |
| SSHSettingsGSSMechanisms | A comma-separated list of GSS mechanisms to use. |
| SSHSettingsGSSProtocols | A comma-separated list of SSPI protocols. |
| SSHSettingsHandshakeTimeout | Specifies the maximal time for the SSH handshake to proceed, in seconds. |
| SSHSettingsKexAlgorithms | A list of key exchange algorithms separated with commas or semicolons. |
| SSHSettingsMacAlgorithms | A list of MAC (for message authentication code ) algorithms separated with commas or semicolons. |
| SSHSettingsMaxSSHPacketSize | Specifies the maximum length of one SSH packet in bytes. |
| SSHSettingsMinWindowSize | Specifies the minimal internal window size. |
| SSHSettingsObfuscateHandshake | Enables or disables handshake obfuscation. |
| SSHSettingsObfuscationPassword | Specifies the password used to encrypt the handshake when ObfuscateHandshake is set. |
| SSHSettingsPublicKeyAlgorithms | A list of public key algorithms separated with commas or semicolons. |
| SSHSettingsRequestPasswordChange | Whether to request a password change when connecting. |
| SSHSettingsSoftwareName | The name to be used by the class to identify itself. |
| SSHSettingsTrustAllKeys | Enables or disables explicit trust to all server keys. |
| SSHSettingsUseAuthAgent | Enables or disables the use of external key agent, such as Putty key agent. |
| SSHSettingsVersions | Specifies enabled SSH protocol versions (1 or 2). |
| UserCount | The number of records in the User arrays. |
| UserAssociatedData | Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used. |
| UserBasePath | Base path for this user in the server's file system. |
| UserCertificate | Contains the user's certificate. |
| UserData | Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings. |
| UserEmail | The user's email address. |
| UserHandle | Allows to get or set a 'handle', a unique identifier of the underlying property object. |
| UserHashAlgorithm | Specifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user. |
| UserIncomingSpeedLimit | Specifies the incoming speed limit for this user. |
| UserOtpAlgorithm | The algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP). |
| UserOTPLen | Specifies the length of the user's OTP password. |
| UserOtpValue | The user's time interval (TOTP) or Counter (HOTP). |
| UserOutgoingSpeedLimit | Specifies the outgoing speed limit for this user. |
| UserPassword | The user's authentication password. |
| UserSharedSecret | Contains the user's secret key, which is essentially a shared secret between the client and server. |
| UserSSHKey | Contains the user's SSH key. |
| Username | The registered name (login) of the user. |
| UseUTF8 | Specifies whether UTF8 conversion is to be used when parsing file names. |
Method List
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
| Cleanup | Cleans up the server environment by purging expired sessions and cleaning caches. |
| Config | Sets or retrieves a configuration setting. |
| DoAction | Performs an additional action. |
| DropClient | Terminates a client connection. |
| GetClientBuffer | Acquires a piece of operation data. |
| GetClientFileEntry | Acquires file entry details from the class. |
| ListClients | Enumerates the connected clients. |
| PinClient | Takes a snapshot of the connection's properties. |
| Reset | Resets the class settings. |
| SetClientBuffer | Commits a data buffer to the server class. |
| SetClientFileEntry | Commits the file entry details to the class. |
| Start | Starts SFTP server operation. |
| Stop | Stops SFTP server. |
Event List
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
| Accept | This event is fired when new incoming connection is accepted. |
| AfterCreateDirectory | This event indicates completion of directory creation request. |
| AfterRemove | This event indicates completion of file removal request. |
| AfterRenameFile | This event indicates completion of a file rename operation. |
| AfterRequestAttributes | This event indicates completion of file attributes request. |
| AfterSetAttributes | This event indicates completion of a set attributes request. |
| AuthAttempt | Reports a user authentication attempt. |
| AuthFailed | Reports user authentication failure. |
| AuthPassword | This event is fired on password authentication attempt from a client. |
| AuthPublicKey | This event is fired on public key authentication attempt from a client. |
| AuthSucceeded | Reports a successful user authentication. |
| BeforeCreateDirectory | This event is fired when a client requests to create a directory. |
| BeforeDownloadFile | This event is fired when a download file request is received. |
| BeforeFind | This event is fired when a client requests to find files and folders in Path. |
| BeforeOpenClientForwarding | This event is fired when a client requests to set up client-side (local) forwarding channel. |
| BeforeOpenCommand | This event is fired when a client requests a command channel. |
| BeforeOpenServerForwarding | This event is fired when the server has received an incoming connection and needs to set up server-side (remote) forwarding channel. |
| BeforeOpenShell | This event is fired when a client requests a shell channel. |
| BeforeRemove | This event is fired when a client requests to delete a file or directory. |
| BeforeRenameFile | This event is fired when a client requests to rename a file. |
| BeforeRequestAttributes | This event is fired when a client requests to get file attributes. |
| BeforeSetAttributes | This event is fired when a client requests to set file attributes. |
| BeforeUploadFile | This event is fired when an upload file request is received. |
| CloseClientForwarding | This event is fired when a client has closed a previously opened forwarding channel. |
| CloseCommand | This event is fired when a client has closed a previously opened SSH command channel. |
| CloseFile | This event instructs the application to close an opened file. |
| CloseServerForwarding | This event is fired when a client has closed a previously opened forwarding channel. |
| CloseShell | This event is fired when a client has closed a previously opened shell channel. |
| Connect | This event is fired when a remote connection has been established. |
| CreateDirectory | This event instructs the application to create a directory. |
| Disconnect | This event is fired when a client has disconnected. |
| Error | Information about errors during data delivery. |
| ExternalSign | Handles remote or external signing initiated by the server protocol. |
| FindClose | This event signifies the completion of a custom file listing operation. |
| FindFirst | This event signifies the start of the custom file listing retrieval mechanism. |
| FindNext | This event retrieves the next entry of a custom file listing. |
| ListeningStarted | Fires when the server has started accepting connections on a local port. |
| ListeningStopped | Fires when the server has stopped accepting connections on a local port. |
| Notification | This event notifies the application about an underlying control flow event. |
| OpenClientForwarding | This event is fired when a client opens a client-side (local) forwarding channel. |
| OpenCommand | This event is fired when a client has opened an SSH command channel. |
| OpenFile | This event instructs the application to handle the file open request. |
| OpenServerForwarding | This event is fired when the server opens a server-side (remote) forwarding channel. |
| OpenShell | This event is fired when a client has opened a shell channel. |
| ReadFile | This event is fired when a file read request is received. |
| Remove | This event is fired when a client requests to delete a file or directory. |
| RenameFile | This event is fired when a client requests to rename a file. |
| RequestAttributes | This event is fired when a get file attributes request is received. |
| ServerForwardingCancel | This event is fired when the client cancels a previously negotiated server-side (remote) forwarding. |
| ServerForwardingOpenFailed | This event is fired when the client rejects the server request to establish a server forwarding channel. |
| ServerForwardingRequest | This event is fired when the client requests the server to set up server-side (remote) forwarding. |
| SessionClosed | Reports session closure. |
| SessionEstablished | This event is fired when a new session is established. |
| SetAttributes | This event is fired when an set file attributes request is received. |
| TranslatePath | This event is fired when a client requests the server to translate a path to its absolute form. |
| WriteFile | This event is fired when a file write request is received. |
Config Settings
The following is a list of config settings for the component with short descriptions. Click on the links for further details.
| AllAlgorithms | Returns the list of algorithms enabled in the class. |
| AsyncDataWindowManagement | TBD. |
| AuthMode | Controls dual/multi-type authentication mode. |
| AutoGenerateLongNames | TBD. |
| Banner[i] | TBD. |
| BannerSendStage | TBD. |
| CloseIfNoActiveTunnels | TBD. |
| CommandModeEnabled | TBD. |
| CompressionAlgorithms | Returns the list of compression algorithms enabled in the class. |
| CustomDHGroupIndex | Sets a specific Diffie-Hellman group index to enforce. |
| DefBanner | TBD. |
| DefLanguageTag | TBD. |
| DualStack | Allows the use of ip4 and ip6 simultaneously. |
| EncryptionAlgorithms | Returns the list of encryption algorithms enabled in the class. |
| KexAlgorithms | Returns the list of key exchange algorithms enabled in the class. |
| LanguageTag[i] | TBD. |
| MacAlgorithms | Returns the list of MAC algorithms enabled in the class. |
| MaxDHGroupSize | Sets the maximal Diffie-Hellman group size. |
| MinDHGroupSize | Sets the minimal Diffie-Hellman group size. |
| NotifyOnFileOperations | Enables low-level file operation notifications. |
| PublicKeyAlgorithms | Returns the list of public key algorithms enabled in the class. |
| RefreshUsers | Enables or disables real-time propagation of user information. |
| SFTPModeEnabled | TBD. |
| ShellModeEnabled | TBD. |
| UseStrictKeyExchange | Specifies how strict key exchange is supported. |
| ASN1UseGlobalTagCache | Controls whether ASN.1 module should use a global object cache. |
| AssignSystemSmartCardPins | Specifies whether CSP-level PINs should be assigned to CNG keys. |
| CheckKeyIntegrityBeforeUse | Enables or disable private key integrity check before use. |
| CookieCaching | Specifies whether a cookie cache should be used for HTTP(S) transports. |
| Cookies | Gets or sets local cookies for the class. |
| DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
| DNSLocalSuffix | The suffix to assign for TLD names. |
| EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
| EnableSSHMLKEM | Enables support for ML-KEM/hybrid key exchange algorithms in SSH client and server classes. |
| EnableTLSMLKEM | Enables support for ML-KEM and hybrid groups in TLS client and server classes. |
| GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
| HardwareCryptoUsePolicy | The hardware crypto usage policy. |
| HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
| HttpVersion | The HTTP version to use in any inner HTTP client classes created. |
| IgnoreExpiredMSCTLSigningCert | Whether to tolerate the expired Windows Update signing certificate. |
| ListDelimiter | The delimiter character for multi-element lists. |
| LogDestination | Specifies the debug log destination. |
| LogDetails | Specifies the debug log details to dump. |
| LogFile | Specifies the debug log filename. |
| LogFilters | Specifies the debug log filters. |
| LogFlushMode | Specifies the log flush mode. |
| LogLevel | Specifies the debug log level. |
| LogMaxEventCount | Specifies the maximum number of events to cache before further action is taken. |
| LogRotationMode | Specifies the log rotation mode. |
| MaxASN1BufferLength | Specifies the maximal allowed length for ASN.1 primitive tag data. |
| MaxASN1TreeDepth | Specifies the maximal depth for processed ASN.1 trees. |
| OCSPHashAlgorithm | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
| OldClientSideRSAFallback | Specifies whether the SSH client should use a SHA1 fallback. |
| PKICache | Specifies which PKI elements (certificates, CRLs, OCSP responses) should be cached. |
| PKICachePath | Specifies the file system path where cached PKI data is stored. |
| ProductVersion | Returns the version of the SecureBlackbox library. |
| ServerSSLDHKeyLength | Sets the size of the TLS DHE key exchange group. |
| StaticDNS | Specifies whether static DNS rules should be used. |
| StaticIPAddress[domain] | Gets or sets an IP address for the specified domain name. |
| StaticIPAddresses | Gets or sets all the static DNS rules. |
| Tag | Allows to store any custom data. |
| TLSSessionGroup | Specifies the group name of TLS sessions to be used for session resumption. |
| TLSSessionLifetime | Specifies lifetime in seconds of the cached TLS session. |
| TLSSessionPurgeInterval | Specifies how often the session cache should remove the expired TLS sessions. |
| UseCRLObjectCaching | Specifies whether reuse of loaded CRL objects is enabled. |
| UseInternalRandom | Switches between SecureBlackbox-own and platform PRNGs. |
| UseLegacyAdESValidation | Enables legacy AdES validation mode. |
| UseOCSPResponseObjectCaching | Specifies whether reuse of loaded OCSP response objects is enabled. |
| UseOwnDNSResolver | Specifies whether the client classes should use own DNS resolver. |
| UseSharedSystemStorages | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
| UseSystemNativeSizeCalculation | An internal CryptoAPI access tweak. |
| UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
| UseSystemRandom | Enables or disables the use of the OS PRNG. |
| XMLRDNDescriptorName[OID] | Defines an OID mapping to descriptor names for the certificate's IssuerRDN or SubjectRDN. |
| XMLRDNDescriptorPriority[OID] | Specifies the priority of descriptor names associated with a specific OID. |
| XMLRDNDescriptorReverseOrder | Specifies whether to reverse the order of descriptors in RDN. |
| XMLRDNDescriptorSeparator | Specifies the separator used between descriptors in RDN. |
Active Property (SFTPServer Component)
Specifies whether the SFTP server has started and ready to accept connections.
Syntax
func (obj *SFTPServer) Active() (bool, error)
Default Value
false
Remarks
Check this property to find out whether the SFTP server is in active mode. Use Start and Stop methods to activate or deactivate the server.
This property is read-only.
Data Type
bool
AuthTypes Property (SFTPServer Component)
Defines allowed authentication types.
Syntax
func (obj *SFTPServer) AuthTypes() (int32, error)
func (obj *SFTPServer) SetAuthTypes(value int32) error
Default Value
30
Remarks
Use this property to define which authentication types are allowed on the server, set of
| atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
| atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
| atPassword | 0x04 | Password-based authentication |
| atHostbased | 0x08 | Hostbased authentication |
| atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
| atGssWithMic | 0x20 | GSS authentication |
| atGssKeyex | 0x40 | GSS authentication with key exchange |
| atPublicKeyAgent | 0x80 | Public key agent authentication |
Data Type
int32
BaseDir Property (SFTPServer Component)
Specifies the server's base (root) directory.
Syntax
func (obj *SFTPServer) BaseDir() (string, error)
func (obj *SFTPServer) SetBaseDir(value string) error
Default Value
""
Remarks
Use this property to set the base (root) directory on the server.
NOTE: If this property is not specified, it will default to the root of the system drive (C:\ on Windows).
Data Type
string
Capabilities Property (SFTPServer Component)
Specifies which elements of the SSH ecosystem the class must support/enable.
Syntax
func (obj *SFTPServer) Capabilities() (int32, error)
func (obj *SFTPServer) SetCapabilities(value int32) error
Default Value
1
Remarks
Use this property to specify the capabilities of the SSH framework the component must support by adjusting the following bit flags:
| scSFTP | 0x01 | SFTP (secure file transfer) |
| scShell | 0x02 | Remote shell access |
| scCommand | 0x04 | Remote command execution |
| scClientForwarding | 0x08 | Local (client-side) forwarding |
| scServerForwarding | 0x10 | Remote (server-side) forwarding |
Data Type
int32
ClientFileEntryAccessTime Property (SFTPServer Component)
Contains the last access time for this file, in UTC.
Syntax
func (obj *SFTPServer) ClientFileEntryAccessTime() (string, error)
func (obj *SFTPServer) SetClientFileEntryAccessTime(value string) error
Default Value
""
Remarks
Contains the last access time for this file, in UTC.
Data Type
string
ClientFileEntryCreationTime Property (SFTPServer Component)
Contains this file's creation time, in UTC.
Syntax
func (obj *SFTPServer) ClientFileEntryCreationTime() (string, error)
func (obj *SFTPServer) SetClientFileEntryCreationTime(value string) error
Default Value
""
Remarks
Contains this file's creation time, in UTC.
Data Type
string
ClientFileEntryEntryFormat Property (SFTPServer Component)
The file listing format: cfefUnknown 0 cfefUnix 1 cfefWindows 2 cfefMLSD 3 .
Syntax
func (obj *SFTPServer) ClientFileEntryEntryFormat() (int32, error)
func (obj *SFTPServer) SetClientFileEntryEntryFormat(value int32) error
Possible Values
0 // Unknown
1 // Unix
2 // Windows
3 // MLSD
Default Value
0
Remarks
The file listing format:
| cfefUnknown | 0 |
| cfefUnix | 1 |
| cfefWindows | 2 |
| cfefMLSD | 3 |
Data Type
int32
ClientFileEntryFileType Property (SFTPServer Component)
The type of the entry: fetUnknown 0 fetDirectory 1 fetFile 2 fetSymlink 3 fetSpecial 4 fetCurrentDirectory 5 fetParentDirectory 6 fetSocket 7 fetCharDevice 8 fetBlockDevice 9 fetFIFO 10 .
Syntax
func (obj *SFTPServer) ClientFileEntryFileType() (int32, error)
func (obj *SFTPServer) SetClientFileEntryFileType(value int32) error
Possible Values
0 // Unknown
1 // Directory
2 // File
3 // Symlink
4 // Special
5 // CurrentDirectory
6 // ParentDirectory
7 // Socket
8 // CharDevice
9 // BlockDevice
10 // FIFO
Default Value
0
Remarks
The type of the entry:
| fetUnknown | 0 |
| fetDirectory | 1 |
| fetFile | 2 |
| fetSymlink | 3 |
| fetSpecial | 4 |
| fetCurrentDirectory | 5 |
| fetParentDirectory | 6 |
| fetSocket | 7 |
| fetCharDevice | 8 |
| fetBlockDevice | 9 |
| fetFIFO | 10 |
Data Type
int32
ClientFileEntryHandle Property (SFTPServer Component)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
func (obj *SFTPServer) ClientFileEntryHandle() (int64, error)
func (obj *SFTPServer) SetClientFileEntryHandle(value int64) error
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
int64
ClientFileEntryModificationTime Property (SFTPServer Component)
File last modification date/time.
Syntax
func (obj *SFTPServer) ClientFileEntryModificationTime() (string, error)
func (obj *SFTPServer) SetClientFileEntryModificationTime(value string) error
Default Value
""
Remarks
File last modification date/time.
Data Type
string
ClientFileEntryName Property (SFTPServer Component)
The file or directory name.
Syntax
func (obj *SFTPServer) ClientFileEntryName() (string, error)
func (obj *SFTPServer) SetClientFileEntryName(value string) error
Default Value
""
Remarks
The file or directory name.
Data Type
string
ClientFileEntryPath Property (SFTPServer Component)
The full path to the file or directory.
Syntax
func (obj *SFTPServer) ClientFileEntryPath() (string, error)
func (obj *SFTPServer) SetClientFileEntryPath(value string) error
Default Value
""
Remarks
The full path to the file or directory.
Data Type
string
ClientFileEntryPrincipal Property (SFTPServer Component)
Specifies the owner of the file/directory.
Syntax
func (obj *SFTPServer) ClientFileEntryPrincipal() (string, error)
func (obj *SFTPServer) SetClientFileEntryPrincipal(value string) error
Default Value
""
Remarks
Specifies the owner of the file/directory.
Note: in earlier versions this property was called Owner. It was renamed to Principal to avoid clashes with certain SDK namings.
Data Type
string
ClientFileEntrySize Property (SFTPServer Component)
File size in bytes.
Syntax
func (obj *SFTPServer) ClientFileEntrySize() (int64, error)
func (obj *SFTPServer) SetClientFileEntrySize(value int64) error
Default Value
0
Remarks
File size in bytes.
Data Type
int64
ClientFileEntryUnixPerms Property (SFTPServer Component)
The file Unix permissions bit mask (e.
Syntax
func (obj *SFTPServer) ClientFileEntryUnixPerms() (int32, error)
func (obj *SFTPServer) SetClientFileEntryUnixPerms(value int32) error
Default Value
511
Remarks
The file Unix permissions bit mask (e.g. rwxrwxrwx=511 (0777); rwxr--r--=484 (0744)).
Data Type
int32
ClientFileEntryUnparsedName Property (SFTPServer Component)
The unparsed entry as returned by the server.
Syntax
func (obj *SFTPServer) ClientFileEntryUnparsedName() (string, error)
func (obj *SFTPServer) SetClientFileEntryUnparsedName(value string) error
Default Value
""
Remarks
The unparsed entry as returned by the server. Sometimes this is also known as "long name".
Data Type
string
ClientKeyFingerprintSHA1 Property (SFTPServer Component)
Contains the SHA-1 fingerprint (hash) of the key.
Syntax
func (obj *SFTPServer) ClientKeyFingerprintSHA1() (string, error)
Default Value
""
Remarks
Contains the SHA-1 fingerprint (hash) of the key.
This property is read-only.
Data Type
string
ClientKeyFingerprintSHA256 Property (SFTPServer Component)
Contains the SHA-256 fingerprint (hash) of the key.
Syntax
func (obj *SFTPServer) ClientKeyFingerprintSHA256() (string, error)
Default Value
""
Remarks
Contains the SHA-256 fingerprint (hash) of the key.
This property is read-only.
Data Type
string
ClientKeyHandle Property (SFTPServer Component)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
func (obj *SFTPServer) ClientKeyHandle() (int64, error)
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
int64
CompressionLevel Property (SFTPServer Component)
Specifies the preferable compression level.
Syntax
func (obj *SFTPServer) CompressionLevel() (int32, error)
func (obj *SFTPServer) SetCompressionLevel(value int32) error
Default Value
9
Remarks
Set this property before starting the server. Possible values range from 0 (lowest compression) to 9 (maximum compression). This property is ignored if compression wasn't accepted.
Data Type
int32
ExternalCryptoAsyncDocumentID Property (SFTPServer Component)
Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls.
Syntax
func (obj *SFTPServer) ExternalCryptoAsyncDocumentID() (string, error)
func (obj *SFTPServer) SetExternalCryptoAsyncDocumentID(value string) error
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
ExternalCryptoCustomParams Property (SFTPServer Component)
Custom parameters to be passed to the signing service (uninterpreted).
Syntax
func (obj *SFTPServer) ExternalCryptoCustomParams() (string, error)
func (obj *SFTPServer) SetExternalCryptoCustomParams(value string) error
Default Value
""
Remarks
Custom parameters to be passed to the signing service (uninterpreted).
Data Type
string
ExternalCryptoData Property (SFTPServer Component)
Additional data to be included in the async state and mirrored back by the requestor.
Syntax
func (obj *SFTPServer) ExternalCryptoData() (string, error)
func (obj *SFTPServer) SetExternalCryptoData(value string) error
Default Value
""
Remarks
Additional data to be included in the async state and mirrored back by the requestor.
Data Type
string
ExternalCryptoExternalHashCalculation Property (SFTPServer Component)
Specifies whether the message hash is to be calculated at the external endpoint.
Syntax
func (obj *SFTPServer) ExternalCryptoExternalHashCalculation() (bool, error)
func (obj *SFTPServer) SetExternalCryptoExternalHashCalculation(value bool) error
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
ExternalCryptoHashAlgorithm Property (SFTPServer Component)
Specifies the request's signature hash algorithm.
Syntax
func (obj *SFTPServer) ExternalCryptoHashAlgorithm() (string, error)
func (obj *SFTPServer) SetExternalCryptoHashAlgorithm(value string) error
Default Value
"SHA256"
Remarks
Specifies the request's signature hash algorithm.
| SB_HASH_ALGORITHM_SHA1 | SHA1 | |
| SB_HASH_ALGORITHM_SHA224 | SHA224 | |
| SB_HASH_ALGORITHM_SHA256 | SHA256 | |
| SB_HASH_ALGORITHM_SHA384 | SHA384 | |
| SB_HASH_ALGORITHM_SHA512 | SHA512 | |
| SB_HASH_ALGORITHM_MD2 | MD2 | |
| SB_HASH_ALGORITHM_MD4 | MD4 | |
| SB_HASH_ALGORITHM_MD5 | MD5 | |
| SB_HASH_ALGORITHM_RIPEMD160 | RIPEMD160 | |
| SB_HASH_ALGORITHM_CRC32 | CRC32 | |
| SB_HASH_ALGORITHM_SSL3 | SSL3 | |
| SB_HASH_ALGORITHM_GOST_R3411_1994 | GOST1994 | |
| SB_HASH_ALGORITHM_WHIRLPOOL | WHIRLPOOL | |
| SB_HASH_ALGORITHM_POLY1305 | POLY1305 | |
| SB_HASH_ALGORITHM_SHA3_224 | SHA3_224 | |
| SB_HASH_ALGORITHM_SHA3_256 | SHA3_256 | |
| SB_HASH_ALGORITHM_SHA3_384 | SHA3_384 | |
| SB_HASH_ALGORITHM_SHA3_512 | SHA3_512 | |
| SB_HASH_ALGORITHM_BLAKE2S_128 | BLAKE2S_128 | |
| SB_HASH_ALGORITHM_BLAKE2S_160 | BLAKE2S_160 | |
| SB_HASH_ALGORITHM_BLAKE2S_224 | BLAKE2S_224 | |
| SB_HASH_ALGORITHM_BLAKE2S_256 | BLAKE2S_256 | |
| SB_HASH_ALGORITHM_BLAKE2B_160 | BLAKE2B_160 | |
| SB_HASH_ALGORITHM_BLAKE2B_256 | BLAKE2B_256 | |
| SB_HASH_ALGORITHM_BLAKE2B_384 | BLAKE2B_384 | |
| SB_HASH_ALGORITHM_BLAKE2B_512 | BLAKE2B_512 | |
| SB_HASH_ALGORITHM_SHAKE_128 | SHAKE_128 | |
| SB_HASH_ALGORITHM_SHAKE_256 | SHAKE_256 | |
| SB_HASH_ALGORITHM_SHAKE_128_LEN | SHAKE_128_LEN | |
| SB_HASH_ALGORITHM_SHAKE_256_LEN | SHAKE_256_LEN |
Data Type
string
ExternalCryptoKeyID Property (SFTPServer Component)
The ID of the pre-shared key used for DC request authentication.
Syntax
func (obj *SFTPServer) ExternalCryptoKeyID() (string, error)
func (obj *SFTPServer) SetExternalCryptoKeyID(value string) error
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 ExternalCryptoKeySecret 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
ExternalCryptoKeySecret Property (SFTPServer Component)
The pre-shared key used for DC request authentication.
Syntax
func (obj *SFTPServer) ExternalCryptoKeySecret() (string, error)
func (obj *SFTPServer) SetExternalCryptoKeySecret(value string) error
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 ExternalCryptoKeyID topic.
Data Type
string
ExternalCryptoMethod Property (SFTPServer Component)
Specifies the asynchronous signing method.
Syntax
func (obj *SFTPServer) ExternalCryptoMethod() (int32, error)
func (obj *SFTPServer) SetExternalCryptoMethod(value int32) error
Possible Values
0 // PKCS1
1 // PKCS7
Default Value
0
Remarks
Specifies the asynchronous signing method. This is typically defined by the DC server capabilities and setup.
Available options:
| asmdPKCS1 | 0 |
| asmdPKCS7 | 1 |
Data Type
int32
ExternalCryptoMode Property (SFTPServer Component)
Specifies the external cryptography mode.
Syntax
func (obj *SFTPServer) ExternalCryptoMode() (int32, error)
func (obj *SFTPServer) SetExternalCryptoMode(value int32) error
Possible Values
0 // Default
1 // Disabled
2 // Generic
3 // DCAuth
4 // DCAuthJSON
Default Value
0
Remarks
Specifies the external cryptography mode.
Available options:
| ecmDefault | The default value (0) |
| ecmDisabled | Do not use DC or external signing (1) |
| ecmGeneric | Generic external signing with the OnExternalSign event (2) |
| ecmDCAuth | DCAuth signing (3) |
| ecmDCAuthJSON | DCAuth signing in JSON format (4) |
Data Type
int32
ExternalCryptoPublicKeyAlgorithm Property (SFTPServer Component)
Provide the public key algorithm here if the certificate is not available on the pre-signing stage.
Syntax
func (obj *SFTPServer) ExternalCryptoPublicKeyAlgorithm() (string, error)
func (obj *SFTPServer) SetExternalCryptoPublicKeyAlgorithm(value string) error
Default Value
""
Remarks
Provide the public key algorithm here if the certificate is not available on the pre-signing stage.
| SB_CERT_ALGORITHM_ID_RSA_ENCRYPTION | rsaEncryption | |
| SB_CERT_ALGORITHM_MD2_RSA_ENCRYPTION | md2withRSAEncryption | |
| SB_CERT_ALGORITHM_MD5_RSA_ENCRYPTION | md5withRSAEncryption | |
| SB_CERT_ALGORITHM_SHA1_RSA_ENCRYPTION | sha1withRSAEncryption | |
| SB_CERT_ALGORITHM_ID_DSA | id-dsa | |
| SB_CERT_ALGORITHM_ID_DSA_SHA1 | id-dsa-with-sha1 | |
| SB_CERT_ALGORITHM_DH_PUBLIC | dhpublicnumber | |
| SB_CERT_ALGORITHM_SHA224_RSA_ENCRYPTION | sha224WithRSAEncryption | |
| SB_CERT_ALGORITHM_SHA256_RSA_ENCRYPTION | sha256WithRSAEncryption | |
| SB_CERT_ALGORITHM_SHA384_RSA_ENCRYPTION | sha384WithRSAEncryption | |
| SB_CERT_ALGORITHM_SHA512_RSA_ENCRYPTION | sha512WithRSAEncryption | |
| SB_CERT_ALGORITHM_ID_RSAPSS | id-RSASSA-PSS | |
| SB_CERT_ALGORITHM_ID_RSAOAEP | id-RSAES-OAEP | |
| SB_CERT_ALGORITHM_RSASIGNATURE_RIPEMD160 | ripemd160withRSA | |
| SB_CERT_ALGORITHM_ID_ELGAMAL | elGamal | |
| SB_CERT_ALGORITHM_SHA1_ECDSA | ecdsa-with-SHA1 | |
| SB_CERT_ALGORITHM_RECOMMENDED_ECDSA | ecdsa-recommended | |
| SB_CERT_ALGORITHM_SHA224_ECDSA | ecdsa-with-SHA224 | |
| SB_CERT_ALGORITHM_SHA256_ECDSA | ecdsa-with-SHA256 | |
| SB_CERT_ALGORITHM_SHA384_ECDSA | ecdsa-with-SHA384 | |
| SB_CERT_ALGORITHM_SHA512_ECDSA | ecdsa-with-SHA512 | |
| SB_CERT_ALGORITHM_EC | id-ecPublicKey | |
| SB_CERT_ALGORITHM_SPECIFIED_ECDSA | ecdsa-specified | |
| SB_CERT_ALGORITHM_GOST_R3410_1994 | id-GostR3410-94 | |
| SB_CERT_ALGORITHM_GOST_R3410_2001 | id-GostR3410-2001 | |
| SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_1994 | id-GostR3411-94-with-GostR3410-94 | |
| SB_CERT_ALGORITHM_GOST_R3411_WITH_R3410_2001 | id-GostR3411-94-with-GostR3410-2001 | |
| SB_CERT_ALGORITHM_SHA1_ECDSA_PLAIN | ecdsa-plain-SHA1 | |
| SB_CERT_ALGORITHM_SHA224_ECDSA_PLAIN | ecdsa-plain-SHA224 | |
| SB_CERT_ALGORITHM_SHA256_ECDSA_PLAIN | ecdsa-plain-SHA256 | |
| SB_CERT_ALGORITHM_SHA384_ECDSA_PLAIN | ecdsa-plain-SHA384 | |
| SB_CERT_ALGORITHM_SHA512_ECDSA_PLAIN | ecdsa-plain-SHA512 | |
| SB_CERT_ALGORITHM_RIPEMD160_ECDSA_PLAIN | ecdsa-plain-RIPEMD160 | |
| SB_CERT_ALGORITHM_WHIRLPOOL_RSA_ENCRYPTION | whirlpoolWithRSAEncryption | |
| SB_CERT_ALGORITHM_ID_DSA_SHA224 | id-dsa-with-sha224 | |
| SB_CERT_ALGORITHM_ID_DSA_SHA256 | id-dsa-with-sha256 | |
| SB_CERT_ALGORITHM_SHA3_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-224 | |
| SB_CERT_ALGORITHM_SHA3_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-256 | |
| SB_CERT_ALGORITHM_SHA3_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-384 | |
| SB_CERT_ALGORITHM_SHA3_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-sha3-512 | |
| SB_CERT_ALGORITHM_SHA3_224_ECDSA | id-ecdsa-with-sha3-224 | |
| SB_CERT_ALGORITHM_SHA3_256_ECDSA | id-ecdsa-with-sha3-256 | |
| SB_CERT_ALGORITHM_SHA3_384_ECDSA | id-ecdsa-with-sha3-384 | |
| SB_CERT_ALGORITHM_SHA3_512_ECDSA | id-ecdsa-with-sha3-512 | |
| SB_CERT_ALGORITHM_SHA3_224_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-224 | |
| SB_CERT_ALGORITHM_SHA3_256_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-256 | |
| SB_CERT_ALGORITHM_SHA3_384_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-384 | |
| SB_CERT_ALGORITHM_SHA3_512_ECDSA_PLAIN | id-ecdsa-plain-with-sha3-512 | |
| SB_CERT_ALGORITHM_ID_DSA_SHA3_224 | id-dsa-with-sha3-224 | |
| SB_CERT_ALGORITHM_ID_DSA_SHA3_256 | id-dsa-with-sha3-256 | |
| SB_CERT_ALGORITHM_BLAKE2S_128_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s128 | |
| SB_CERT_ALGORITHM_BLAKE2S_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s160 | |
| SB_CERT_ALGORITHM_BLAKE2S_224_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s224 | |
| SB_CERT_ALGORITHM_BLAKE2S_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2s256 | |
| SB_CERT_ALGORITHM_BLAKE2B_160_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b160 | |
| SB_CERT_ALGORITHM_BLAKE2B_256_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b256 | |
| SB_CERT_ALGORITHM_BLAKE2B_384_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b384 | |
| SB_CERT_ALGORITHM_BLAKE2B_512_RSA_ENCRYPTION | id-rsassa-pkcs1-v1_5-with-blake2b512 | |
| SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA | id-ecdsa-with-blake2s128 | |
| SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA | id-ecdsa-with-blake2s160 | |
| SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA | id-ecdsa-with-blake2s224 | |
| SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA | id-ecdsa-with-blake2s256 | |
| SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA | id-ecdsa-with-blake2b160 | |
| SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA | id-ecdsa-with-blake2b256 | |
| SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA | id-ecdsa-with-blake2b384 | |
| SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA | id-ecdsa-with-blake2b512 | |
| SB_CERT_ALGORITHM_BLAKE2S_128_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s128 | |
| SB_CERT_ALGORITHM_BLAKE2S_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s160 | |
| SB_CERT_ALGORITHM_BLAKE2S_224_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s224 | |
| SB_CERT_ALGORITHM_BLAKE2S_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2s256 | |
| SB_CERT_ALGORITHM_BLAKE2B_160_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b160 | |
| SB_CERT_ALGORITHM_BLAKE2B_256_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b256 | |
| SB_CERT_ALGORITHM_BLAKE2B_384_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b384 | |
| SB_CERT_ALGORITHM_BLAKE2B_512_ECDSA_PLAIN | id-ecdsa-plain-with-blake2b512 | |
| SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_224 | id-dsa-with-blake2s224 | |
| SB_CERT_ALGORITHM_ID_DSA_BLAKE2S_256 | id-dsa-with-blake2s256 | |
| SB_CERT_ALGORITHM_EDDSA_ED25519 | id-Ed25519 | |
| SB_CERT_ALGORITHM_EDDSA_ED448 | id-Ed448 | |
| SB_CERT_ALGORITHM_EDDSA_ED25519_PH | id-Ed25519ph | |
| SB_CERT_ALGORITHM_EDDSA_ED448_PH | id-Ed448ph | |
| SB_CERT_ALGORITHM_EDDSA | id-EdDSA | |
| SB_CERT_ALGORITHM_EDDSA_SIGNATURE | id-EdDSA-sig | |
| SB_CERT_ALGORITHM_MLDSA_44 | id-ml-dsa-44 | |
| SB_CERT_ALGORITHM_MLDSA_65 | id-ml-dsa-65 | |
| SB_CERT_ALGORITHM_MLDSA_87 | id-ml-dsa-87 | |
| SB_CERT_ALGORITHM_HASH_MLDSA_44_SHA512 | id-hash-ml-dsa-44-with-sha512 | |
| SB_CERT_ALGORITHM_HASH_MLDSA_65_SHA512 | id-hash-ml-dsa-65-with-sha512 | |
| SB_CERT_ALGORITHM_HASH_MLDSA_87_SHA512 | id-hash-ml-dsa-87-with-sha512 | |
| SB_CERT_ALGORITHM_MLKEM_512 | id-ml-kem-512 | |
| SB_CERT_ALGORITHM_MLKEM_768 | id-ml-kem-768 | |
| SB_CERT_ALGORITHM_MLKEM_1024 | id-ml-kem-1024 |
Data Type
string
FIPSMode Property (SFTPServer Component)
Reserved.
Syntax
func (obj *SFTPServer) FIPSMode() (bool, error)
func (obj *SFTPServer) SetFIPSMode(value bool) error
Default Value
false
Remarks
This property is reserved for future use.
Data Type
bool
ForceCompression Property (SFTPServer Component)
This property specifies whether server explicitly requires data compression.
Syntax
func (obj *SFTPServer) ForceCompression() (bool, error)
func (obj *SFTPServer) SetForceCompression(value bool) error
Default Value
false
Remarks
Set this property before starting the server. If it is set to true, the struct will explicitly request data compression. If it is set to False, the struct will support compression, although compression will be used only if the remote party doesn't support algorithms without compression.
Data Type
bool
Host Property (SFTPServer Component)
Specifies server's host name.
Syntax
func (obj *SFTPServer) Host() (string, error)
func (obj *SFTPServer) SetHost(value string) error
Default Value
""
Remarks
Use this property to set the host name for this server.
Data Type
string
MaxSFTPVersion Property (SFTPServer Component)
Maximum SFTP version supported.
Syntax
func (obj *SFTPServer) MaxSFTPVersion() (int32, error)
func (obj *SFTPServer) SetMaxSFTPVersion(value int32) error
Default Value
6
Remarks
MaxSFTPVersion and MinSFTPVersion properties control the range of SFTP protocol versions supported by this server.
Data Type
int32
MinSFTPVersion Property (SFTPServer Component)
Minimum SFTP version supported.
Syntax
func (obj *SFTPServer) MinSFTPVersion() (int32, error)
func (obj *SFTPServer) SetMinSFTPVersion(value int32) error
Default Value
0
Remarks
MaxSFTPVersion and MinSFTPVersion properties control the range of SFTP protocol versions supported by this server.
Data Type
int32
PinnedClientClientKeyAlgorithm Property (SFTPServer Component)
Specifies the client's key algorithm.
Syntax
func (obj *SFTPServer) PinnedClientClientKeyAlgorithm() (string, error)
Default Value
""
Remarks
Specifies the client's key algorithm.
This property is read-only.
Data Type
string
PinnedClientClientKeyBits Property (SFTPServer Component)
Specifies the length of the client's key.
Syntax
func (obj *SFTPServer) PinnedClientClientKeyBits() (int32, error)
Default Value
0
Remarks
Specifies the length of the client's key.
This property is read-only.
Data Type
int32
PinnedClientClientKeyFingerprint Property (SFTPServer Component)
The fingerprint (hash value) of the client's public key.
Syntax
func (obj *SFTPServer) PinnedClientClientKeyFingerprint() (string, error)
Default Value
""
Remarks
The fingerprint (hash value) of the client's public key.
This property is read-only.
Data Type
string
PinnedClientCloseReason Property (SFTPServer Component)
Contains the line sent by the server just before closing the connection.
Syntax
func (obj *SFTPServer) PinnedClientCloseReason() (string, error)
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
PinnedClientCompressionAlgorithmInbound Property (SFTPServer Component)
Compression algorithm for the incoming traffic.
Syntax
func (obj *SFTPServer) PinnedClientCompressionAlgorithmInbound() (string, error)
Default Value
""
Remarks
Compression algorithm for the incoming traffic.
This property is read-only.
Data Type
string
PinnedClientCompressionAlgorithmOutbound Property (SFTPServer Component)
Compression algorithm for the outgoing traffic.
Syntax
func (obj *SFTPServer) PinnedClientCompressionAlgorithmOutbound() (string, error)
Default Value
""
Remarks
Compression algorithm for the outgoing traffic.
This property is read-only.
Data Type
string
PinnedClientEncryptionAlgorithmInbound Property (SFTPServer Component)
Encryption algorithm for the incoming traffic.
Syntax
func (obj *SFTPServer) PinnedClientEncryptionAlgorithmInbound() (string, error)
Default Value
""
Remarks
Encryption algorithm for the incoming traffic.
This property is read-only.
Data Type
string
PinnedClientEncryptionAlgorithmOutbound Property (SFTPServer Component)
Encryption algorithm for the outgoing traffic.
Syntax
func (obj *SFTPServer) PinnedClientEncryptionAlgorithmOutbound() (string, error)
Default Value
""
Remarks
Encryption algorithm for the outgoing traffic.
This property is read-only.
Data Type
string
PinnedClientInboundEncryptionKeyBits Property (SFTPServer Component)
Specifies the length of the key used to encrypt the incoming traffic.
Syntax
func (obj *SFTPServer) PinnedClientInboundEncryptionKeyBits() (int32, error)
Default Value
0
Remarks
Specifies the length of the key used to encrypt the incoming traffic.
This property is read-only.
Data Type
int32
PinnedClientKexAlgorithm Property (SFTPServer Component)
The key exchange algorithm used during the SSH handshake.
Syntax
func (obj *SFTPServer) PinnedClientKexAlgorithm() (string, error)
Default Value
""
Remarks
The key exchange algorithm used during the SSH handshake.
This property is read-only.
Data Type
string
PinnedClientKexBits Property (SFTPServer Component)
The number of bits used by the key exchange algorithm.
Syntax
func (obj *SFTPServer) PinnedClientKexBits() (int32, error)
Default Value
0
Remarks
The number of bits used by the key exchange algorithm.
This property is read-only.
Data Type
int32
PinnedClientKexLines Property (SFTPServer Component)
The contents of the received KexInit packet.
Syntax
func (obj *SFTPServer) PinnedClientKexLines() (string, error)
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
PinnedClientMacAlgorithmInbound Property (SFTPServer Component)
MAC algorithm used for the incoming connection.
Syntax
func (obj *SFTPServer) PinnedClientMacAlgorithmInbound() (string, error)
Default Value
""
Remarks
MAC algorithm used for the incoming connection.
This property is read-only.
Data Type
string
PinnedClientMacAlgorithmOutbound Property (SFTPServer Component)
MAC algorithm used for outbound connection.
Syntax
func (obj *SFTPServer) PinnedClientMacAlgorithmOutbound() (string, error)
Default Value
""
Remarks
MAC algorithm used for outbound connection.
This property is read-only.
Data Type
string
PinnedClientOutboundEncryptionKeyBits Property (SFTPServer Component)
Specifies the length of the key used to encrypt the outgoing traffic.
Syntax
func (obj *SFTPServer) PinnedClientOutboundEncryptionKeyBits() (int32, error)
Default Value
0
Remarks
Specifies the length of the key used to encrypt the outgoing traffic.
This property is read-only.
Data Type
int32
PinnedClientPublicKeyAlgorithm Property (SFTPServer Component)
Specifies the public key algorithm which was used during the SSH handshake.
Syntax
func (obj *SFTPServer) PinnedClientPublicKeyAlgorithm() (string, error)
Default Value
""
Remarks
Specifies the public key algorithm which was used during the SSH handshake.
This property is read-only.
Data Type
string
PinnedClientRemoteAddress Property (SFTPServer Component)
The client's IP address.
Syntax
func (obj *SFTPServer) PinnedClientRemoteAddress() (string, error)
Default Value
""
Remarks
The client's IP address.
This property is read-only.
Data Type
string
PinnedClientRemotePort Property (SFTPServer Component)
The remote port of the client connection.
Syntax
func (obj *SFTPServer) PinnedClientRemotePort() (int32, error)
Default Value
0
Remarks
The remote port of the client connection.
This property is read-only.
Data Type
int32
PinnedClientRemoteSoftwareName Property (SFTPServer Component)
Returns the name (self-advertised) of the SSH software running on the other side.
Syntax
func (obj *SFTPServer) PinnedClientRemoteSoftwareName() (string, error)
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
PinnedClientServerKeyAlgorithm Property (SFTPServer Component)
Specifies the server's key algorithm.
Syntax
func (obj *SFTPServer) PinnedClientServerKeyAlgorithm() (string, error)
Default Value
""
Remarks
Specifies the server's key algorithm.
This property is read-only.
Data Type
string
PinnedClientServerKeyBits Property (SFTPServer Component)
Specifies the number of bits in the server's key.
Syntax
func (obj *SFTPServer) PinnedClientServerKeyBits() (int32, error)
Default Value
0
Remarks
Specifies the number of bits in the server's key.
This property is read-only.
Data Type
int32
PinnedClientServerKeyFingerprint Property (SFTPServer Component)
The fingerprint (hash value) of the server's public key.
Syntax
func (obj *SFTPServer) PinnedClientServerKeyFingerprint() (string, error)
Default Value
""
Remarks
The fingerprint (hash value) of the server's public key.
This property is read-only.
Data Type
string
PinnedClientTotalBytesReceived Property (SFTPServer Component)
Returns the total number of bytes received over this connection.
Syntax
func (obj *SFTPServer) PinnedClientTotalBytesReceived() (int64, error)
Default Value
0
Remarks
Returns the total number of bytes received over this connection.
This property is read-only.
Data Type
int64
PinnedClientTotalBytesSent Property (SFTPServer Component)
Returns the total number of bytes sent over this connection.
Syntax
func (obj *SFTPServer) PinnedClientTotalBytesSent() (int64, error)
Default Value
0
Remarks
Returns the total number of bytes sent over this connection.
This property is read-only.
Data Type
int64
PinnedClientVersion Property (SFTPServer Component)
Specifies SSH protocol version.
Syntax
func (obj *SFTPServer) PinnedClientVersion() (int32, error)
Default Value
2
Remarks
Specifies SSH protocol version.
This property is read-only.
Data Type
int32
Port Property (SFTPServer Component)
Specifies the listening port number.
Syntax
func (obj *SFTPServer) Port() (int32, error)
func (obj *SFTPServer) SetPort(value int32) error
Default Value
22
Remarks
Use this property to specify on which port the struct will be listening to client connections.
Data Type
int32
ReadOnly Property (SFTPServer Component)
Specifies whether files on the server are read-only.
Syntax
func (obj *SFTPServer) ReadOnly() (bool, error)
func (obj *SFTPServer) SetReadOnly(value bool) error
Default Value
false
Remarks
Set this property to true to deny all client requests to change files on the server.
Data Type
bool
ServerKeyCount Property (SFTPServer Component)
The number of records in the ServerKey arrays.
Syntax
func (obj *SFTPServer) ServerKeyCount() (int32, error)
func (obj *SFTPServer) SetServerKeyCount(value int32) error
Default Value
0
Remarks
This property controls the size of the following arrays:
The array indices start at 0 and end at ServerKeyCount - 1.Data Type
int32
ServerKeyAlgorithm Property (SFTPServer Component)
Specifies the key algorithm.
Syntax
func (obj *SFTPServer) ServerKeyAlgorithm(ServerKeyIndex int32) (string, error)
Default Value
""
Remarks
Specifies the key algorithm.
The following key algorithms are currently supported and can be returned by this property:
- RSA
- DSS
- ECDSA
- EDDSA
- MLDSA
- ECDSA-SK
- EDDSA-SK
The ServerKeyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ServerKeyCount property.
This property is read-only.
Data Type
string
ServerKeyBits Property (SFTPServer Component)
The number of bits in the key: the more the better, 2048 or 4096 are typical values.
Syntax
func (obj *SFTPServer) ServerKeyBits(ServerKeyIndex int32) (int32, error)
Default Value
0
Remarks
The number of bits in the key: the more the better, 2048 or 4096 are typical values.
The ServerKeyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ServerKeyCount property.
This property is read-only.
Data Type
int32
ServerKeyFingerprintMD5 Property (SFTPServer Component)
Contains the MD5 fingerprint (hash) of the key.
Syntax
func (obj *SFTPServer) ServerKeyFingerprintMD5(ServerKeyIndex int32) (string, error)
Default Value
""
Remarks
Contains the MD5 fingerprint (hash) of the key.
The ServerKeyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ServerKeyCount property.
This property is read-only.
Data Type
string
ServerKeyFingerprintSHA1 Property (SFTPServer Component)
Contains the SHA-1 fingerprint (hash) of the key.
Syntax
func (obj *SFTPServer) ServerKeyFingerprintSHA1(ServerKeyIndex int32) (string, error)
Default Value
""
Remarks
Contains the SHA-1 fingerprint (hash) of the key.
The ServerKeyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ServerKeyCount property.
This property is read-only.
Data Type
string
ServerKeyHandle Property (SFTPServer Component)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
func (obj *SFTPServer) ServerKeyHandle(ServerKeyIndex int32) (int64, error)
func (obj *SFTPServer) SetServerKeyHandle(ServerKeyIndex int32, value int64) error
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());
The ServerKeyIndex parameter specifies the index of the item in the array. The size of the array is controlled by the ServerKeyCount property.
Data Type
int64
SocketIncomingSpeedLimit Property (SFTPServer Component)
The maximum number of bytes to read from the socket, per second.
Syntax
func (obj *SFTPServer) SocketIncomingSpeedLimit() (int32, error)
func (obj *SFTPServer) SetSocketIncomingSpeedLimit(value int32) error
Default Value
0
Remarks
The maximum number of bytes to read from the socket, per second.
Data Type
int32
SocketLocalAddress Property (SFTPServer Component)
The local network interface to bind the socket to.
Syntax
func (obj *SFTPServer) SocketLocalAddress() (string, error)
func (obj *SFTPServer) SetSocketLocalAddress(value string) error
Default Value
""
Remarks
The local network interface to bind the socket to.
Data Type
string
SocketLocalPort Property (SFTPServer Component)
The local port number to bind the socket to.
Syntax
func (obj *SFTPServer) SocketLocalPort() (int32, error)
func (obj *SFTPServer) SetSocketLocalPort(value int32) error
Default Value
0
Remarks
The local port number to bind the socket to.
Data Type
int32
SocketOutgoingSpeedLimit Property (SFTPServer Component)
The maximum number of bytes to write to the socket, per second.
Syntax
func (obj *SFTPServer) SocketOutgoingSpeedLimit() (int32, error)
func (obj *SFTPServer) SetSocketOutgoingSpeedLimit(value int32) error
Default Value
0
Remarks
The maximum number of bytes to write to the socket, per second.
Data Type
int32
SocketTimeout Property (SFTPServer Component)
The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
Syntax
func (obj *SFTPServer) SocketTimeout() (int32, error)
func (obj *SFTPServer) SetSocketTimeout(value int32) error
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
int32
SocketUseIPv6 Property (SFTPServer Component)
Enables or disables IP protocol version 6.
Syntax
func (obj *SFTPServer) SocketUseIPv6() (bool, error)
func (obj *SFTPServer) SetSocketUseIPv6(value bool) error
Default Value
false
Remarks
Enables or disables IP protocol version 6.
Data Type
bool
SSHSettingsAutoAdjustCiphers Property (SFTPServer Component)
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
func (obj *SFTPServer) SSHSettingsAutoAdjustCiphers() (bool, error)
func (obj *SFTPServer) SetSSHSettingsAutoAdjustCiphers(value bool) error
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
SSHSettingsBaseConfiguration Property (SFTPServer Component)
Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
Syntax
func (obj *SFTPServer) SSHSettingsBaseConfiguration() (int32, error)
func (obj *SFTPServer) SetSSHSettingsBaseConfiguration(value int32) error
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
int32
SSHSettingsCompressionAlgorithms Property (SFTPServer Component)
A list of session compression algorithms separated with commas or semicolons.
Syntax
func (obj *SFTPServer) SSHSettingsCompressionAlgorithms() (string, error)
func (obj *SFTPServer) SetSSHSettingsCompressionAlgorithms(value string) error
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
SSHSettingsCompressionLevel Property (SFTPServer Component)
Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).
Syntax
func (obj *SFTPServer) SSHSettingsCompressionLevel() (int32, error)
func (obj *SFTPServer) SetSSHSettingsCompressionLevel(value int32) error
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
int32
SSHSettingsDefaultWindowSize Property (SFTPServer Component)
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
func (obj *SFTPServer) SSHSettingsDefaultWindowSize() (int32, error)
func (obj *SFTPServer) SetSSHSettingsDefaultWindowSize(value int32) error
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
int32
SSHSettingsEncryptionAlgorithms Property (SFTPServer Component)
A list of session encryption algorithms separated with commas or semicolons.
Syntax
func (obj *SFTPServer) SSHSettingsEncryptionAlgorithms() (string, error)
func (obj *SFTPServer) SetSSHSettingsEncryptionAlgorithms(value string) error
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
SSHSettingsForceCompression Property (SFTPServer Component)
Whether the SSH client should explicitly request compression.
Syntax
func (obj *SFTPServer) SSHSettingsForceCompression() (bool, error)
func (obj *SFTPServer) SetSSHSettingsForceCompression(value bool) error
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
SSHSettingsForwardAuthAgent Property (SFTPServer Component)
Enables or disables auth agent forwarding.
Syntax
func (obj *SFTPServer) SSHSettingsForwardAuthAgent() (bool, error)
func (obj *SFTPServer) SetSSHSettingsForwardAuthAgent(value bool) error
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
SSHSettingsGSSAuthTypes Property (SFTPServer Component)
A comma-separated list of authentication types.
Syntax
func (obj *SFTPServer) SSHSettingsGSSAuthTypes() (string, error)
func (obj *SFTPServer) SetSSHSettingsGSSAuthTypes(value string) error
Default Value
""
Remarks
A comma-separated list of authentication types. Two types are currently supported: gssapi-with-mic and gssapi-keyex.
Data Type
string
SSHSettingsGSSDelegateCreds Property (SFTPServer Component)
Switches credential delegation on or off.
Syntax
func (obj *SFTPServer) SSHSettingsGSSDelegateCreds() (bool, error)
func (obj *SFTPServer) SetSSHSettingsGSSDelegateCreds(value bool) error
Default Value
false
Remarks
Switches credential delegation on or off.
Data Type
bool
SSHSettingsGSSHostname Property (SFTPServer Component)
The GSS host name, in form of a FQDN (e.
Syntax
func (obj *SFTPServer) SSHSettingsGSSHostname() (string, error)
func (obj *SFTPServer) SetSSHSettingsGSSHostname(value string) error
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
SSHSettingsGSSLib Property (SFTPServer Component)
A path to the GSS-API library (DLL or SO).
Syntax
func (obj *SFTPServer) SSHSettingsGSSLib() (string, error)
func (obj *SFTPServer) SetSSHSettingsGSSLib(value string) error
Default Value
""
Remarks
A path to the GSS-API library (DLL or SO).
Data Type
string
SSHSettingsGSSMechanisms Property (SFTPServer Component)
A comma-separated list of GSS mechanisms to use.
Syntax
func (obj *SFTPServer) SSHSettingsGSSMechanisms() (string, error)
func (obj *SFTPServer) SetSSHSettingsGSSMechanisms(value string) error
Default Value
""
Remarks
A comma-separated list of GSS mechanisms to use. Two values are currently supported: lib and SSPI.
Data Type
string
SSHSettingsGSSProtocols Property (SFTPServer Component)
A comma-separated list of SSPI protocols.
Syntax
func (obj *SFTPServer) SSHSettingsGSSProtocols() (string, error)
func (obj *SFTPServer) SetSSHSettingsGSSProtocols(value string) error
Default Value
""
Remarks
A comma-separated list of SSPI protocols. Two protocols are currently supported: kerberos and NTLM.
Data Type
string
SSHSettingsHandshakeTimeout Property (SFTPServer Component)
Specifies the maximal time for the SSH handshake to proceed, in seconds.
Syntax
func (obj *SFTPServer) SSHSettingsHandshakeTimeout() (int32, error)
func (obj *SFTPServer) SetSSHSettingsHandshakeTimeout(value int32) error
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
int32
SSHSettingsKexAlgorithms Property (SFTPServer Component)
A list of key exchange algorithms separated with commas or semicolons.
Syntax
func (obj *SFTPServer) SSHSettingsKexAlgorithms() (string, error)
func (obj *SFTPServer) SetSSHSettingsKexAlgorithms(value string) error
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
SSHSettingsMacAlgorithms Property (SFTPServer Component)
A list of MAC (for message authentication code ) algorithms separated with commas or semicolons.
Syntax
func (obj *SFTPServer) SSHSettingsMacAlgorithms() (string, error)
func (obj *SFTPServer) SetSSHSettingsMacAlgorithms(value string) error
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
SSHSettingsMaxSSHPacketSize Property (SFTPServer Component)
Specifies the maximum length of one SSH packet in bytes.
Syntax
func (obj *SFTPServer) SSHSettingsMaxSSHPacketSize() (int32, error)
func (obj *SFTPServer) SetSSHSettingsMaxSSHPacketSize(value int32) error
Default Value
262144
Remarks
Specifies the maximum length of one SSH packet in bytes.
Data Type
int32
SSHSettingsMinWindowSize Property (SFTPServer Component)
Specifies the minimal internal window size.
Syntax
func (obj *SFTPServer) SSHSettingsMinWindowSize() (int32, error)
func (obj *SFTPServer) SetSSHSettingsMinWindowSize(value int32) error
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
int32
SSHSettingsObfuscateHandshake Property (SFTPServer Component)
Enables or disables handshake obfuscation.
Syntax
func (obj *SFTPServer) SSHSettingsObfuscateHandshake() (bool, error)
func (obj *SFTPServer) SetSSHSettingsObfuscateHandshake(value bool) error
Default Value
false
Remarks
Enables or disables handshake obfuscation.
Data Type
bool
SSHSettingsObfuscationPassword Property (SFTPServer Component)
Specifies the password used to encrypt the handshake when ObfuscateHandshake is set.
Syntax
func (obj *SFTPServer) SSHSettingsObfuscationPassword() (string, error)
func (obj *SFTPServer) SetSSHSettingsObfuscationPassword(value string) error
Default Value
""
Remarks
Specifies the password used to encrypt the handshake when ObfuscateHandshake is set.
Data Type
string
SSHSettingsPublicKeyAlgorithms Property (SFTPServer Component)
A list of public key algorithms separated with commas or semicolons.
Syntax
func (obj *SFTPServer) SSHSettingsPublicKeyAlgorithms() (string, error)
func (obj *SFTPServer) SetSSHSettingsPublicKeyAlgorithms(value string) error
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
SSHSettingsRequestPasswordChange Property (SFTPServer Component)
Whether to request a password change when connecting.
Syntax
func (obj *SFTPServer) SSHSettingsRequestPasswordChange() (bool, error)
func (obj *SFTPServer) SetSSHSettingsRequestPasswordChange(value bool) error
Default Value
false
Remarks
Whether to request a password change when connecting.
Data Type
bool
SSHSettingsSoftwareName Property (SFTPServer Component)
The name to be used by the class to identify itself.
Syntax
func (obj *SFTPServer) SSHSettingsSoftwareName() (string, error)
func (obj *SFTPServer) SetSSHSettingsSoftwareName(value string) error
Default Value
"SecureBlackbox"
Remarks
The name to be used by the component to identify itself.
Data Type
string
SSHSettingsTrustAllKeys Property (SFTPServer Component)
Enables or disables explicit trust to all server keys.
Syntax
func (obj *SFTPServer) SSHSettingsTrustAllKeys() (bool, error)
func (obj *SFTPServer) SetSSHSettingsTrustAllKeys(value bool) error
Default Value
false
Remarks
Enables or disables explicit trust to all server keys. Use with care.
Data Type
bool
SSHSettingsUseAuthAgent Property (SFTPServer Component)
Enables or disables the use of external key agent, such as Putty key agent.
Syntax
func (obj *SFTPServer) SSHSettingsUseAuthAgent() (bool, error)
func (obj *SFTPServer) SetSSHSettingsUseAuthAgent(value bool) error
Default Value
false
Remarks
Enables or disables the use of external key agent, such as Putty key agent.
Data Type
bool
SSHSettingsVersions Property (SFTPServer Component)
Specifies enabled SSH protocol versions (1 or 2).
Syntax
func (obj *SFTPServer) SSHSettingsVersions() (int32, error)
func (obj *SFTPServer) SetSSHSettingsVersions(value int32) error
Default Value
1
Remarks
Specifies enabled SSH protocol versions (1 or 2).
Data Type
int32
UserCount Property (SFTPServer Component)
The number of records in the User arrays.
Syntax
func (obj *SFTPServer) UserCount() (int32, error)
func (obj *SFTPServer) SetUserCount(value int32) error
Default Value
0
Remarks
This property controls the size of the following arrays:
- UserAssociatedData
- UserBasePath
- UserCertificate
- UserData
- UserEmail
- UserHandle
- UserHashAlgorithm
- UserIncomingSpeedLimit
- Username
- UserOtpAlgorithm
- UserOTPLen
- UserOtpValue
- UserOutgoingSpeedLimit
- UserPassword
- UserSharedSecret
- UserSSHKey
Data Type
int32
UserAssociatedData Property (SFTPServer Component)
Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
Syntax
func (obj *SFTPServer) UserAssociatedData(UserIndex int32) ([]byte, error)
func (obj *SFTPServer) SetUserAssociatedData(UserIndex int32, value []byte) error
Remarks
Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
[]byte
UserBasePath Property (SFTPServer Component)
Base path for this user in the server's file system.
Syntax
func (obj *SFTPServer) UserBasePath(UserIndex int32) (string, error)
func (obj *SFTPServer) SetUserBasePath(UserIndex int32, value string) error
Default Value
""
Remarks
Base path for this user in the server's file system.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
string
UserCertificate Property (SFTPServer Component)
Contains the user's certificate.
Syntax
func (obj *SFTPServer) UserCertificate(UserIndex int32) ([]byte, error)
func (obj *SFTPServer) SetUserCertificate(UserIndex int32, value []byte) error
Remarks
Contains the user's certificate.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
[]byte
UserData Property (SFTPServer Component)
Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
Syntax
func (obj *SFTPServer) UserData(UserIndex int32) (string, error)
func (obj *SFTPServer) SetUserData(UserIndex int32, value string) error
Default Value
""
Remarks
Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
string
UserEmail Property (SFTPServer Component)
The user's email address.
Syntax
func (obj *SFTPServer) UserEmail(UserIndex int32) (string, error)
func (obj *SFTPServer) SetUserEmail(UserIndex int32, value string) error
Default Value
""
Remarks
The user's email address.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
string
UserHandle Property (SFTPServer Component)
Allows to get or set a 'handle', a unique identifier of the underlying property object.
Syntax
func (obj *SFTPServer) UserHandle(UserIndex int32) (int64, error)
func (obj *SFTPServer) SetUserHandle(UserIndex int32, value int64) error
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());
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
int64
UserHashAlgorithm Property (SFTPServer Component)
Specifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user.
Syntax
func (obj *SFTPServer) UserHashAlgorithm(UserIndex int32) (string, error)
func (obj *SFTPServer) SetUserHashAlgorithm(UserIndex int32, value string) error
Default Value
""
Remarks
Specifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user. Three HMAC algorithms are supported, with SHA-1, SHA-256, and SHA-512 digests:
| SB_MAC_ALGORITHM_HMAC_SHA1 | SHA1 | |
| SB_MAC_ALGORITHM_HMAC_SHA256 | SHA256 | |
| SB_MAC_ALGORITHM_HMAC_SHA512 | SHA512 |
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
string
UserIncomingSpeedLimit Property (SFTPServer Component)
Specifies the incoming speed limit for this user.
Syntax
func (obj *SFTPServer) UserIncomingSpeedLimit(UserIndex int32) (int32, error)
func (obj *SFTPServer) SetUserIncomingSpeedLimit(UserIndex int32, value int32) error
Default Value
0
Remarks
Specifies the incoming speed limit for this user. The value of 0 (zero) means "no limitation".
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
int32
UserOtpAlgorithm Property (SFTPServer Component)
The algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP).
Syntax
func (obj *SFTPServer) UserOtpAlgorithm(UserIndex int32) (int32, error)
func (obj *SFTPServer) SetUserOtpAlgorithm(UserIndex int32, value int32) error
Possible Values
0 // None
1 // Hmac
2 // Time
Default Value
0
Remarks
The algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP). In the former case, a value of a dedicated counter is used to generate a unique password, while in the latter the password is generated on the basis of the current time value.
| oaHmac | 0 | |
| oaTime | 1 |
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
int32
UserOTPLen Property (SFTPServer Component)
Specifies the length of the user's OTP password.
Syntax
func (obj *SFTPServer) UserOTPLen(UserIndex int32) (int32, error)
func (obj *SFTPServer) SetUserOTPLen(UserIndex int32, value int32) error
Default Value
0
Remarks
Specifies the length of the user's OTP password.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
int32
UserOtpValue Property (SFTPServer Component)
The user's time interval (TOTP) or Counter (HOTP).
Syntax
func (obj *SFTPServer) UserOtpValue(UserIndex int32) (int32, error)
func (obj *SFTPServer) SetUserOtpValue(UserIndex int32, value int32) error
Default Value
0
Remarks
The user's time interval (TOTP) or Counter (HOTP).
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
int32
UserOutgoingSpeedLimit Property (SFTPServer Component)
Specifies the outgoing speed limit for this user.
Syntax
func (obj *SFTPServer) UserOutgoingSpeedLimit(UserIndex int32) (int32, error)
func (obj *SFTPServer) SetUserOutgoingSpeedLimit(UserIndex int32, value int32) error
Default Value
0
Remarks
Specifies the outgoing speed limit for this user. The value of 0 (zero) means "no limitation".
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
int32
UserPassword Property (SFTPServer Component)
The user's authentication password.
Syntax
func (obj *SFTPServer) UserPassword(UserIndex int32) (string, error)
func (obj *SFTPServer) SetUserPassword(UserIndex int32, value string) error
Default Value
""
Remarks
The user's authentication password.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
string
UserSharedSecret Property (SFTPServer Component)
Contains the user's secret key, which is essentially a shared secret between the client and server.
Syntax
func (obj *SFTPServer) UserSharedSecret(UserIndex int32) ([]byte, error)
func (obj *SFTPServer) SetUserSharedSecret(UserIndex int32, value []byte) error
Remarks
Contains the user's secret key, which is essentially a shared secret between the client and server.
Shared secrets can be used in TLS-driven protocols, as well as in OTP (where it is called a 'key secret') for generating one-time passwords on one side, and validate them on the other.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
[]byte
UserSSHKey Property (SFTPServer Component)
Contains the user's SSH key.
Syntax
func (obj *SFTPServer) UserSSHKey(UserIndex int32) ([]byte, error)
func (obj *SFTPServer) SetUserSSHKey(UserIndex int32, value []byte) error
Remarks
Contains the user's SSH key.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
[]byte
Username Property (SFTPServer Component)
The registered name (login) of the user.
Syntax
func (obj *SFTPServer) Username(UserIndex int32) (string, error)
func (obj *SFTPServer) SetUsername(UserIndex int32, value string) error
Default Value
""
Remarks
The registered name (login) of the user.
The UserIndex parameter specifies the index of the item in the array. The size of the array is controlled by the UserCount property.
Data Type
string
UseUTF8 Property (SFTPServer Component)
Specifies whether UTF8 conversion is to be used when parsing file names.
Syntax
func (obj *SFTPServer) UseUTF8() (bool, error)
func (obj *SFTPServer) SetUseUTF8(value bool) error
Default Value
false
Remarks
This property specifies whether UTF8 conversion of filenames is used by the server. It is set automatically according to protocol flow, but user could also set it to the desired value.
Data Type
bool
Cleanup Method (SFTPServer Component)
Cleans up the server environment by purging expired sessions and cleaning caches.
Syntax
func (obj *SFTPServer) Cleanup() error
Remarks
Call this method while the server is active to clean up the environment allocated for the server by releasing unused resources and cleaning caches.
Config Method (SFTPServer Component)
Sets or retrieves a configuration setting.
Syntax
func (obj *SFTPServer) Config(ConfigurationString string) (string, error)
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.
DoAction Method (SFTPServer Component)
Performs an additional action.
Syntax
func (obj *SFTPServer) DoAction(ActionID string, ActionParams string) (string, error)
Remarks
DoAction is a generic method available in every struct. It is used to perform an additional action introduced after the product major release. The list of actions is not fixed, and may be flexibly extended over time.
The unique identifier (case insensitive) of the action is provided in the ActionID parameter.
ActionParams contains the value of a single parameter, or a list of multiple parameters for the action in the form of PARAM1=VALUE1;PARAM2=VALUE2;....
Common ActionIDs:
| Action | Parameters | Returned value | Description |
| ResetTrustedListCache | none | none | Clears the cached list of trusted lists. |
| ResetCertificateCache | none | none | Clears the cached certificates. |
| ResetCRLCache | none | none | Clears the cached CRLs. |
| ResetOCSPResponseCache | none | none | Clears the cached OCSP responses. |
DropClient Method (SFTPServer Component)
Terminates a client connection.
Syntax
func (obj *SFTPServer) DropClient(ConnectionId int64, Forced bool) error
Remarks
Call this method to shut down a connected client. Forced indicates whether the connection should be closed in a graceful manner.
GetClientBuffer Method (SFTPServer Component)
Acquires a piece of operation data.
Syntax
func (obj *SFTPServer) GetClientBuffer(ConnectionID int64, Handle string) ([]byte, error)
Remarks
Use this method to obtain a piece of data relevant to a transfer operation in a thread-safe way.
A typical place to call this method is inside the WriteFile event handler, when implementing customized file transfers.
GetClientFileEntry Method (SFTPServer Component)
Acquires file entry details from the class.
Syntax
func (obj *SFTPServer) GetClientFileEntry(ConnectionID int64, Handle string) error
Remarks
Use this method to acquire the details of a file entry from the server in atomic and thread-safe way. After this method completes, the entry details will be propagated in ClientFileEntry property.
When calling this method, pass the client connection ID in ConnectionID property, and the opened file handle (if needed) in Handle property.
ListClients Method (SFTPServer Component)
Enumerates the connected clients.
Syntax
func (obj *SFTPServer) ListClients() (string, error)
Remarks
This method enumerates the connected clients. It returns a list of strings, with each string being of 'ConnectionID|Address|Port' format, and representing a single connection.
PinClient Method (SFTPServer Component)
Takes a snapshot of the connection's properties.
Syntax
func (obj *SFTPServer) PinClient(ConnectionId int64) error
Remarks
Use this method to take a snapshot of a connected client. The captured properties are populated in PinnedClient property.
Reset Method (SFTPServer Component)
Resets the class settings.
Syntax
func (obj *SFTPServer) Reset() error
Remarks
Reset is a generic method available in every struct.
SetClientBuffer Method (SFTPServer Component)
Commits a data buffer to the server class.
Syntax
func (obj *SFTPServer) SetClientBuffer(ConnectionID int64, Handle string, Value []byte) error
Remarks
Use this method to commit a data buffer passed via the Value parameter to the server control in a thread-safe way.
One example where you might need to pass your buffer to the server is when customizing upload operations via ReadFile event.
SetClientFileEntry Method (SFTPServer Component)
Commits the file entry details to the class.
Syntax
func (obj *SFTPServer) SetClientFileEntry(ConnectionID int64, Handle string) error
Remarks
Use this method to commit the file entry details configured in ClientFileEntry property to the server object in a thread-safe way. Pass the client's connection ID via ConnectionID property, and the file entry's handle via Handle.
Start Method (SFTPServer Component)
Starts SFTP server operation.
Syntax
func (obj *SFTPServer) Start() error
Remarks
Call this method to start listening to incoming connections.
Stop Method (SFTPServer Component)
Stops SFTP server.
Syntax
func (obj *SFTPServer) Stop() error
Remarks
Call this method to close all connections and stop listening to clients.
Accept Event (SFTPServer Component)
This event is fired when new incoming connection is accepted.
Syntax
// SFTPServerAcceptEventArgs carries the SFTPServer Accept event's parameters.
type SFTPServerAcceptEventArgs struct {...}
func (args *SFTPServerAcceptEventArgs) RemoteAddress() string
func (args *SFTPServerAcceptEventArgs) RemotePort() int32
func (args *SFTPServerAcceptEventArgs) Accept() bool
func (args *SFTPServerAcceptEventArgs) SetAccept(value bool)
// SFTPServerAcceptEvent defines the signature of the SFTPServer Accept event's handler function.
type SFTPServerAcceptEvent func(sender *SFTPServer, args *SFTPServerAcceptEventArgs)
func (obj *SFTPServer) GetOnAcceptHandler() SFTPServerAcceptEvent
func (obj *SFTPServer) SetOnAcceptHandler(handlerFunc SFTPServerAcceptEvent)
Remarks
This event is fired by the struct before a new incoming connection is accepted. RemoteAddress contains the IP address of the connecting client. Use the Accept parameter to either accept, or reject the connection.
AfterCreateDirectory Event (SFTPServer Component)
This event indicates completion of directory creation request.
Syntax
// SFTPServerAfterCreateDirectoryEventArgs carries the SFTPServer AfterCreateDirectory event's parameters.
type SFTPServerAfterCreateDirectoryEventArgs struct {...}
func (args *SFTPServerAfterCreateDirectoryEventArgs) ConnectionID() int64
func (args *SFTPServerAfterCreateDirectoryEventArgs) Path() string
func (args *SFTPServerAfterCreateDirectoryEventArgs) OperationStatus() int32
func (args *SFTPServerAfterCreateDirectoryEventArgs) SetOperationStatus(value int32)
// SFTPServerAfterCreateDirectoryEvent defines the signature of the SFTPServer AfterCreateDirectory event's handler function.
type SFTPServerAfterCreateDirectoryEvent func(sender *SFTPServer, args *SFTPServerAfterCreateDirectoryEventArgs)
func (obj *SFTPServer) GetOnAfterCreateDirectoryHandler() SFTPServerAfterCreateDirectoryEvent
func (obj *SFTPServer) SetOnAfterCreateDirectoryHandler(handlerFunc SFTPServerAfterCreateDirectoryEvent)
Remarks
This event is fired to report completion of a directory creation request. The ConnectionID parameter specifies in which session the request was received, the Path specifies the directory path, and the OperationStatus contains the operation result.
If needed, you can amend the OperationStatus to return a different operation result:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
AfterRemove Event (SFTPServer Component)
This event indicates completion of file removal request.
Syntax
// SFTPServerAfterRemoveEventArgs carries the SFTPServer AfterRemove event's parameters.
type SFTPServerAfterRemoveEventArgs struct {...}
func (args *SFTPServerAfterRemoveEventArgs) ConnectionID() int64
func (args *SFTPServerAfterRemoveEventArgs) Path() string
func (args *SFTPServerAfterRemoveEventArgs) OperationStatus() int32
func (args *SFTPServerAfterRemoveEventArgs) SetOperationStatus(value int32)
// SFTPServerAfterRemoveEvent defines the signature of the SFTPServer AfterRemove event's handler function.
type SFTPServerAfterRemoveEvent func(sender *SFTPServer, args *SFTPServerAfterRemoveEventArgs)
func (obj *SFTPServer) GetOnAfterRemoveHandler() SFTPServerAfterRemoveEvent
func (obj *SFTPServer) SetOnAfterRemoveHandler(handlerFunc SFTPServerAfterRemoveEvent)
Remarks
This event is fired when a request to delete a file or directory has been processed by the server. The ConnectionID parameter specifies the session in which the request was received. OperationStatus contains the operation result.
If needed, you can amend the OperationStatus to return a different operation result:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
AfterRenameFile Event (SFTPServer Component)
This event indicates completion of a file rename operation.
Syntax
// SFTPServerAfterRenameFileEventArgs carries the SFTPServer AfterRenameFile event's parameters.
type SFTPServerAfterRenameFileEventArgs struct {...}
func (args *SFTPServerAfterRenameFileEventArgs) ConnectionID() int64
func (args *SFTPServerAfterRenameFileEventArgs) OldPath() string
func (args *SFTPServerAfterRenameFileEventArgs) NewPath() string
func (args *SFTPServerAfterRenameFileEventArgs) OperationStatus() int32
func (args *SFTPServerAfterRenameFileEventArgs) SetOperationStatus(value int32)
// SFTPServerAfterRenameFileEvent defines the signature of the SFTPServer AfterRenameFile event's handler function.
type SFTPServerAfterRenameFileEvent func(sender *SFTPServer, args *SFTPServerAfterRenameFileEventArgs)
func (obj *SFTPServer) GetOnAfterRenameFileHandler() SFTPServerAfterRenameFileEvent
func (obj *SFTPServer) SetOnAfterRenameFileHandler(handlerFunc SFTPServerAfterRenameFileEvent)
Remarks
This event is fired when a request to rename a file (from OldPath to NewPath) has been processed. The ConnectionID parameter specifies in which session the request was received, and OperationStatus contains the operation result.
If needed, you can amend the OperationStatus to return a different operation result:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
AfterRequestAttributes Event (SFTPServer Component)
This event indicates completion of file attributes request.
Syntax
// SFTPServerAfterRequestAttributesEventArgs carries the SFTPServer AfterRequestAttributes event's parameters.
type SFTPServerAfterRequestAttributesEventArgs struct {...}
func (args *SFTPServerAfterRequestAttributesEventArgs) ConnectionID() int64
func (args *SFTPServerAfterRequestAttributesEventArgs) Path() string
func (args *SFTPServerAfterRequestAttributesEventArgs) OperationStatus() int32
func (args *SFTPServerAfterRequestAttributesEventArgs) SetOperationStatus(value int32)
// SFTPServerAfterRequestAttributesEvent defines the signature of the SFTPServer AfterRequestAttributes event's handler function.
type SFTPServerAfterRequestAttributesEvent func(sender *SFTPServer, args *SFTPServerAfterRequestAttributesEventArgs)
func (obj *SFTPServer) GetOnAfterRequestAttributesHandler() SFTPServerAfterRequestAttributesEvent
func (obj *SFTPServer) SetOnAfterRequestAttributesHandler(handlerFunc SFTPServerAfterRequestAttributesEvent)
Remarks
This event is fired when a request for get file attributes has been processed by the server. The ConnectionID parameter specifies in which session the request was received. OperationStatus contains the result of the operation.
If needed, you can amend the OperationStatus to return a different operation result:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
AfterSetAttributes Event (SFTPServer Component)
This event indicates completion of a set attributes request.
Syntax
// SFTPServerAfterSetAttributesEventArgs carries the SFTPServer AfterSetAttributes event's parameters.
type SFTPServerAfterSetAttributesEventArgs struct {...}
func (args *SFTPServerAfterSetAttributesEventArgs) ConnectionID() int64
func (args *SFTPServerAfterSetAttributesEventArgs) Path() string
func (args *SFTPServerAfterSetAttributesEventArgs) OperationStatus() int32
func (args *SFTPServerAfterSetAttributesEventArgs) SetOperationStatus(value int32)
// SFTPServerAfterSetAttributesEvent defines the signature of the SFTPServer AfterSetAttributes event's handler function.
type SFTPServerAfterSetAttributesEvent func(sender *SFTPServer, args *SFTPServerAfterSetAttributesEventArgs)
func (obj *SFTPServer) GetOnAfterSetAttributesHandler() SFTPServerAfterSetAttributesEvent
func (obj *SFTPServer) SetOnAfterSetAttributesHandler(handlerFunc SFTPServerAfterSetAttributesEvent)
Remarks
This event is fired when a request for set file attributes has been processed. The ConnectionID parameter specifies in which session the request was received. The OperationStatus parameter contains the operation result.
If needed, you can amend the OperationStatus to return a different operation result:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
AuthAttempt Event (SFTPServer Component)
Reports a user authentication attempt.
Syntax
// SFTPServerAuthAttemptEventArgs carries the SFTPServer AuthAttempt event's parameters.
type SFTPServerAuthAttemptEventArgs struct {...}
func (args *SFTPServerAuthAttemptEventArgs) ConnectionID() int64
func (args *SFTPServerAuthAttemptEventArgs) Username() string
func (args *SFTPServerAuthAttemptEventArgs) AuthType() int32
func (args *SFTPServerAuthAttemptEventArgs) Accept() bool
func (args *SFTPServerAuthAttemptEventArgs) SetAccept(value bool)
// SFTPServerAuthAttemptEvent defines the signature of the SFTPServer AuthAttempt event's handler function.
type SFTPServerAuthAttemptEvent func(sender *SFTPServer, args *SFTPServerAuthAttemptEventArgs)
func (obj *SFTPServer) GetOnAuthAttemptHandler() SFTPServerAuthAttemptEvent
func (obj *SFTPServer) SetOnAuthAttemptHandler(handlerFunc SFTPServerAuthAttemptEvent)
Remarks
ConnectionID identifies the session, Username specifies client's username, and AuthType specifies the authentication type. Use the Accept parameter to accept or decline the attempt.
Supported authentication types:
| atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
| atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
| atPassword | 0x04 | Password-based authentication |
| atHostbased | 0x08 | Hostbased authentication |
| atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
| atGssWithMic | 0x20 | GSS authentication |
| atGssKeyex | 0x40 | GSS authentication with key exchange |
| atPublicKeyAgent | 0x80 | Public key agent authentication |
AuthFailed Event (SFTPServer Component)
Reports user authentication failure.
Syntax
// SFTPServerAuthFailedEventArgs carries the SFTPServer AuthFailed event's parameters.
type SFTPServerAuthFailedEventArgs struct {...}
func (args *SFTPServerAuthFailedEventArgs) ConnectionID() int64
func (args *SFTPServerAuthFailedEventArgs) Username() string
func (args *SFTPServerAuthFailedEventArgs) AuthType() int32
// SFTPServerAuthFailedEvent defines the signature of the SFTPServer AuthFailed event's handler function.
type SFTPServerAuthFailedEvent func(sender *SFTPServer, args *SFTPServerAuthFailedEventArgs)
func (obj *SFTPServer) GetOnAuthFailedHandler() SFTPServerAuthFailedEvent
func (obj *SFTPServer) SetOnAuthFailedHandler(handlerFunc SFTPServerAuthFailedEvent)
Remarks
ConnectionID identifies the session, Username specify client's username, and AuthType specifies what authentication type was used.
Supported authentication types:
| atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
| atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
| atPassword | 0x04 | Password-based authentication |
| atHostbased | 0x08 | Hostbased authentication |
| atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
| atGssWithMic | 0x20 | GSS authentication |
| atGssKeyex | 0x40 | GSS authentication with key exchange |
| atPublicKeyAgent | 0x80 | Public key agent authentication |
AuthPassword Event (SFTPServer Component)
This event is fired on password authentication attempt from a client.
Syntax
// SFTPServerAuthPasswordEventArgs carries the SFTPServer AuthPassword event's parameters.
type SFTPServerAuthPasswordEventArgs struct {...}
func (args *SFTPServerAuthPasswordEventArgs) ConnectionID() int64
func (args *SFTPServerAuthPasswordEventArgs) Username() string
func (args *SFTPServerAuthPasswordEventArgs) Password() string
func (args *SFTPServerAuthPasswordEventArgs) Accept() bool
func (args *SFTPServerAuthPasswordEventArgs) SetAccept(value bool)
func (args *SFTPServerAuthPasswordEventArgs) ForceChangePassword() bool
func (args *SFTPServerAuthPasswordEventArgs) SetForceChangePassword(value bool)
// SFTPServerAuthPasswordEvent defines the signature of the SFTPServer AuthPassword event's handler function.
type SFTPServerAuthPasswordEvent func(sender *SFTPServer, args *SFTPServerAuthPasswordEventArgs)
func (obj *SFTPServer) GetOnAuthPasswordHandler() SFTPServerAuthPasswordEvent
func (obj *SFTPServer) SetOnAuthPasswordHandler(handlerFunc SFTPServerAuthPasswordEvent)
Remarks
Parameters Username and Password contain user credentials. If they are correct, set Accept to true. You can request password change by setting ForceChangePassword to true.
AuthPublicKey Event (SFTPServer Component)
This event is fired on public key authentication attempt from a client.
Syntax
// SFTPServerAuthPublicKeyEventArgs carries the SFTPServer AuthPublicKey event's parameters.
type SFTPServerAuthPublicKeyEventArgs struct {...}
func (args *SFTPServerAuthPublicKeyEventArgs) ConnectionID() int64
func (args *SFTPServerAuthPublicKeyEventArgs) Username() string
func (args *SFTPServerAuthPublicKeyEventArgs) Accept() bool
func (args *SFTPServerAuthPublicKeyEventArgs) SetAccept(value bool)
// SFTPServerAuthPublicKeyEvent defines the signature of the SFTPServer AuthPublicKey event's handler function.
type SFTPServerAuthPublicKeyEvent func(sender *SFTPServer, args *SFTPServerAuthPublicKeyEventArgs)
func (obj *SFTPServer) GetOnAuthPublicKeyHandler() SFTPServerAuthPublicKeyEvent
func (obj *SFTPServer) SetOnAuthPublicKeyHandler(handlerFunc SFTPServerAuthPublicKeyEvent)
Remarks
Username specifies client's username, and Accept is used to accept or reject authentication.
The users public key can be accessed via the ClientKey property. This event is guarded with a critical section so the property always contains the correct key.
AuthSucceeded Event (SFTPServer Component)
Reports a successful user authentication.
Syntax
// SFTPServerAuthSucceededEventArgs carries the SFTPServer AuthSucceeded event's parameters.
type SFTPServerAuthSucceededEventArgs struct {...}
func (args *SFTPServerAuthSucceededEventArgs) ConnectionID() int64
func (args *SFTPServerAuthSucceededEventArgs) Username() string
func (args *SFTPServerAuthSucceededEventArgs) AuthType() int32
// SFTPServerAuthSucceededEvent defines the signature of the SFTPServer AuthSucceeded event's handler function.
type SFTPServerAuthSucceededEvent func(sender *SFTPServer, args *SFTPServerAuthSucceededEventArgs)
func (obj *SFTPServer) GetOnAuthSucceededHandler() SFTPServerAuthSucceededEvent
func (obj *SFTPServer) SetOnAuthSucceededHandler(handlerFunc SFTPServerAuthSucceededEvent)
Remarks
ConnectionID identifies the session, Username specify client's username, and AuthType specifies what authentication type was used.
Supported authentication types:
| atRhosts | 0x01 | RHOSTS file authentication. Rarely used today. |
| atPublicKey | 0x02 | Public key (sometimes called private key) authentication |
| atPassword | 0x04 | Password-based authentication |
| atHostbased | 0x08 | Hostbased authentication |
| atKeyboard | 0x10 | Keyboard-interactive authentication. This is often used in place of generic password authentication. |
| atGssWithMic | 0x20 | GSS authentication |
| atGssKeyex | 0x40 | GSS authentication with key exchange |
| atPublicKeyAgent | 0x80 | Public key agent authentication |
BeforeCreateDirectory Event (SFTPServer Component)
This event is fired when a client requests to create a directory.
Syntax
// SFTPServerBeforeCreateDirectoryEventArgs carries the SFTPServer BeforeCreateDirectory event's parameters.
type SFTPServerBeforeCreateDirectoryEventArgs struct {...}
func (args *SFTPServerBeforeCreateDirectoryEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeCreateDirectoryEventArgs) Path() string
func (args *SFTPServerBeforeCreateDirectoryEventArgs) Action() int32
func (args *SFTPServerBeforeCreateDirectoryEventArgs) SetAction(value int32)
// SFTPServerBeforeCreateDirectoryEvent defines the signature of the SFTPServer BeforeCreateDirectory event's handler function.
type SFTPServerBeforeCreateDirectoryEvent func(sender *SFTPServer, args *SFTPServerBeforeCreateDirectoryEventArgs)
func (obj *SFTPServer) GetOnBeforeCreateDirectoryHandler() SFTPServerBeforeCreateDirectoryEvent
func (obj *SFTPServer) SetOnBeforeCreateDirectoryHandler(handlerFunc SFTPServerBeforeCreateDirectoryEvent)
Remarks
This event is fired when a request to create a directory has been received. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeDownloadFile Event (SFTPServer Component)
This event is fired when a download file request is received.
Syntax
// SFTPServerBeforeDownloadFileEventArgs carries the SFTPServer BeforeDownloadFile event's parameters.
type SFTPServerBeforeDownloadFileEventArgs struct {...}
func (args *SFTPServerBeforeDownloadFileEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeDownloadFileEventArgs) Path() string
func (args *SFTPServerBeforeDownloadFileEventArgs) Action() int32
func (args *SFTPServerBeforeDownloadFileEventArgs) SetAction(value int32)
// SFTPServerBeforeDownloadFileEvent defines the signature of the SFTPServer BeforeDownloadFile event's handler function.
type SFTPServerBeforeDownloadFileEvent func(sender *SFTPServer, args *SFTPServerBeforeDownloadFileEventArgs)
func (obj *SFTPServer) GetOnBeforeDownloadFileHandler() SFTPServerBeforeDownloadFileEvent
func (obj *SFTPServer) SetOnBeforeDownloadFileHandler(handlerFunc SFTPServerBeforeDownloadFileEvent)
Remarks
This event is fired when a request to download file is received from the client. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeFind Event (SFTPServer Component)
This event is fired when a client requests to find files and folders in Path.
Syntax
// SFTPServerBeforeFindEventArgs carries the SFTPServer BeforeFind event's parameters.
type SFTPServerBeforeFindEventArgs struct {...}
func (args *SFTPServerBeforeFindEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeFindEventArgs) Path() string
func (args *SFTPServerBeforeFindEventArgs) Action() int32
func (args *SFTPServerBeforeFindEventArgs) SetAction(value int32)
// SFTPServerBeforeFindEvent defines the signature of the SFTPServer BeforeFind event's handler function.
type SFTPServerBeforeFindEvent func(sender *SFTPServer, args *SFTPServerBeforeFindEventArgs)
func (obj *SFTPServer) GetOnBeforeFindHandler() SFTPServerBeforeFindEvent
func (obj *SFTPServer) SetOnBeforeFindHandler(handlerFunc SFTPServerBeforeFindEvent)
Remarks
This event is fired when a request to find files and folders in Path has been received. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeOpenClientForwarding Event (SFTPServer Component)
This event is fired when a client requests to set up client-side (local) forwarding channel.
Syntax
// SFTPServerBeforeOpenClientForwardingEventArgs carries the SFTPServer BeforeOpenClientForwarding event's parameters.
type SFTPServerBeforeOpenClientForwardingEventArgs struct {...}
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) DestHost() string
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) SetDestHost(value string)
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) DestPort() int32
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) SetDestPort(value int32)
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) SrcHost() string
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) SrcPort() int32
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) Action() int32
func (args *SFTPServerBeforeOpenClientForwardingEventArgs) SetAction(value int32)
// SFTPServerBeforeOpenClientForwardingEvent defines the signature of the SFTPServer BeforeOpenClientForwarding event's handler function.
type SFTPServerBeforeOpenClientForwardingEvent func(sender *SFTPServer, args *SFTPServerBeforeOpenClientForwardingEventArgs)
func (obj *SFTPServer) GetOnBeforeOpenClientForwardingHandler() SFTPServerBeforeOpenClientForwardingEvent
func (obj *SFTPServer) SetOnBeforeOpenClientForwardingHandler(handlerFunc SFTPServerBeforeOpenClientForwardingEvent)
Remarks
This event is fired when a request to open a client forwarding has been received. The ConnectionID parameter specifies in which session the request was received.
If permitted, the server will open a connection to DestHost:DestPort and start forwarding any data received from the client to that endpoint. You can enable or disable client forwarding blanketly via the Capabilities property.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeOpenCommand Event (SFTPServer Component)
This event is fired when a client requests a command channel.
Syntax
// SFTPServerBeforeOpenCommandEventArgs carries the SFTPServer BeforeOpenCommand event's parameters.
type SFTPServerBeforeOpenCommandEventArgs struct {...}
func (args *SFTPServerBeforeOpenCommandEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeOpenCommandEventArgs) Command() string
func (args *SFTPServerBeforeOpenCommandEventArgs) SetCommand(value string)
func (args *SFTPServerBeforeOpenCommandEventArgs) Action() int32
func (args *SFTPServerBeforeOpenCommandEventArgs) SetAction(value int32)
// SFTPServerBeforeOpenCommandEvent defines the signature of the SFTPServer BeforeOpenCommand event's handler function.
type SFTPServerBeforeOpenCommandEvent func(sender *SFTPServer, args *SFTPServerBeforeOpenCommandEventArgs)
func (obj *SFTPServer) GetOnBeforeOpenCommandHandler() SFTPServerBeforeOpenCommandEvent
func (obj *SFTPServer) SetOnBeforeOpenCommandHandler(handlerFunc SFTPServerBeforeOpenCommandEvent)
Remarks
This event is fired when a request to open a command has been received. The ConnectionID parameter specifies in which session the request was received.
If permitted, the component will launch the command in a separate process. Note that allowing command access to all clients can be dangerous. You can enable or disable command support blanketly via the Capabilities property.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeOpenServerForwarding Event (SFTPServer Component)
This event is fired when the server has received an incoming connection and needs to set up server-side (remote) forwarding channel.
Syntax
// SFTPServerBeforeOpenServerForwardingEventArgs carries the SFTPServer BeforeOpenServerForwarding event's parameters.
type SFTPServerBeforeOpenServerForwardingEventArgs struct {...}
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) LocalHost() string
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) LocalPort() int32
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) SrcHost() string
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) SrcPort() int32
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) Action() int32
func (args *SFTPServerBeforeOpenServerForwardingEventArgs) SetAction(value int32)
// SFTPServerBeforeOpenServerForwardingEvent defines the signature of the SFTPServer BeforeOpenServerForwarding event's handler function.
type SFTPServerBeforeOpenServerForwardingEvent func(sender *SFTPServer, args *SFTPServerBeforeOpenServerForwardingEventArgs)
func (obj *SFTPServer) GetOnBeforeOpenServerForwardingHandler() SFTPServerBeforeOpenServerForwardingEvent
func (obj *SFTPServer) SetOnBeforeOpenServerForwardingHandler(handlerFunc SFTPServerBeforeOpenServerForwardingEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
If permitted, the server will accept the connection and ask the client to confirm forwarding to DestHost:DestPort. If that is successful, the server will fire the OpenServerForwarding event.
You can enable or disable client forwarding blanketly via the Capabilities property.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeOpenShell Event (SFTPServer Component)
This event is fired when a client requests a shell channel.
Syntax
// SFTPServerBeforeOpenShellEventArgs carries the SFTPServer BeforeOpenShell event's parameters.
type SFTPServerBeforeOpenShellEventArgs struct {...}
func (args *SFTPServerBeforeOpenShellEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeOpenShellEventArgs) Action() int32
func (args *SFTPServerBeforeOpenShellEventArgs) SetAction(value int32)
// SFTPServerBeforeOpenShellEvent defines the signature of the SFTPServer BeforeOpenShell event's handler function.
type SFTPServerBeforeOpenShellEvent func(sender *SFTPServer, args *SFTPServerBeforeOpenShellEventArgs)
func (obj *SFTPServer) GetOnBeforeOpenShellHandler() SFTPServerBeforeOpenShellEvent
func (obj *SFTPServer) SetOnBeforeOpenShellHandler(handlerFunc SFTPServerBeforeOpenShellEvent)
Remarks
This event is fired when a request to open a shell has been received. The ConnectionID parameter specifies in which session the request was received.
If permitted, the client will be able to send commands to the shell. Note that allowing shell access to all clients can be dangerous. You can enable or disable shell access blanketly via the Capabilities property.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeRemove Event (SFTPServer Component)
This event is fired when a client requests to delete a file or directory.
Syntax
// SFTPServerBeforeRemoveEventArgs carries the SFTPServer BeforeRemove event's parameters.
type SFTPServerBeforeRemoveEventArgs struct {...}
func (args *SFTPServerBeforeRemoveEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeRemoveEventArgs) Path() string
func (args *SFTPServerBeforeRemoveEventArgs) Action() int32
func (args *SFTPServerBeforeRemoveEventArgs) SetAction(value int32)
// SFTPServerBeforeRemoveEvent defines the signature of the SFTPServer BeforeRemove event's handler function.
type SFTPServerBeforeRemoveEvent func(sender *SFTPServer, args *SFTPServerBeforeRemoveEventArgs)
func (obj *SFTPServer) GetOnBeforeRemoveHandler() SFTPServerBeforeRemoveEvent
func (obj *SFTPServer) SetOnBeforeRemoveHandler(handlerFunc SFTPServerBeforeRemoveEvent)
Remarks
This event is fired when a request to delete a file or directory is received from the client. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeRenameFile Event (SFTPServer Component)
This event is fired when a client requests to rename a file.
Syntax
// SFTPServerBeforeRenameFileEventArgs carries the SFTPServer BeforeRenameFile event's parameters.
type SFTPServerBeforeRenameFileEventArgs struct {...}
func (args *SFTPServerBeforeRenameFileEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeRenameFileEventArgs) OldPath() string
func (args *SFTPServerBeforeRenameFileEventArgs) NewPath() string
func (args *SFTPServerBeforeRenameFileEventArgs) Action() int32
func (args *SFTPServerBeforeRenameFileEventArgs) SetAction(value int32)
// SFTPServerBeforeRenameFileEvent defines the signature of the SFTPServer BeforeRenameFile event's handler function.
type SFTPServerBeforeRenameFileEvent func(sender *SFTPServer, args *SFTPServerBeforeRenameFileEventArgs)
func (obj *SFTPServer) GetOnBeforeRenameFileHandler() SFTPServerBeforeRenameFileEvent
func (obj *SFTPServer) SetOnBeforeRenameFileHandler(handlerFunc SFTPServerBeforeRenameFileEvent)
Remarks
This event is fired when a request to rename a file (from OldPath to NewPath) is received from the client. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeRequestAttributes Event (SFTPServer Component)
This event is fired when a client requests to get file attributes.
Syntax
// SFTPServerBeforeRequestAttributesEventArgs carries the SFTPServer BeforeRequestAttributes event's parameters.
type SFTPServerBeforeRequestAttributesEventArgs struct {...}
func (args *SFTPServerBeforeRequestAttributesEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeRequestAttributesEventArgs) Path() string
func (args *SFTPServerBeforeRequestAttributesEventArgs) Action() int32
func (args *SFTPServerBeforeRequestAttributesEventArgs) SetAction(value int32)
// SFTPServerBeforeRequestAttributesEvent defines the signature of the SFTPServer BeforeRequestAttributes event's handler function.
type SFTPServerBeforeRequestAttributesEvent func(sender *SFTPServer, args *SFTPServerBeforeRequestAttributesEventArgs)
func (obj *SFTPServer) GetOnBeforeRequestAttributesHandler() SFTPServerBeforeRequestAttributesEvent
func (obj *SFTPServer) SetOnBeforeRequestAttributesHandler(handlerFunc SFTPServerBeforeRequestAttributesEvent)
Remarks
This event is fired when a request to get file attributes has been received. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeSetAttributes Event (SFTPServer Component)
This event is fired when a client requests to set file attributes.
Syntax
// SFTPServerBeforeSetAttributesEventArgs carries the SFTPServer BeforeSetAttributes event's parameters.
type SFTPServerBeforeSetAttributesEventArgs struct {...}
func (args *SFTPServerBeforeSetAttributesEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeSetAttributesEventArgs) Path() string
func (args *SFTPServerBeforeSetAttributesEventArgs) Action() int32
func (args *SFTPServerBeforeSetAttributesEventArgs) SetAction(value int32)
// SFTPServerBeforeSetAttributesEvent defines the signature of the SFTPServer BeforeSetAttributes event's handler function.
type SFTPServerBeforeSetAttributesEvent func(sender *SFTPServer, args *SFTPServerBeforeSetAttributesEventArgs)
func (obj *SFTPServer) GetOnBeforeSetAttributesHandler() SFTPServerBeforeSetAttributesEvent
func (obj *SFTPServer) SetOnBeforeSetAttributesHandler(handlerFunc SFTPServerBeforeSetAttributesEvent)
Remarks
This event is fired when a request to set file attributes has been received. The ConnectionID parameter specifies in which session the request was received.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
BeforeUploadFile Event (SFTPServer Component)
This event is fired when an upload file request is received.
Syntax
// SFTPServerBeforeUploadFileEventArgs carries the SFTPServer BeforeUploadFile event's parameters.
type SFTPServerBeforeUploadFileEventArgs struct {...}
func (args *SFTPServerBeforeUploadFileEventArgs) ConnectionID() int64
func (args *SFTPServerBeforeUploadFileEventArgs) Path() string
func (args *SFTPServerBeforeUploadFileEventArgs) Action() int32
func (args *SFTPServerBeforeUploadFileEventArgs) SetAction(value int32)
// SFTPServerBeforeUploadFileEvent defines the signature of the SFTPServer BeforeUploadFile event's handler function.
type SFTPServerBeforeUploadFileEvent func(sender *SFTPServer, args *SFTPServerBeforeUploadFileEventArgs)
func (obj *SFTPServer) GetOnBeforeUploadFileHandler() SFTPServerBeforeUploadFileEvent
func (obj *SFTPServer) SetOnBeforeUploadFileHandler(handlerFunc SFTPServerBeforeUploadFileEvent)
Remarks
This event is fired when an upload file request is received from the client. The ConnectionID parameter specifies in which session the request was received, and Path specifies the location on the server where the file needs to be saved.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
CloseClientForwarding Event (SFTPServer Component)
This event is fired when a client has closed a previously opened forwarding channel.
Syntax
// SFTPServerCloseClientForwardingEventArgs carries the SFTPServer CloseClientForwarding event's parameters.
type SFTPServerCloseClientForwardingEventArgs struct {...}
func (args *SFTPServerCloseClientForwardingEventArgs) ConnectionID() int64
func (args *SFTPServerCloseClientForwardingEventArgs) DestHost() string
func (args *SFTPServerCloseClientForwardingEventArgs) DestPort() int32
func (args *SFTPServerCloseClientForwardingEventArgs) SrcHost() string
func (args *SFTPServerCloseClientForwardingEventArgs) SrcPort() int32
// SFTPServerCloseClientForwardingEvent defines the signature of the SFTPServer CloseClientForwarding event's handler function.
type SFTPServerCloseClientForwardingEvent func(sender *SFTPServer, args *SFTPServerCloseClientForwardingEventArgs)
func (obj *SFTPServer) GetOnCloseClientForwardingHandler() SFTPServerCloseClientForwardingEvent
func (obj *SFTPServer) SetOnCloseClientForwardingHandler(handlerFunc SFTPServerCloseClientForwardingEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
CloseCommand Event (SFTPServer Component)
This event is fired when a client has closed a previously opened SSH command channel.
Syntax
// SFTPServerCloseCommandEventArgs carries the SFTPServer CloseCommand event's parameters.
type SFTPServerCloseCommandEventArgs struct {...}
func (args *SFTPServerCloseCommandEventArgs) ConnectionID() int64
func (args *SFTPServerCloseCommandEventArgs) Command() string
// SFTPServerCloseCommandEvent defines the signature of the SFTPServer CloseCommand event's handler function.
type SFTPServerCloseCommandEvent func(sender *SFTPServer, args *SFTPServerCloseCommandEventArgs)
func (obj *SFTPServer) GetOnCloseCommandHandler() SFTPServerCloseCommandEvent
func (obj *SFTPServer) SetOnCloseCommandHandler(handlerFunc SFTPServerCloseCommandEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
CloseFile Event (SFTPServer Component)
This event instructs the application to close an opened file.
Syntax
// SFTPServerCloseFileEventArgs carries the SFTPServer CloseFile event's parameters.
type SFTPServerCloseFileEventArgs struct {...}
func (args *SFTPServerCloseFileEventArgs) ConnectionID() int64
func (args *SFTPServerCloseFileEventArgs) Handle() string
func (args *SFTPServerCloseFileEventArgs) OperationStatus() int32
func (args *SFTPServerCloseFileEventArgs) SetOperationStatus(value int32)
// SFTPServerCloseFileEvent defines the signature of the SFTPServer CloseFile event's handler function.
type SFTPServerCloseFileEvent func(sender *SFTPServer, args *SFTPServerCloseFileEventArgs)
func (obj *SFTPServer) GetOnCloseFileHandler() SFTPServerCloseFileEvent
func (obj *SFTPServer) SetOnCloseFileHandler(handlerFunc SFTPServerCloseFileEvent)
Remarks
This event is fired upon receipt of a close-file packet from a client. Servers implementing virtualized transfers must close the previously opened local file referenced by Handle in this event handler. No further operations are allowed with the closed file.
Set OperationStatus to one of the following values to report the result of this operation to the client:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
CloseServerForwarding Event (SFTPServer Component)
This event is fired when a client has closed a previously opened forwarding channel.
Syntax
// SFTPServerCloseServerForwardingEventArgs carries the SFTPServer CloseServerForwarding event's parameters.
type SFTPServerCloseServerForwardingEventArgs struct {...}
func (args *SFTPServerCloseServerForwardingEventArgs) ConnectionID() int64
func (args *SFTPServerCloseServerForwardingEventArgs) LocalHost() string
func (args *SFTPServerCloseServerForwardingEventArgs) LocalPort() int32
func (args *SFTPServerCloseServerForwardingEventArgs) SrcHost() string
func (args *SFTPServerCloseServerForwardingEventArgs) SrcPort() int32
// SFTPServerCloseServerForwardingEvent defines the signature of the SFTPServer CloseServerForwarding event's handler function.
type SFTPServerCloseServerForwardingEvent func(sender *SFTPServer, args *SFTPServerCloseServerForwardingEventArgs)
func (obj *SFTPServer) GetOnCloseServerForwardingHandler() SFTPServerCloseServerForwardingEvent
func (obj *SFTPServer) SetOnCloseServerForwardingHandler(handlerFunc SFTPServerCloseServerForwardingEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
CloseShell Event (SFTPServer Component)
This event is fired when a client has closed a previously opened shell channel.
Syntax
// SFTPServerCloseShellEventArgs carries the SFTPServer CloseShell event's parameters.
type SFTPServerCloseShellEventArgs struct {...}
func (args *SFTPServerCloseShellEventArgs) ConnectionID() int64
// SFTPServerCloseShellEvent defines the signature of the SFTPServer CloseShell event's handler function.
type SFTPServerCloseShellEvent func(sender *SFTPServer, args *SFTPServerCloseShellEventArgs)
func (obj *SFTPServer) GetOnCloseShellHandler() SFTPServerCloseShellEvent
func (obj *SFTPServer) SetOnCloseShellHandler(handlerFunc SFTPServerCloseShellEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
Connect Event (SFTPServer Component)
This event is fired when a remote connection has been established.
Syntax
// SFTPServerConnectEventArgs carries the SFTPServer Connect event's parameters.
type SFTPServerConnectEventArgs struct {...}
func (args *SFTPServerConnectEventArgs) ConnectionID() int64
func (args *SFTPServerConnectEventArgs) RemoteAddress() string
func (args *SFTPServerConnectEventArgs) RemotePort() int32
// SFTPServerConnectEvent defines the signature of the SFTPServer Connect event's handler function.
type SFTPServerConnectEvent func(sender *SFTPServer, args *SFTPServerConnectEventArgs)
func (obj *SFTPServer) GetOnConnectHandler() SFTPServerConnectEvent
func (obj *SFTPServer) SetOnConnectHandler(handlerFunc SFTPServerConnectEvent)
Remarks
ConnectionID contains a session identifier, and RemoteAddress specifies the client's IP address.
CreateDirectory Event (SFTPServer Component)
This event instructs the application to create a directory.
Syntax
// SFTPServerCreateDirectoryEventArgs carries the SFTPServer CreateDirectory event's parameters.
type SFTPServerCreateDirectoryEventArgs struct {...}
func (args *SFTPServerCreateDirectoryEventArgs) ConnectionID() int64
func (args *SFTPServerCreateDirectoryEventArgs) Path() string
func (args *SFTPServerCreateDirectoryEventArgs) OperationStatus() int32
func (args *SFTPServerCreateDirectoryEventArgs) SetOperationStatus(value int32)
// SFTPServerCreateDirectoryEvent defines the signature of the SFTPServer CreateDirectory event's handler function.
type SFTPServerCreateDirectoryEvent func(sender *SFTPServer, args *SFTPServerCreateDirectoryEventArgs)
func (obj *SFTPServer) GetOnCreateDirectoryHandler() SFTPServerCreateDirectoryEvent
func (obj *SFTPServer) SetOnCreateDirectoryHandler(handlerFunc SFTPServerCreateDirectoryEvent)
Remarks
This event is fired when a request to create a directory has been received and needs to be served (virtualized) by the application. The ConnectionID parameter specifies the session that has communicated the request, and Path contains the name of the directory to be created.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
Disconnect Event (SFTPServer Component)
This event is fired when a client has disconnected.
Syntax
// SFTPServerDisconnectEventArgs carries the SFTPServer Disconnect event's parameters.
type SFTPServerDisconnectEventArgs struct {...}
func (args *SFTPServerDisconnectEventArgs) ConnectionID() int64
// SFTPServerDisconnectEvent defines the signature of the SFTPServer Disconnect event's handler function.
type SFTPServerDisconnectEvent func(sender *SFTPServer, args *SFTPServerDisconnectEventArgs)
func (obj *SFTPServer) GetOnDisconnectHandler() SFTPServerDisconnectEvent
func (obj *SFTPServer) SetOnDisconnectHandler(handlerFunc SFTPServerDisconnectEvent)
Remarks
This event reports loss of connection to the client within the session specified by ConnectionID.
Error Event (SFTPServer Component)
Information about errors during data delivery.
Syntax
// SFTPServerErrorEventArgs carries the SFTPServer Error event's parameters.
type SFTPServerErrorEventArgs struct {...}
func (args *SFTPServerErrorEventArgs) ConnectionID() int64
func (args *SFTPServerErrorEventArgs) ErrorCode() int32
func (args *SFTPServerErrorEventArgs) Fatal() bool
func (args *SFTPServerErrorEventArgs) Remote() bool
func (args *SFTPServerErrorEventArgs) Description() string
// SFTPServerErrorEvent defines the signature of the SFTPServer Error event's handler function.
type SFTPServerErrorEvent func(sender *SFTPServer, args *SFTPServerErrorEventArgs)
func (obj *SFTPServer) GetOnErrorHandler() SFTPServerErrorEvent
func (obj *SFTPServer) SetOnErrorHandler(handlerFunc SFTPServerErrorEvent)
Remarks
The event is fired in case of exceptional conditions during message processing.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the SFTP section.
ExternalSign Event (SFTPServer Component)
Handles remote or external signing initiated by the server protocol.
Syntax
// SFTPServerExternalSignEventArgs carries the SFTPServer ExternalSign event's parameters.
type SFTPServerExternalSignEventArgs struct {...}
func (args *SFTPServerExternalSignEventArgs) ConnectionID() int64
func (args *SFTPServerExternalSignEventArgs) OperationId() string
func (args *SFTPServerExternalSignEventArgs) HashAlgorithm() string
func (args *SFTPServerExternalSignEventArgs) Pars() string
func (args *SFTPServerExternalSignEventArgs) Data() string
func (args *SFTPServerExternalSignEventArgs) SignedData() string
func (args *SFTPServerExternalSignEventArgs) SetSignedData(value string)
// SFTPServerExternalSignEvent defines the signature of the SFTPServer ExternalSign event's handler function.
type SFTPServerExternalSignEvent func(sender *SFTPServer, args *SFTPServerExternalSignEventArgs)
func (obj *SFTPServer) GetOnExternalSignHandler() SFTPServerExternalSignEvent
func (obj *SFTPServer) SetOnExternalSignHandler(handlerFunc SFTPServerExternalSignEvent)
Remarks
Assign a handler to this event if you need to delegate a low-level signing operation to an external, remote, or custom signing engine. Depending on the settings, the handler will receive a hashed or unhashed value to be signed.
The event handler must pass the value of Data to the signer, obtain the signature, and pass it back to the struct via the SignedData parameter.
OperationId provides a comment about the operation and its origin. It depends on the exact struct being used, and may be empty. HashAlgorithm specifies the hash algorithm being used for the operation, and Pars contains algorithm-dependent parameters.
The struct uses base16 (hex) encoding for the Data, SignedData, and Pars parameters. If your signing engine uses a different input and output encoding, you may need to decode and/or encode the data before and/or after the signing.
A sample MD5 hash encoded in base16: a0dee2a0382afbb09120ffa7ccd8a152 - lower case base16 A0DEE2A0382AFBB09120FFA7CCD8A152 - upper case base16
A sample event handler that uses the .NET RSACryptoServiceProvider class may look like the following:
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();
};
FindClose Event (SFTPServer Component)
This event signifies the completion of a custom file listing operation.
Syntax
// SFTPServerFindCloseEventArgs carries the SFTPServer FindClose event's parameters.
type SFTPServerFindCloseEventArgs struct {...}
func (args *SFTPServerFindCloseEventArgs) ConnectionID() int64
func (args *SFTPServerFindCloseEventArgs) Handle() string
func (args *SFTPServerFindCloseEventArgs) OperationStatus() int32
func (args *SFTPServerFindCloseEventArgs) SetOperationStatus(value int32)
// SFTPServerFindCloseEvent defines the signature of the SFTPServer FindClose event's handler function.
type SFTPServerFindCloseEvent func(sender *SFTPServer, args *SFTPServerFindCloseEventArgs)
func (obj *SFTPServer) GetOnFindCloseHandler() SFTPServerFindCloseEvent
func (obj *SFTPServer) SetOnFindCloseHandler(handlerFunc SFTPServerFindCloseEvent)
Remarks
FindClose notifies your code about the completion of a custom file listing request. Use it in conjunction with FindFirst and FindNext to handle file listing requests manually.
See FindFirst topic for the details on implementing customized file listing request processing.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
FindFirst Event (SFTPServer Component)
This event signifies the start of the custom file listing retrieval mechanism.
Syntax
// SFTPServerFindFirstEventArgs carries the SFTPServer FindFirst event's parameters.
type SFTPServerFindFirstEventArgs struct {...}
func (args *SFTPServerFindFirstEventArgs) ConnectionID() int64
func (args *SFTPServerFindFirstEventArgs) Path() string
func (args *SFTPServerFindFirstEventArgs) OperationStatus() int32
func (args *SFTPServerFindFirstEventArgs) SetOperationStatus(value int32)
func (args *SFTPServerFindFirstEventArgs) Handle() string
func (args *SFTPServerFindFirstEventArgs) SetHandle(value string)
// SFTPServerFindFirstEvent defines the signature of the SFTPServer FindFirst event's handler function.
type SFTPServerFindFirstEvent func(sender *SFTPServer, args *SFTPServerFindFirstEventArgs)
func (obj *SFTPServer) GetOnFindFirstHandler() SFTPServerFindFirstEvent
func (obj *SFTPServer) SetOnFindFirstHandler(handlerFunc SFTPServerFindFirstEvent)
Remarks
FindFirst, FindNext, and FindClose events represent a mechanism for providing customized file listings to struct. They are only fired if Action parameter of the preceding BeforeFind event was set to fraCustom.
The behaviour of these events mimics that of the standard FindFirst/FindNext/FindClose functions found in many operating systems/frameworks. FindFirst fires once to request the first list entry; FindNext then fires continuously in a loop to request all subsequent entries. To indicate that the listing is over, set OperationStatus parameter to ostEOF. Not doing so may lead to an endless loop and session freeze, as the component would continue firing FindNext infinitely waiting for the EOF marker.
The handlers for both FindFirst and FindNext events should be implemented in the following way: if there are more entries in the directory to pass back to the server component,
- set OperationStatus to ostOK,
- fill in ClientFileEntry with the details of the next entry,
- commit the entry to the server using SetClientFileEntry method.
Use the by-ref Handle parameter to assign a handle (a unique identifier) to the file listing procedure inside the FindFirst event handler. This identifier will then be passed to all subsequent FindNext and FindClose calls to let your code chain the events together.
The ConnectionID parameter specifies in which SFTP session the request was received, and Path indicates the requested directory.
The following operation status constants are available, besides the ones referenced above:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
FindNext Event (SFTPServer Component)
This event retrieves the next entry of a custom file listing.
Syntax
// SFTPServerFindNextEventArgs carries the SFTPServer FindNext event's parameters.
type SFTPServerFindNextEventArgs struct {...}
func (args *SFTPServerFindNextEventArgs) ConnectionID() int64
func (args *SFTPServerFindNextEventArgs) Handle() string
func (args *SFTPServerFindNextEventArgs) OperationStatus() int32
func (args *SFTPServerFindNextEventArgs) SetOperationStatus(value int32)
// SFTPServerFindNextEvent defines the signature of the SFTPServer FindNext event's handler function.
type SFTPServerFindNextEvent func(sender *SFTPServer, args *SFTPServerFindNextEventArgs)
func (obj *SFTPServer) GetOnFindNextHandler() SFTPServerFindNextEvent
func (obj *SFTPServer) SetOnFindNextHandler(handlerFunc SFTPServerFindNextEvent)
Remarks
This event is fired repeatedly after FindFirst to retrieve the directory contents entry-by-entry. Please see the FindFirst topic for more details about implementing a handler of this event.
Remember to set OperationStatus to ostEOF when there are no more entries left to close the listing operation. If there are more entries to pass, set it to ostOK. Other possible values are given in the table below:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
ListeningStarted Event (SFTPServer Component)
Fires when the server has started accepting connections on a local port.
Syntax
// SFTPServerListeningStartedEventArgs carries the SFTPServer ListeningStarted event's parameters.
type SFTPServerListeningStartedEventArgs struct {...}
func (args *SFTPServerListeningStartedEventArgs) Host() string
func (args *SFTPServerListeningStartedEventArgs) Port() int32
// SFTPServerListeningStartedEvent defines the signature of the SFTPServer ListeningStarted event's handler function.
type SFTPServerListeningStartedEvent func(sender *SFTPServer, args *SFTPServerListeningStartedEventArgs)
func (obj *SFTPServer) GetOnListeningStartedHandler() SFTPServerListeningStartedEvent
func (obj *SFTPServer) SetOnListeningStartedHandler(handlerFunc SFTPServerListeningStartedEvent)
Remarks
This event is fired when the server is ready to accept incoming SSH/SFTP connections.
ListeningStopped Event (SFTPServer Component)
Fires when the server has stopped accepting connections on a local port.
Syntax
// SFTPServerListeningStoppedEventArgs carries the SFTPServer ListeningStopped event's parameters.
type SFTPServerListeningStoppedEventArgs struct {...}
func (args *SFTPServerListeningStoppedEventArgs) Host() string
func (args *SFTPServerListeningStoppedEventArgs) Port() int32
// SFTPServerListeningStoppedEvent defines the signature of the SFTPServer ListeningStopped event's handler function.
type SFTPServerListeningStoppedEvent func(sender *SFTPServer, args *SFTPServerListeningStoppedEventArgs)
func (obj *SFTPServer) GetOnListeningStoppedHandler() SFTPServerListeningStoppedEvent
func (obj *SFTPServer) SetOnListeningStoppedHandler(handlerFunc SFTPServerListeningStoppedEvent)
Remarks
This event is fired when the server has closed the listening socket and can no longer accept incoming SSH/SFTP connections.
Notification Event (SFTPServer Component)
This event notifies the application about an underlying control flow event.
Syntax
// SFTPServerNotificationEventArgs carries the SFTPServer Notification event's parameters.
type SFTPServerNotificationEventArgs struct {...}
func (args *SFTPServerNotificationEventArgs) EventID() string
func (args *SFTPServerNotificationEventArgs) EventParam() string
// SFTPServerNotificationEvent defines the signature of the SFTPServer Notification event's handler function.
type SFTPServerNotificationEvent func(sender *SFTPServer, args *SFTPServerNotificationEventArgs)
func (obj *SFTPServer) GetOnNotificationHandler() SFTPServerNotificationEvent
func (obj *SFTPServer) SetOnNotificationHandler(handlerFunc SFTPServerNotificationEvent)
Remarks
The struct fires this event to let the application know about some event, occurrence, or milestone in the struct. For example, it may fire to report completion of the document processing. The list of events being reported is not fixed, and may be flexibly extended over time.
The unique identifier of the event is provided in the EventID parameter. EventParam contains any parameters accompanying the occurrence. Depending on the type of the struct, the exact action it is performing, or the document being processed, one or both may be omitted.
This struct can fire this event with the following EventID values:
| FileOpen | Notifies your code about the file being opened, which is typically
an indicator of the initiation of the transfer operation.
The EventParam value passed with this EventID is a string of the
following format:
ConnectionID=3;Path=/dir/file;Handle=x5DshAk8;Modes=48;Access=0;DesiredAccess=8 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| FileRead | Notifies your code about the file chunk being requested.
The EventParam value passed with this EventID is a string of the
following format:
ConnectionID=7;Handle=x5DshAk8;Offset=2048;Count=1024;Read=1021 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| FileWrite | Notifies your code about the file chunk being received.
The EventParam value passed with this EventID is a string of the
following format:
ConnectionID=7;Handle=x5DshAk8;Offset=2048;Count=1024 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| FileClose | Notifies your code about the closure of an opened file.
The EventParam value passed with this EventID is a string of the
following format:
ConnectionID=7;Handle=x5DshAk8;Modes=48 This EventID only fires if the NotifyOnFileOperations configuration property is set to true. |
| OpenShell | Notifies your code about an opened shell tunnel. The EventParam has the following format: ConnectionID=9;LocalChannel=1;RemoteChannel=2 |
| OpenCommand | Notifies your code about an opened command tunnel. The
EventParam value has the following format:
ConnectionID=8;LocalChannel=3;RemoteChannel=3;Command=ls -l |
| CloseShell | Indicates the closure of a shell tunnel. The EventParam format is the same as with the OpenShell event ID. |
| CloseCommand | Indicates the closure of a command tunnel. The EventParam format is the same as with the OpenCommand event ID. |
| Banner | Notifies the application that the banner has been prepared and is about to be sent to the other side. The application can adjust the content of the banner by using Banner[ConnID] and Lang[ConnID] configuration settings. |
| ListeningStarted | Notifies the application that the server has started listening for incoming connections. |
| ListeningStopped | Notifies the application that the server has stopped listening to incoming connections. |
OpenClientForwarding Event (SFTPServer Component)
This event is fired when a client opens a client-side (local) forwarding channel.
Syntax
// SFTPServerOpenClientForwardingEventArgs carries the SFTPServer OpenClientForwarding event's parameters.
type SFTPServerOpenClientForwardingEventArgs struct {...}
func (args *SFTPServerOpenClientForwardingEventArgs) ConnectionID() int64
func (args *SFTPServerOpenClientForwardingEventArgs) DestHost() string
func (args *SFTPServerOpenClientForwardingEventArgs) DestPort() int32
func (args *SFTPServerOpenClientForwardingEventArgs) SrcHost() string
func (args *SFTPServerOpenClientForwardingEventArgs) SrcPort() int32
// SFTPServerOpenClientForwardingEvent defines the signature of the SFTPServer OpenClientForwarding event's handler function.
type SFTPServerOpenClientForwardingEvent func(sender *SFTPServer, args *SFTPServerOpenClientForwardingEventArgs)
func (obj *SFTPServer) GetOnOpenClientForwardingHandler() SFTPServerOpenClientForwardingEvent
func (obj *SFTPServer) SetOnOpenClientForwardingHandler(handlerFunc SFTPServerOpenClientForwardingEvent)
Remarks
This event notifies the application that a client-side forwarding channel has been set up. The ConnectionID parameter specifies in which session the request was received.
The DestHost and DestPort parameters specify the address that the data received from the client will be forwarded to. The SrcHost and SrcPort specify the connection origin that is reported by the client. Note that the details of the origin cannot be verified.
OpenCommand Event (SFTPServer Component)
This event is fired when a client has opened an SSH command channel.
Syntax
// SFTPServerOpenCommandEventArgs carries the SFTPServer OpenCommand event's parameters.
type SFTPServerOpenCommandEventArgs struct {...}
func (args *SFTPServerOpenCommandEventArgs) ConnectionID() int64
func (args *SFTPServerOpenCommandEventArgs) Command() string
// SFTPServerOpenCommandEvent defines the signature of the SFTPServer OpenCommand event's handler function.
type SFTPServerOpenCommandEvent func(sender *SFTPServer, args *SFTPServerOpenCommandEventArgs)
func (obj *SFTPServer) GetOnOpenCommandHandler() SFTPServerOpenCommandEvent
func (obj *SFTPServer) SetOnOpenCommandHandler(handlerFunc SFTPServerOpenCommandEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
The component fires CloseCommand when the command channel is closed.
OpenFile Event (SFTPServer Component)
This event instructs the application to handle the file open request.
Syntax
// SFTPServerOpenFileEventArgs carries the SFTPServer OpenFile event's parameters.
type SFTPServerOpenFileEventArgs struct {...}
func (args *SFTPServerOpenFileEventArgs) ConnectionID() int64
func (args *SFTPServerOpenFileEventArgs) Path() string
func (args *SFTPServerOpenFileEventArgs) Modes() int32
func (args *SFTPServerOpenFileEventArgs) Access() int32
func (args *SFTPServerOpenFileEventArgs) OperationStatus() int32
func (args *SFTPServerOpenFileEventArgs) SetOperationStatus(value int32)
func (args *SFTPServerOpenFileEventArgs) Handle() string
func (args *SFTPServerOpenFileEventArgs) SetHandle(value string)
// SFTPServerOpenFileEvent defines the signature of the SFTPServer OpenFile event's handler function.
type SFTPServerOpenFileEvent func(sender *SFTPServer, args *SFTPServerOpenFileEventArgs)
func (obj *SFTPServer) GetOnOpenFileHandler() SFTPServerOpenFileEvent
func (obj *SFTPServer) SetOnOpenFileHandler(handlerFunc SFTPServerOpenFileEvent)
Remarks
This event is fired when a file open request is received from the client and needs to be handled (virtualized) by the server. The ConnectionID parameter specifies in which session the request was received, and Path specifies the location of the file.
Modes can be a combination of one or several file open mode flags:
| cfmRead | 1 |
| cfmWrite | 2 |
| cfmAppend | 4 |
| cfmCreate | 8 |
| cfmTruncate | 16 |
| cfmExcl | 32 |
| cfmText | 64 |
| cfmOpenOrCreate | 128 |
| cfmAppendAtomic | 256 |
| cfmNoFollow | 512 |
| cfmDeleteOnClose | 1024 |
Different client applications may provide different selections of mode flags. For example, some clients specify (cfmCreate + cfmTruncate) when overwriting files, whereas others would specify cfmOpenOrCreate. Please make sure your code is prepared to receive different combinations of flags here and handles them gracefully.
The Access parameter provides additional file access modifiers:
| cfaReadLock | 1 |
| cfaWriteLock | 2 |
| cfaDeleteLock | 4 |
| cfaBlockAdvisory | 8 |
The Handle string represents a unique identifier of the opened file, similar to file handles used in Windows or Unix APIs. Handles are unique across all files opened at the same time. Struct generates handles automatically, but you can update the auto-generated values with your own in this event handler (just remember to keep them unique).
Set OperationStatus parameter in accordance with the outcome of the operation to one of the values given below:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
OpenServerForwarding Event (SFTPServer Component)
This event is fired when the server opens a server-side (remote) forwarding channel.
Syntax
// SFTPServerOpenServerForwardingEventArgs carries the SFTPServer OpenServerForwarding event's parameters.
type SFTPServerOpenServerForwardingEventArgs struct {...}
func (args *SFTPServerOpenServerForwardingEventArgs) ConnectionID() int64
func (args *SFTPServerOpenServerForwardingEventArgs) LocalHost() string
func (args *SFTPServerOpenServerForwardingEventArgs) LocalPort() int32
func (args *SFTPServerOpenServerForwardingEventArgs) SrcHost() string
func (args *SFTPServerOpenServerForwardingEventArgs) SrcPort() int32
// SFTPServerOpenServerForwardingEvent defines the signature of the SFTPServer OpenServerForwarding event's handler function.
type SFTPServerOpenServerForwardingEvent func(sender *SFTPServer, args *SFTPServerOpenServerForwardingEventArgs)
func (obj *SFTPServer) GetOnOpenServerForwardingHandler() SFTPServerOpenServerForwardingEvent
func (obj *SFTPServer) SetOnOpenServerForwardingHandler(handlerFunc SFTPServerOpenServerForwardingEvent)
Remarks
This event notifies the application that a server-side forwarding channel has been set up. The ConnectionID parameter specifies in which session the request was received.
The DestHost and DestPort parameters specify the address that the data received from the connection accepted by the server will be forwarded to, according to the client. The SrcHost and SrcPort specify the connection origin.
OpenShell Event (SFTPServer Component)
This event is fired when a client has opened a shell channel.
Syntax
// SFTPServerOpenShellEventArgs carries the SFTPServer OpenShell event's parameters.
type SFTPServerOpenShellEventArgs struct {...}
func (args *SFTPServerOpenShellEventArgs) ConnectionID() int64
// SFTPServerOpenShellEvent defines the signature of the SFTPServer OpenShell event's handler function.
type SFTPServerOpenShellEvent func(sender *SFTPServer, args *SFTPServerOpenShellEventArgs)
func (obj *SFTPServer) GetOnOpenShellHandler() SFTPServerOpenShellEvent
func (obj *SFTPServer) SetOnOpenShellHandler(handlerFunc SFTPServerOpenShellEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received.
The component fires CloseShell when the shell channel is closed.
ReadFile Event (SFTPServer Component)
This event is fired when a file read request is received.
Syntax
// SFTPServerReadFileEventArgs carries the SFTPServer ReadFile event's parameters.
type SFTPServerReadFileEventArgs struct {...}
func (args *SFTPServerReadFileEventArgs) ConnectionID() int64
func (args *SFTPServerReadFileEventArgs) Handle() string
func (args *SFTPServerReadFileEventArgs) Offset() int64
func (args *SFTPServerReadFileEventArgs) Size() int32
func (args *SFTPServerReadFileEventArgs) OperationStatus() int32
func (args *SFTPServerReadFileEventArgs) SetOperationStatus(value int32)
// SFTPServerReadFileEvent defines the signature of the SFTPServer ReadFile event's handler function.
type SFTPServerReadFileEvent func(sender *SFTPServer, args *SFTPServerReadFileEventArgs)
func (obj *SFTPServer) GetOnReadFileHandler() SFTPServerReadFileEvent
func (obj *SFTPServer) SetOnReadFileHandler(handlerFunc SFTPServerReadFileEvent)
Remarks
This event is fired when a request to read block from a file is received from the client. The ConnectionID parameter specifies in which session the request was received, and Handle indicates an opened file handle. Offset and Size denote the location and size of the file piece.
Inside the event handler, pass the appropriate file chunk to the component via SetClientBuffer method.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
Remove Event (SFTPServer Component)
This event is fired when a client requests to delete a file or directory.
Syntax
// SFTPServerRemoveEventArgs carries the SFTPServer Remove event's parameters.
type SFTPServerRemoveEventArgs struct {...}
func (args *SFTPServerRemoveEventArgs) ConnectionID() int64
func (args *SFTPServerRemoveEventArgs) Path() string
func (args *SFTPServerRemoveEventArgs) OperationStatus() int32
func (args *SFTPServerRemoveEventArgs) SetOperationStatus(value int32)
// SFTPServerRemoveEvent defines the signature of the SFTPServer Remove event's handler function.
type SFTPServerRemoveEvent func(sender *SFTPServer, args *SFTPServerRemoveEventArgs)
func (obj *SFTPServer) GetOnRemoveHandler() SFTPServerRemoveEvent
func (obj *SFTPServer) SetOnRemoveHandler(handlerFunc SFTPServerRemoveEvent)
Remarks
This event is fired when a request to delete a file or directory is received from the client. The ConnectionID parameter specifies in which session the request was received.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
RenameFile Event (SFTPServer Component)
This event is fired when a client requests to rename a file.
Syntax
// SFTPServerRenameFileEventArgs carries the SFTPServer RenameFile event's parameters.
type SFTPServerRenameFileEventArgs struct {...}
func (args *SFTPServerRenameFileEventArgs) ConnectionID() int64
func (args *SFTPServerRenameFileEventArgs) OldPath() string
func (args *SFTPServerRenameFileEventArgs) NewPath() string
func (args *SFTPServerRenameFileEventArgs) OperationStatus() int32
func (args *SFTPServerRenameFileEventArgs) SetOperationStatus(value int32)
// SFTPServerRenameFileEvent defines the signature of the SFTPServer RenameFile event's handler function.
type SFTPServerRenameFileEvent func(sender *SFTPServer, args *SFTPServerRenameFileEventArgs)
func (obj *SFTPServer) GetOnRenameFileHandler() SFTPServerRenameFileEvent
func (obj *SFTPServer) SetOnRenameFileHandler(handlerFunc SFTPServerRenameFileEvent)
Remarks
This event is fired when a request to rename a file (from OldPath to NewPath) is received from the client. The ConnectionID parameter specifies in which session the request was received.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
RequestAttributes Event (SFTPServer Component)
This event is fired when a get file attributes request is received.
Syntax
// SFTPServerRequestAttributesEventArgs carries the SFTPServer RequestAttributes event's parameters.
type SFTPServerRequestAttributesEventArgs struct {...}
func (args *SFTPServerRequestAttributesEventArgs) ConnectionID() int64
func (args *SFTPServerRequestAttributesEventArgs) Path() string
func (args *SFTPServerRequestAttributesEventArgs) Handle() string
func (args *SFTPServerRequestAttributesEventArgs) OperationStatus() int32
func (args *SFTPServerRequestAttributesEventArgs) SetOperationStatus(value int32)
// SFTPServerRequestAttributesEvent defines the signature of the SFTPServer RequestAttributes event's handler function.
type SFTPServerRequestAttributesEvent func(sender *SFTPServer, args *SFTPServerRequestAttributesEventArgs)
func (obj *SFTPServer) GetOnRequestAttributesHandler() SFTPServerRequestAttributesEvent
func (obj *SFTPServer) SetOnRequestAttributesHandler(handlerFunc SFTPServerRequestAttributesEvent)
Remarks
This event is fired when a request to get file attributes is received from the client. The ConnectionID parameter specifies in which session the request was received, and Path specifies the file location where the attributes need to be retrieved.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
ServerForwardingCancel Event (SFTPServer Component)
This event is fired when the client cancels a previously negotiated server-side (remote) forwarding.
Syntax
// SFTPServerServerForwardingCancelEventArgs carries the SFTPServer ServerForwardingCancel event's parameters.
type SFTPServerServerForwardingCancelEventArgs struct {...}
func (args *SFTPServerServerForwardingCancelEventArgs) ConnectionID() int64
func (args *SFTPServerServerForwardingCancelEventArgs) LocalHost() string
func (args *SFTPServerServerForwardingCancelEventArgs) LocalPort() int32
// SFTPServerServerForwardingCancelEvent defines the signature of the SFTPServer ServerForwardingCancel event's handler function.
type SFTPServerServerForwardingCancelEvent func(sender *SFTPServer, args *SFTPServerServerForwardingCancelEventArgs)
func (obj *SFTPServer) GetOnServerForwardingCancelHandler() SFTPServerServerForwardingCancelEvent
func (obj *SFTPServer) SetOnServerForwardingCancelHandler(handlerFunc SFTPServerServerForwardingCancelEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received. The LocalHost:LocalPort specify the endpoint that the server is listening on.
After receiving the cancellation request the server will no longer listen to connections at the mentioned endpoint.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
ServerForwardingOpenFailed Event (SFTPServer Component)
This event is fired when the client rejects the server request to establish a server forwarding channel.
Syntax
// SFTPServerServerForwardingOpenFailedEventArgs carries the SFTPServer ServerForwardingOpenFailed event's parameters.
type SFTPServerServerForwardingOpenFailedEventArgs struct {...}
func (args *SFTPServerServerForwardingOpenFailedEventArgs) ConnectionID() int64
func (args *SFTPServerServerForwardingOpenFailedEventArgs) LocalHost() string
func (args *SFTPServerServerForwardingOpenFailedEventArgs) LocalPort() int32
func (args *SFTPServerServerForwardingOpenFailedEventArgs) SrcHost() string
func (args *SFTPServerServerForwardingOpenFailedEventArgs) SrcPort() int32
// SFTPServerServerForwardingOpenFailedEvent defines the signature of the SFTPServer ServerForwardingOpenFailed event's handler function.
type SFTPServerServerForwardingOpenFailedEvent func(sender *SFTPServer, args *SFTPServerServerForwardingOpenFailedEventArgs)
func (obj *SFTPServer) GetOnServerForwardingOpenFailedHandler() SFTPServerServerForwardingOpenFailedEvent
func (obj *SFTPServer) SetOnServerForwardingOpenFailedHandler(handlerFunc SFTPServerServerForwardingOpenFailedEvent)
Remarks
This event can follow the BeforeOpenServerForwarding and OpenServerForwarding if the client rejects the server request to forward an accepted TCP connection.
The ConnectionID parameter specifies in which session the request was received. The LocalHost:LocalPort specify the endpoint that the server has received the connection on.
ServerForwardingRequest Event (SFTPServer Component)
This event is fired when the client requests the server to set up server-side (remote) forwarding.
Syntax
// SFTPServerServerForwardingRequestEventArgs carries the SFTPServer ServerForwardingRequest event's parameters.
type SFTPServerServerForwardingRequestEventArgs struct {...}
func (args *SFTPServerServerForwardingRequestEventArgs) ConnectionID() int64
func (args *SFTPServerServerForwardingRequestEventArgs) LocalHost() string
func (args *SFTPServerServerForwardingRequestEventArgs) LocalPort() int32
func (args *SFTPServerServerForwardingRequestEventArgs) SetLocalPort(value int32)
func (args *SFTPServerServerForwardingRequestEventArgs) Action() int32
func (args *SFTPServerServerForwardingRequestEventArgs) SetAction(value int32)
// SFTPServerServerForwardingRequestEvent defines the signature of the SFTPServer ServerForwardingRequest event's handler function.
type SFTPServerServerForwardingRequestEvent func(sender *SFTPServer, args *SFTPServerServerForwardingRequestEventArgs)
func (obj *SFTPServer) GetOnServerForwardingRequestHandler() SFTPServerServerForwardingRequestEvent
func (obj *SFTPServer) SetOnServerForwardingRequestHandler(handlerFunc SFTPServerServerForwardingRequestEvent)
Remarks
The ConnectionID parameter specifies in which session the request was received. The LocalHost:LocalPort specify the endpoint that the client expects the server to listen on. The server may choose to use a different port, in which case please adjust the LocalPort in the event handler.
If permitted, the server will open the requested port and start listening to incoming connections. All such connections will be reported via BeforeOpenServerForwarding and OpenServerForwarding events.
You can enable or disable server forwarding blanketly via the Capabilities property.
Choose Action as one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
SessionClosed Event (SFTPServer Component)
Reports session closure.
Syntax
// SFTPServerSessionClosedEventArgs carries the SFTPServer SessionClosed event's parameters.
type SFTPServerSessionClosedEventArgs struct {...}
func (args *SFTPServerSessionClosedEventArgs) ConnectionID() int64
// SFTPServerSessionClosedEvent defines the signature of the SFTPServer SessionClosed event's handler function.
type SFTPServerSessionClosedEvent func(sender *SFTPServer, args *SFTPServerSessionClosedEventArgs)
func (obj *SFTPServer) GetOnSessionClosedHandler() SFTPServerSessionClosedEvent
func (obj *SFTPServer) SetOnSessionClosedHandler(handlerFunc SFTPServerSessionClosedEvent)
Remarks
This event is fired when a connection identified by ConnectionID has been gracefully closed.
SessionEstablished Event (SFTPServer Component)
This event is fired when a new session is established.
Syntax
// SFTPServerSessionEstablishedEventArgs carries the SFTPServer SessionEstablished event's parameters.
type SFTPServerSessionEstablishedEventArgs struct {...}
func (args *SFTPServerSessionEstablishedEventArgs) ConnectionID() int64
// SFTPServerSessionEstablishedEvent defines the signature of the SFTPServer SessionEstablished event's handler function.
type SFTPServerSessionEstablishedEvent func(sender *SFTPServer, args *SFTPServerSessionEstablishedEventArgs)
func (obj *SFTPServer) GetOnSessionEstablishedHandler() SFTPServerSessionEstablishedEvent
func (obj *SFTPServer) SetOnSessionEstablishedHandler(handlerFunc SFTPServerSessionEstablishedEvent)
Remarks
This event is fired when a new connection identified by ConnectionID has been established with a client.
SetAttributes Event (SFTPServer Component)
This event is fired when an set file attributes request is received.
Syntax
// SFTPServerSetAttributesEventArgs carries the SFTPServer SetAttributes event's parameters.
type SFTPServerSetAttributesEventArgs struct {...}
func (args *SFTPServerSetAttributesEventArgs) ConnectionID() int64
func (args *SFTPServerSetAttributesEventArgs) Path() string
func (args *SFTPServerSetAttributesEventArgs) Handle() string
func (args *SFTPServerSetAttributesEventArgs) OperationStatus() int32
func (args *SFTPServerSetAttributesEventArgs) SetOperationStatus(value int32)
// SFTPServerSetAttributesEvent defines the signature of the SFTPServer SetAttributes event's handler function.
type SFTPServerSetAttributesEvent func(sender *SFTPServer, args *SFTPServerSetAttributesEventArgs)
func (obj *SFTPServer) GetOnSetAttributesHandler() SFTPServerSetAttributesEvent
func (obj *SFTPServer) SetOnSetAttributesHandler(handlerFunc SFTPServerSetAttributesEvent)
Remarks
This event is fired when a request to set file attributes is received from the client. The ConnectionID parameter specifies in which session the request was received, and Path specifies the file location which the attributes needs to be set.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
TranslatePath Event (SFTPServer Component)
This event is fired when a client requests the server to translate a path to its absolute form.
Syntax
// SFTPServerTranslatePathEventArgs carries the SFTPServer TranslatePath event's parameters.
type SFTPServerTranslatePathEventArgs struct {...}
func (args *SFTPServerTranslatePathEventArgs) ConnectionID() int64
func (args *SFTPServerTranslatePathEventArgs) Path() string
func (args *SFTPServerTranslatePathEventArgs) AbsolutePath() string
func (args *SFTPServerTranslatePathEventArgs) SetAbsolutePath(value string)
func (args *SFTPServerTranslatePathEventArgs) Action() int32
func (args *SFTPServerTranslatePathEventArgs) SetAction(value int32)
// SFTPServerTranslatePathEvent defines the signature of the SFTPServer TranslatePath event's handler function.
type SFTPServerTranslatePathEvent func(sender *SFTPServer, args *SFTPServerTranslatePathEventArgs)
func (obj *SFTPServer) GetOnTranslatePathHandler() SFTPServerTranslatePathEvent
func (obj *SFTPServer) SetOnTranslatePathHandler(handlerFunc SFTPServerTranslatePathEvent)
Remarks
This event is fired when a request to translate a relative path to the corresponding absolute path is received. The ConnectionID parameter specifies the session in which the request was received.
You can let the server do the translation automatically according to the default file system rules, or take care of it yourself. Use the Action parameter to specify who is responsible for the translation. If doing the translation manually, return the translated path via the AbsolutePath parameter. Action can take one of the following values:
| fraAuto | 1 | Handle the requested action automatically by the server |
| fraCustom | 2 | Override the action using the user code logic |
| fraAbort | 3 | Abort the requested action |
WriteFile Event (SFTPServer Component)
This event is fired when a file write request is received.
Syntax
// SFTPServerWriteFileEventArgs carries the SFTPServer WriteFile event's parameters.
type SFTPServerWriteFileEventArgs struct {...}
func (args *SFTPServerWriteFileEventArgs) ConnectionID() int64
func (args *SFTPServerWriteFileEventArgs) Handle() string
func (args *SFTPServerWriteFileEventArgs) Offset() int64
func (args *SFTPServerWriteFileEventArgs) OperationStatus() int32
func (args *SFTPServerWriteFileEventArgs) SetOperationStatus(value int32)
// SFTPServerWriteFileEvent defines the signature of the SFTPServer WriteFile event's handler function.
type SFTPServerWriteFileEvent func(sender *SFTPServer, args *SFTPServerWriteFileEventArgs)
func (obj *SFTPServer) GetOnWriteFileHandler() SFTPServerWriteFileEvent
func (obj *SFTPServer) SetOnWriteFileHandler(handlerFunc SFTPServerWriteFileEvent)
Remarks
This event is fired when a request to write a data block to a file is received from the client. The ConnectionID parameter specifies the session the request originates from. The Handle parameter references the opened file where the block should be written to. Offset references the position in the file where the block of data should be written.
Use GetClientBuffer method to obtain the piece of data that should be written to the file.
Set OperationStatus to one of the below values according to the outcome of the request processing:
| ostOk | 1 | |
| ostNoSuchFile | 2 | |
| ostAccessDenied | 3 | |
| ostWriteProtect | 4 | |
| ostUnsupported | 5 | |
| ostInvalidParameter | 6 | |
| ostEOF | 7 |
Config Settings (SFTPServer Component)
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.SFTPServer Config Settings
Since both client and server must implement strict key exchange to effectively mitigate the Terrapin attack, the struct provides options to further control the behavior in different scenarios. Possible values for this setting are:
| 0 | Disabled. Strict key exchange is not supported in the struct. |
| 1 (default) | Enabled, but not enforced. This setting enables strict key exchange, but if the remote host does not support strict key exchange the connection is still allowed to continue. |
| 2 | Enabled, but reject affected algorithms if the remote host does not support strict key exchange. If the remote host supports strict key exchange all algorithms may be used. If the remote host does not support strict key exchange the connection will only continue if the selected encryption and MAC algorithms are not affected by the Terrapin attack. |
| 3 | Required. If the remote host does not support strict key exchange the connection will fail. |
Base Config Settings
You can switch this property off to improve performance if your project only uses known, good private keys.
Supported values are:
| off | No caching (default) | |
| local | Local caching | |
| global | Global caching |
This setting only applies to sessions negotiated with TLS version 1.3.
Supported Values:
| auto | Use hardware cryptography if available; otherwise, fall back to software-based cryptography (default). |
| enable | Always attempt to use hardware cryptography. If unavailable, exception will be thrown. |
| disable | Do not use hardware cryptography. |
Supported values are:
| file | File | |
| console | Console | |
| systemlog | System Log (supported for Android only) | |
| debugger | Debugger (supported for VCL for Windows and .Net) |
Supported values are:
| time | Current time | |
| level | Level | |
| package | Package name | |
| module | Module name | |
| class | Class name | |
| method | Method name | |
| threadid | Thread Id | |
| contenttype | Content type | |
| content | Content | |
| all | All details |
Supported filter names are:
| exclude-package | Exclude a package specified in the value | |
| exclude-module | Exclude a module specified in the value | |
| exclude-class | Exclude a class specified in the value | |
| exclude-method | Exclude a method specified in the value | |
| include-package | Include a package specified in the value | |
| include-module | Include a module specified in the value | |
| include-class | Include a class specified in the value | |
| include-method | Include a method specified in the value |
| none | No flush (caching only) | |
| immediate | Immediate flush (real-time logging) | |
| maxcount | Flush cached entries upon reaching LogMaxEventCount entries in the cache. |
Supported values are:
| none | None (by default) | |
| fatal | Severe errors that cause premature termination. | |
| error | Other runtime errors or unexpected conditions. | |
| warning | Use of deprecated APIs, poor use of API, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong". | |
| info | Interesting runtime events (startup/shutdown). | |
| debug | Detailed information on flow of through the system. | |
| trace | More detailed information. |
The default value of this setting is 100.
| none | No rotation | |
| deleteolder | Delete older entries from the cache upon reaching LogMaxEventCount | |
| keepolder | Keep older entries in the cache upon reaching LogMaxEventCount (newer entries are discarded) |
Supported Values:
| certificate | Enables caching of certificates. |
| crl | Enables caching of Certificate Revocation Lists (CRLs). |
| ocsp | Enables caching of OCSP (Online Certificate Status Protocol) responses. |
Example (default value):
PKICache=certificate,crl,ocsp
In this example, the component caches certificates, CRLs, and OCSP responses.
The default value is an empty string - no cached PKI data is stored on disk.
Example:
PKICachePath=C:\Temp\cache
In this example, the cached PKI data is stored in the C:\Temp\cache directory.
Supported values are:
| none | No static DNS rules (default) | |
| local | Local static DNS rules | |
| global | Global static DNS rules |
This setting only applies to certificates originating from a Windows system store.
The property accepts comma-separated values where the first descriptor name is used when the OID is mapped, and subsequent values act as aliases for parsing.
Syntax:
Config("XMLRDNDescriptorName[OID]=PrimaryName,Alias1,Alias2");
Where:
OID: The Object Identifier from the certificate's IssuerRDN or SubjectRDN that you want to map.
PrimaryName: The main descriptor name used in the XML signature when the OID is encountered.
Alias1, Alias2, ...: Optional alternative names recognized during parsing.
Usage Examples:
Map OID 2.5.4.5 to SERIALNUMBER:
Config("XMLRDNDescriptorName[2.5.4.5]=SERIALNUMBER");
Map OID 1.2.840.113549.1.9.1 to E, with aliases EMAIL and EMAILADDRESS:
Config("XMLRDNDescriptorName[1.2.840.113549.1.9.1]=E,EMAIL,EMAILADDRESS");
Trappable Errors (SFTPServer Component)
SFTPServer Errors
| 1048577 | Invalid parameter (SB_ERROR_INVALID_PARAMETER) |
| 1048578 | Invalid configuration (SB_ERROR_INVALID_SETUP) |
| 1048579 | Invalid state (SB_ERROR_INVALID_STATE) |
| 1048580 | Invalid value (SB_ERROR_INVALID_VALUE) |
| 1048581 | Private key not found (SB_ERROR_NO_PRIVATE_KEY) |
| 1048582 | Cancelled by the user (SB_ERROR_CANCELLED_BY_USER) |
| 1048583 | The file was not found (SB_ERROR_NO_SUCH_FILE) |
| 1048584 | Unsupported feature or operation (SB_ERROR_UNSUPPORTED_FEATURE) |
| 1048585 | General error (SB_ERROR_GENERAL_ERROR) |
| 31457281 | Unsupported file operation (SB_ERROR_SFTP_UNSUPPORTED_FILE_OPERATION) |
| 31457282 | Invalid authentication type (SB_ERROR_SFTP_INVALID_AUTH_TYPE) |