SFTPServer Component
Properties Methods Events Config Settings Errors
The SFTPServer component provides server-side functionality for SFTP connections.
Syntax
nsoftware.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 component must support/enable. |
ClientFileEntry | A container for file entry details. |
CompressionLevel | Specifies the preferable compression level |
ExternalCrypto | Provides access to external signing and DC parameters. |
FIPSMode | Reserved. |
ForceCompression | This property specifies whether server explicitly requires data compression. |
Host | Specifies server's host name. |
Key | Contains client's public key. |
MaxSFTPVersion | Maximum SFTP version supported. |
MinSFTPVersion | Minimum SFTP version supported. |
PinnedClient | Populates the pinned client details. |
Port | Specifies the listening port number. |
ReadOnly | Specifies whether files on the server are read-only. |
ServerKeys | The server's SSH keys. |
SocketSettings | Manages network connection settings. |
SSHSettings | The SSH connection settings. |
Users | A collection of known users. |
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 component. |
ListClients | Enumerates the connected clients. |
PinClient | Takes a snapshot of the connection's properties. |
Reset | Resets the component settings. |
SetClientBuffer | Commits a data buffer to the server component. |
SetClientFileEntry | Commits the file entry details to the component. |
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 component. |
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 component. |
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 component. |
KexAlgorithms | Returns the list of key exchange algorithms enabled in the component. |
LanguageTag[i] | TBD. |
MacAlgorithms | Returns the list of MAC algorithms enabled in the component. |
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 component. |
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 component. |
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. |
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 components 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. |
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. |
UseInternalRandom | Switches between SecureBlackbox-own and platform PRNGs. |
UseLegacyAdESValidation | Enables legacy AdES validation mode. |
UseOwnDNSResolver | Specifies whether the client components 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. |
Active Property (SFTPServer Component)
Specifies whether the SFTP server has started and ready to accept connections.
Syntax
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 and not available at design time.
AuthTypes Property (SFTPServer Component)
Defines allowed authentication types.
Syntax
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 |
BaseDir Property (SFTPServer Component)
Specifies the server's base (root) directory.
Syntax
Default Value
""
Remarks
Use this property to set the base (root) directory on the server.
Capabilities Property (SFTPServer Component)
Specifies which elements of the SSH ecosystem the component must support/enable.
Syntax
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 |
ClientFileEntry Property (SFTPServer Component)
A container for file entry details.
Syntax
public FTPListEntry ClientFileEntry { get; set; }
Public Property ClientFileEntry As FTPListEntry
Remarks
This property is a placeholder for file entry details. Use it communicate file details from your code to the server component and back. Pass the contents of ClientFileEntry to the server with SetClientFileEntry method, and retrieve them with GetClientFileEntry method.
This property may come handy when customizing file system operations, such as file listings or attribute requests.
This property is not available at design time.
Please refer to the FTPListEntry type for a complete list of fields.CompressionLevel Property (SFTPServer Component)
Specifies the preferable compression level
Syntax
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.
ExternalCrypto Property (SFTPServer Component)
Provides access to external signing and DC parameters.
Syntax
public ExternalCrypto ExternalCrypto { get; }
Public ReadOnly Property ExternalCrypto As ExternalCrypto
Remarks
Use this property to tune-up remote cryptography settings. SecureBlackbox supports two independent types of external cryptography: synchronous (based on the ExternalSign event) and asynchronous (based on the DC protocol and the DCAuth signing component).
This property is read-only.
Please refer to the ExternalCrypto type for a complete list of fields.FIPSMode Property (SFTPServer Component)
Reserved.
Syntax
Default Value
False
Remarks
This property is reserved for future use.
ForceCompression Property (SFTPServer Component)
This property specifies whether server explicitly requires data compression.
Syntax
Default Value
False
Remarks
Set this property before starting the server. If it is set to true, the component will explicitly request data compression. If it is set to False, the component will support compression, although compression will be used only if the remote party doesn't support algorithms without compression.
Host Property (SFTPServer Component)
Specifies server's host name.
Syntax
Default Value
""
Remarks
Use this property to set the host name for this server.
Key Property (SFTPServer Component)
Contains client's public key.
Syntax
Remarks
This property returns the current client's public key. Check this property inside your AuthPublicKey event handler.
This property is read-only and not available at design time.
Please refer to the SSHKey type for a complete list of fields.MaxSFTPVersion Property (SFTPServer Component)
Maximum SFTP version supported.
Syntax
Default Value
6
Remarks
MaxSFTPVersion and MinSFTPVersion properties control the range of SFTP protocol versions supported by this server.
MinSFTPVersion Property (SFTPServer Component)
Minimum SFTP version supported.
Syntax
Default Value
0
Remarks
MaxSFTPVersion and MinSFTPVersion properties control the range of SFTP protocol versions supported by this server.
PinnedClient Property (SFTPServer Component)
Populates the pinned client details.
Syntax
public SSHConnectionInfo PinnedClient { get; }
Public ReadOnly Property PinnedClient As SSHConnectionInfo
Remarks
Use this property to access the details of the client connection previously pinned with PinClient method.
This property is read-only and not available at design time.
Please refer to the SSHConnectionInfo type for a complete list of fields.Port Property (SFTPServer Component)
Specifies the listening port number.
Syntax
Default Value
22
Remarks
Use this property to specify on which port the component will be listening to client connections.
ReadOnly Property (SFTPServer Component)
Specifies whether files on the server are read-only.
Syntax
Default Value
False
Remarks
Set this property to true to deny all client requests to change files on the server.
ServerKeys Property (SFTPServer Component)
The server's SSH keys.
Syntax
public SSHKeyList ServerKeys { get; }
Public Property ServerKeys As SSHKeyList
Remarks
Use this property to provide a list of SSH private keys for the server endpoint.
An SSH endpoint needs a private key to be able to accept secure connections. Apart from being employed for the handshake, the key is also used as a unique server identifier.
The collection may include more than one endpoint key. A typical usage scenario is to include two or three keys (ECDSA, RSA, and DSS), to cater for clients with different algorithm preferences.
This property is not available at design time.
Please refer to the SSHKey type for a complete list of fields.SocketSettings Property (SFTPServer Component)
Manages network connection settings.
Syntax
public SocketSettings SocketSettings { get; }
Public ReadOnly Property SocketSettings As SocketSettings
Remarks
Use this property to tune up network connection parameters.
This property is read-only.
Please refer to the SocketSettings type for a complete list of fields.SSHSettings Property (SFTPServer Component)
The SSH connection settings.
Syntax
public SSHSettings SSHSettings { get; }
Public ReadOnly Property SSHSettings As SSHSettings
Remarks
Use this property to access and tune-up the SSH layer settings.
This property is read-only.
Please refer to the SSHSettings type for a complete list of fields.Users Property (SFTPServer Component)
A collection of known users.
Syntax
public UserAccountList Users { get; }
Public Property Users As UserAccountList
Remarks
This property provides access to registered user database.
This property is not available at design time.
Please refer to the UserAccount type for a complete list of fields.UseUTF8 Property (SFTPServer Component)
Specifies whether UTF8 conversion is to be used when parsing file names.
Syntax
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.
Cleanup Method (SFTPServer Component)
Cleans up the server environment by purging expired sessions and cleaning caches.
Syntax
public void Cleanup();
Public Sub Cleanup()
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
Remarks
Config is a generic method available in every component. It is used to set and retrieve configuration settings for the component.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the component, 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
Remarks
DoAction is a generic method available in every component. 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;....
DropClient Method (SFTPServer Component)
Terminates a client connection.
Syntax
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
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 component.
Syntax
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
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
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 component settings.
Syntax
public void Reset();
Public Sub Reset()
Remarks
Reset is a generic method available in every component.
SetClientBuffer Method (SFTPServer Component)
Commits a data buffer to the server component.
Syntax
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 component.
Syntax
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
public void Start();
Public Sub Start()
Remarks
Call this method to start listening to incoming connections.
Stop Method (SFTPServer Component)
Stops SFTP server.
Syntax
public void Stop();
Public Sub Stop()
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
public event OnAcceptHandler OnAccept; public delegate void OnAcceptHandler(object sender, SFTPServerAcceptEventArgs e); public class SFTPServerAcceptEventArgs : EventArgs { public string RemoteAddress { get; } public int RemotePort { get; } public bool Accept { get; set; } }
Public Event OnAccept As OnAcceptHandler Public Delegate Sub OnAcceptHandler(sender As Object, e As SFTPServerAcceptEventArgs) Public Class SFTPServerAcceptEventArgs Inherits EventArgs Public ReadOnly Property RemoteAddress As String Public ReadOnly Property RemotePort As Integer Public Property Accept As Boolean End Class
Remarks
This event is fired by the component 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
public event OnAfterCreateDirectoryHandler OnAfterCreateDirectory; public delegate void OnAfterCreateDirectoryHandler(object sender, SFTPServerAfterCreateDirectoryEventArgs e); public class SFTPServerAfterCreateDirectoryEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } }
Public Event OnAfterCreateDirectory As OnAfterCreateDirectoryHandler Public Delegate Sub OnAfterCreateDirectoryHandler(sender As Object, e As SFTPServerAfterCreateDirectoryEventArgs) Public Class SFTPServerAfterCreateDirectoryEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer End Class
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
public event OnAfterRemoveHandler OnAfterRemove; public delegate void OnAfterRemoveHandler(object sender, SFTPServerAfterRemoveEventArgs e); public class SFTPServerAfterRemoveEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } }
Public Event OnAfterRemove As OnAfterRemoveHandler Public Delegate Sub OnAfterRemoveHandler(sender As Object, e As SFTPServerAfterRemoveEventArgs) Public Class SFTPServerAfterRemoveEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer End Class
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
public event OnAfterRenameFileHandler OnAfterRenameFile; public delegate void OnAfterRenameFileHandler(object sender, SFTPServerAfterRenameFileEventArgs e); public class SFTPServerAfterRenameFileEventArgs : EventArgs { public long ConnectionID { get; } public string OldPath { get; } public string NewPath { get; } public int OperationStatus { get; set; } }
Public Event OnAfterRenameFile As OnAfterRenameFileHandler Public Delegate Sub OnAfterRenameFileHandler(sender As Object, e As SFTPServerAfterRenameFileEventArgs) Public Class SFTPServerAfterRenameFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property OldPath As String Public ReadOnly Property NewPath As String Public Property OperationStatus As Integer End Class
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
public event OnAfterRequestAttributesHandler OnAfterRequestAttributes; public delegate void OnAfterRequestAttributesHandler(object sender, SFTPServerAfterRequestAttributesEventArgs e); public class SFTPServerAfterRequestAttributesEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } }
Public Event OnAfterRequestAttributes As OnAfterRequestAttributesHandler Public Delegate Sub OnAfterRequestAttributesHandler(sender As Object, e As SFTPServerAfterRequestAttributesEventArgs) Public Class SFTPServerAfterRequestAttributesEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer End Class
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
public event OnAfterSetAttributesHandler OnAfterSetAttributes; public delegate void OnAfterSetAttributesHandler(object sender, SFTPServerAfterSetAttributesEventArgs e); public class SFTPServerAfterSetAttributesEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } }
Public Event OnAfterSetAttributes As OnAfterSetAttributesHandler Public Delegate Sub OnAfterSetAttributesHandler(sender As Object, e As SFTPServerAfterSetAttributesEventArgs) Public Class SFTPServerAfterSetAttributesEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer End Class
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
public event OnAuthAttemptHandler OnAuthAttempt; public delegate void OnAuthAttemptHandler(object sender, SFTPServerAuthAttemptEventArgs e); public class SFTPServerAuthAttemptEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public int AuthType { get; } public bool Accept { get; set; } }
Public Event OnAuthAttempt As OnAuthAttemptHandler Public Delegate Sub OnAuthAttemptHandler(sender As Object, e As SFTPServerAuthAttemptEventArgs) Public Class SFTPServerAuthAttemptEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public ReadOnly Property AuthType As Integer Public Property Accept As Boolean End Class
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
public event OnAuthFailedHandler OnAuthFailed; public delegate void OnAuthFailedHandler(object sender, SFTPServerAuthFailedEventArgs e); public class SFTPServerAuthFailedEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public int AuthType { get; } }
Public Event OnAuthFailed As OnAuthFailedHandler Public Delegate Sub OnAuthFailedHandler(sender As Object, e As SFTPServerAuthFailedEventArgs) Public Class SFTPServerAuthFailedEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public ReadOnly Property AuthType As Integer End Class
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
public event OnAuthPasswordHandler OnAuthPassword; public delegate void OnAuthPasswordHandler(object sender, SFTPServerAuthPasswordEventArgs e); public class SFTPServerAuthPasswordEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public string Password { get; } public bool Accept { get; set; } public bool ForceChangePassword { get; set; } }
Public Event OnAuthPassword As OnAuthPasswordHandler Public Delegate Sub OnAuthPasswordHandler(sender As Object, e As SFTPServerAuthPasswordEventArgs) Public Class SFTPServerAuthPasswordEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public ReadOnly Property Password As String Public Property Accept As Boolean Public Property ForceChangePassword As Boolean End Class
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
public event OnAuthPublicKeyHandler OnAuthPublicKey; public delegate void OnAuthPublicKeyHandler(object sender, SFTPServerAuthPublicKeyEventArgs e); public class SFTPServerAuthPublicKeyEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public bool Accept { get; set; } }
Public Event OnAuthPublicKey As OnAuthPublicKeyHandler Public Delegate Sub OnAuthPublicKeyHandler(sender As Object, e As SFTPServerAuthPublicKeyEventArgs) Public Class SFTPServerAuthPublicKeyEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public Property Accept As Boolean End Class
Remarks
Username specifies client's username, and Accept is used to accept or reject authentication.
AuthSucceeded Event (SFTPServer Component)
Reports a successful user authentication.
Syntax
public event OnAuthSucceededHandler OnAuthSucceeded; public delegate void OnAuthSucceededHandler(object sender, SFTPServerAuthSucceededEventArgs e); public class SFTPServerAuthSucceededEventArgs : EventArgs { public long ConnectionID { get; } public string Username { get; } public int AuthType { get; } }
Public Event OnAuthSucceeded As OnAuthSucceededHandler Public Delegate Sub OnAuthSucceededHandler(sender As Object, e As SFTPServerAuthSucceededEventArgs) Public Class SFTPServerAuthSucceededEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Username As String Public ReadOnly Property AuthType As Integer End Class
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
public event OnBeforeCreateDirectoryHandler OnBeforeCreateDirectory; public delegate void OnBeforeCreateDirectoryHandler(object sender, SFTPServerBeforeCreateDirectoryEventArgs e); public class SFTPServerBeforeCreateDirectoryEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeCreateDirectory As OnBeforeCreateDirectoryHandler Public Delegate Sub OnBeforeCreateDirectoryHandler(sender As Object, e As SFTPServerBeforeCreateDirectoryEventArgs) Public Class SFTPServerBeforeCreateDirectoryEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnBeforeDownloadFileHandler OnBeforeDownloadFile; public delegate void OnBeforeDownloadFileHandler(object sender, SFTPServerBeforeDownloadFileEventArgs e); public class SFTPServerBeforeDownloadFileEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeDownloadFile As OnBeforeDownloadFileHandler Public Delegate Sub OnBeforeDownloadFileHandler(sender As Object, e As SFTPServerBeforeDownloadFileEventArgs) Public Class SFTPServerBeforeDownloadFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnBeforeFindHandler OnBeforeFind; public delegate void OnBeforeFindHandler(object sender, SFTPServerBeforeFindEventArgs e); public class SFTPServerBeforeFindEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeFind As OnBeforeFindHandler Public Delegate Sub OnBeforeFindHandler(sender As Object, e As SFTPServerBeforeFindEventArgs) Public Class SFTPServerBeforeFindEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnBeforeOpenClientForwardingHandler OnBeforeOpenClientForwarding; public delegate void OnBeforeOpenClientForwardingHandler(object sender, SFTPServerBeforeOpenClientForwardingEventArgs e); public class SFTPServerBeforeOpenClientForwardingEventArgs : EventArgs { public long ConnectionID { get; } public string DestHost { get; set; } public int DestPort { get; set; } public string SrcHost { get; } public int SrcPort { get; } public int Action { get; set; } }
Public Event OnBeforeOpenClientForwarding As OnBeforeOpenClientForwardingHandler Public Delegate Sub OnBeforeOpenClientForwardingHandler(sender As Object, e As SFTPServerBeforeOpenClientForwardingEventArgs) Public Class SFTPServerBeforeOpenClientForwardingEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public Property DestHost As String Public Property DestPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer Public Property Action As Integer End Class
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
public event OnBeforeOpenCommandHandler OnBeforeOpenCommand; public delegate void OnBeforeOpenCommandHandler(object sender, SFTPServerBeforeOpenCommandEventArgs e); public class SFTPServerBeforeOpenCommandEventArgs : EventArgs { public long ConnectionID { get; } public string Command { get; set; } public int Action { get; set; } }
Public Event OnBeforeOpenCommand As OnBeforeOpenCommandHandler Public Delegate Sub OnBeforeOpenCommandHandler(sender As Object, e As SFTPServerBeforeOpenCommandEventArgs) Public Class SFTPServerBeforeOpenCommandEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public Property Command As String Public Property Action As Integer End Class
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
public event OnBeforeOpenServerForwardingHandler OnBeforeOpenServerForwarding; public delegate void OnBeforeOpenServerForwardingHandler(object sender, SFTPServerBeforeOpenServerForwardingEventArgs e); public class SFTPServerBeforeOpenServerForwardingEventArgs : EventArgs { public long ConnectionID { get; } public string LocalHost { get; } public int LocalPort { get; } public string SrcHost { get; } public int SrcPort { get; } public int Action { get; set; } }
Public Event OnBeforeOpenServerForwarding As OnBeforeOpenServerForwardingHandler Public Delegate Sub OnBeforeOpenServerForwardingHandler(sender As Object, e As SFTPServerBeforeOpenServerForwardingEventArgs) Public Class SFTPServerBeforeOpenServerForwardingEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property LocalHost As String Public ReadOnly Property LocalPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer Public Property Action As Integer End Class
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
public event OnBeforeOpenShellHandler OnBeforeOpenShell; public delegate void OnBeforeOpenShellHandler(object sender, SFTPServerBeforeOpenShellEventArgs e); public class SFTPServerBeforeOpenShellEventArgs : EventArgs { public long ConnectionID { get; } public int Action { get; set; } }
Public Event OnBeforeOpenShell As OnBeforeOpenShellHandler Public Delegate Sub OnBeforeOpenShellHandler(sender As Object, e As SFTPServerBeforeOpenShellEventArgs) Public Class SFTPServerBeforeOpenShellEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public Property Action As Integer End Class
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
public event OnBeforeRemoveHandler OnBeforeRemove; public delegate void OnBeforeRemoveHandler(object sender, SFTPServerBeforeRemoveEventArgs e); public class SFTPServerBeforeRemoveEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeRemove As OnBeforeRemoveHandler Public Delegate Sub OnBeforeRemoveHandler(sender As Object, e As SFTPServerBeforeRemoveEventArgs) Public Class SFTPServerBeforeRemoveEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnBeforeRenameFileHandler OnBeforeRenameFile; public delegate void OnBeforeRenameFileHandler(object sender, SFTPServerBeforeRenameFileEventArgs e); public class SFTPServerBeforeRenameFileEventArgs : EventArgs { public long ConnectionID { get; } public string OldPath { get; } public string NewPath { get; } public int Action { get; set; } }
Public Event OnBeforeRenameFile As OnBeforeRenameFileHandler Public Delegate Sub OnBeforeRenameFileHandler(sender As Object, e As SFTPServerBeforeRenameFileEventArgs) Public Class SFTPServerBeforeRenameFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property OldPath As String Public ReadOnly Property NewPath As String Public Property Action As Integer End Class
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
public event OnBeforeRequestAttributesHandler OnBeforeRequestAttributes; public delegate void OnBeforeRequestAttributesHandler(object sender, SFTPServerBeforeRequestAttributesEventArgs e); public class SFTPServerBeforeRequestAttributesEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeRequestAttributes As OnBeforeRequestAttributesHandler Public Delegate Sub OnBeforeRequestAttributesHandler(sender As Object, e As SFTPServerBeforeRequestAttributesEventArgs) Public Class SFTPServerBeforeRequestAttributesEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnBeforeSetAttributesHandler OnBeforeSetAttributes; public delegate void OnBeforeSetAttributesHandler(object sender, SFTPServerBeforeSetAttributesEventArgs e); public class SFTPServerBeforeSetAttributesEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeSetAttributes As OnBeforeSetAttributesHandler Public Delegate Sub OnBeforeSetAttributesHandler(sender As Object, e As SFTPServerBeforeSetAttributesEventArgs) Public Class SFTPServerBeforeSetAttributesEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnBeforeUploadFileHandler OnBeforeUploadFile; public delegate void OnBeforeUploadFileHandler(object sender, SFTPServerBeforeUploadFileEventArgs e); public class SFTPServerBeforeUploadFileEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Action { get; set; } }
Public Event OnBeforeUploadFile As OnBeforeUploadFileHandler Public Delegate Sub OnBeforeUploadFileHandler(sender As Object, e As SFTPServerBeforeUploadFileEventArgs) Public Class SFTPServerBeforeUploadFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property Action As Integer End Class
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
public event OnCloseClientForwardingHandler OnCloseClientForwarding; public delegate void OnCloseClientForwardingHandler(object sender, SFTPServerCloseClientForwardingEventArgs e); public class SFTPServerCloseClientForwardingEventArgs : EventArgs { public long ConnectionID { get; } public string DestHost { get; } public int DestPort { get; } public string SrcHost { get; } public int SrcPort { get; } }
Public Event OnCloseClientForwarding As OnCloseClientForwardingHandler Public Delegate Sub OnCloseClientForwardingHandler(sender As Object, e As SFTPServerCloseClientForwardingEventArgs) Public Class SFTPServerCloseClientForwardingEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property DestHost As String Public ReadOnly Property DestPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer End Class
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
public event OnCloseCommandHandler OnCloseCommand; public delegate void OnCloseCommandHandler(object sender, SFTPServerCloseCommandEventArgs e); public class SFTPServerCloseCommandEventArgs : EventArgs { public long ConnectionID { get; } public string Command { get; } }
Public Event OnCloseCommand As OnCloseCommandHandler Public Delegate Sub OnCloseCommandHandler(sender As Object, e As SFTPServerCloseCommandEventArgs) Public Class SFTPServerCloseCommandEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Command As String End Class
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
public event OnCloseFileHandler OnCloseFile; public delegate void OnCloseFileHandler(object sender, SFTPServerCloseFileEventArgs e); public class SFTPServerCloseFileEventArgs : EventArgs { public long ConnectionID { get; } public string Handle { get; } public int OperationStatus { get; set; } }
Public Event OnCloseFile As OnCloseFileHandler Public Delegate Sub OnCloseFileHandler(sender As Object, e As SFTPServerCloseFileEventArgs) Public Class SFTPServerCloseFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Handle As String Public Property OperationStatus As Integer End Class
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
public event OnCloseServerForwardingHandler OnCloseServerForwarding; public delegate void OnCloseServerForwardingHandler(object sender, SFTPServerCloseServerForwardingEventArgs e); public class SFTPServerCloseServerForwardingEventArgs : EventArgs { public long ConnectionID { get; } public string LocalHost { get; } public int LocalPort { get; } public string SrcHost { get; } public int SrcPort { get; } }
Public Event OnCloseServerForwarding As OnCloseServerForwardingHandler Public Delegate Sub OnCloseServerForwardingHandler(sender As Object, e As SFTPServerCloseServerForwardingEventArgs) Public Class SFTPServerCloseServerForwardingEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property LocalHost As String Public ReadOnly Property LocalPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer End Class
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
public event OnCloseShellHandler OnCloseShell; public delegate void OnCloseShellHandler(object sender, SFTPServerCloseShellEventArgs e); public class SFTPServerCloseShellEventArgs : EventArgs { public long ConnectionID { get; } }
Public Event OnCloseShell As OnCloseShellHandler Public Delegate Sub OnCloseShellHandler(sender As Object, e As SFTPServerCloseShellEventArgs) Public Class SFTPServerCloseShellEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long End Class
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
public event OnConnectHandler OnConnect; public delegate void OnConnectHandler(object sender, SFTPServerConnectEventArgs e); public class SFTPServerConnectEventArgs : EventArgs { public long ConnectionID { get; } public string RemoteAddress { get; } public int RemotePort { get; } }
Public Event OnConnect As OnConnectHandler Public Delegate Sub OnConnectHandler(sender As Object, e As SFTPServerConnectEventArgs) Public Class SFTPServerConnectEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property RemoteAddress As String Public ReadOnly Property RemotePort As Integer End Class
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
public event OnCreateDirectoryHandler OnCreateDirectory; public delegate void OnCreateDirectoryHandler(object sender, SFTPServerCreateDirectoryEventArgs e); public class SFTPServerCreateDirectoryEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } }
Public Event OnCreateDirectory As OnCreateDirectoryHandler Public Delegate Sub OnCreateDirectoryHandler(sender As Object, e As SFTPServerCreateDirectoryEventArgs) Public Class SFTPServerCreateDirectoryEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer End Class
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
public event OnDisconnectHandler OnDisconnect; public delegate void OnDisconnectHandler(object sender, SFTPServerDisconnectEventArgs e); public class SFTPServerDisconnectEventArgs : EventArgs { public long ConnectionID { get; } }
Public Event OnDisconnect As OnDisconnectHandler Public Delegate Sub OnDisconnectHandler(sender As Object, e As SFTPServerDisconnectEventArgs) Public Class SFTPServerDisconnectEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long End Class
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
public event OnErrorHandler OnError; public delegate void OnErrorHandler(object sender, SFTPServerErrorEventArgs e); public class SFTPServerErrorEventArgs : EventArgs { public long ConnectionID { get; } public int ErrorCode { get; } public bool Fatal { get; } public bool Remote { get; } public string Description { get; } }
Public Event OnError As OnErrorHandler Public Delegate Sub OnErrorHandler(sender As Object, e As SFTPServerErrorEventArgs) Public Class SFTPServerErrorEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property ErrorCode As Integer Public ReadOnly Property Fatal As Boolean Public ReadOnly Property Remote As Boolean Public ReadOnly Property Description As String End Class
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
public event OnExternalSignHandler OnExternalSign; public delegate void OnExternalSignHandler(object sender, SFTPServerExternalSignEventArgs e); public class SFTPServerExternalSignEventArgs : EventArgs { public long ConnectionID { get; } public string OperationId { get; } public string HashAlgorithm { get; } public string Pars { get; } public string Data { get; } public string SignedData { get; set; } }
Public Event OnExternalSign As OnExternalSignHandler Public Delegate Sub OnExternalSignHandler(sender As Object, e As SFTPServerExternalSignEventArgs) Public Class SFTPServerExternalSignEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property OperationId As String Public ReadOnly Property HashAlgorithm As String Public ReadOnly Property Pars As String Public ReadOnly Property Data As String Public Property SignedData As String End Class
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 component via the SignedData parameter.
OperationId provides a comment about the operation and its origin. It depends on the exact component being used, and may be empty. HashAlgorithm specifies the hash algorithm being used for the operation, and Pars contains algorithm-dependent parameters.
The component 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
public event OnFindCloseHandler OnFindClose; public delegate void OnFindCloseHandler(object sender, SFTPServerFindCloseEventArgs e); public class SFTPServerFindCloseEventArgs : EventArgs { public long ConnectionID { get; } public string Handle { get; } public int OperationStatus { get; set; } }
Public Event OnFindClose As OnFindCloseHandler Public Delegate Sub OnFindCloseHandler(sender As Object, e As SFTPServerFindCloseEventArgs) Public Class SFTPServerFindCloseEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Handle As String Public Property OperationStatus As Integer End Class
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
public event OnFindFirstHandler OnFindFirst; public delegate void OnFindFirstHandler(object sender, SFTPServerFindFirstEventArgs e); public class SFTPServerFindFirstEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } public string Handle { get; set; } }
Public Event OnFindFirst As OnFindFirstHandler Public Delegate Sub OnFindFirstHandler(sender As Object, e As SFTPServerFindFirstEventArgs) Public Class SFTPServerFindFirstEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer Public Property Handle As String End Class
Remarks
FindFirst, FindNext, and FindClose events represent a mechanism for providing customized file listings to component. 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
public event OnFindNextHandler OnFindNext; public delegate void OnFindNextHandler(object sender, SFTPServerFindNextEventArgs e); public class SFTPServerFindNextEventArgs : EventArgs { public long ConnectionID { get; } public string Handle { get; } public int OperationStatus { get; set; } }
Public Event OnFindNext As OnFindNextHandler Public Delegate Sub OnFindNextHandler(sender As Object, e As SFTPServerFindNextEventArgs) Public Class SFTPServerFindNextEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Handle As String Public Property OperationStatus As Integer End Class
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
public event OnListeningStartedHandler OnListeningStarted; public delegate void OnListeningStartedHandler(object sender, SFTPServerListeningStartedEventArgs e); public class SFTPServerListeningStartedEventArgs : EventArgs { public string Host { get; } public int Port { get; } }
Public Event OnListeningStarted As OnListeningStartedHandler Public Delegate Sub OnListeningStartedHandler(sender As Object, e As SFTPServerListeningStartedEventArgs) Public Class SFTPServerListeningStartedEventArgs Inherits EventArgs Public ReadOnly Property Host As String Public ReadOnly Property Port As Integer End Class
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
public event OnListeningStoppedHandler OnListeningStopped; public delegate void OnListeningStoppedHandler(object sender, SFTPServerListeningStoppedEventArgs e); public class SFTPServerListeningStoppedEventArgs : EventArgs { public string Host { get; } public int Port { get; } }
Public Event OnListeningStopped As OnListeningStoppedHandler Public Delegate Sub OnListeningStoppedHandler(sender As Object, e As SFTPServerListeningStoppedEventArgs) Public Class SFTPServerListeningStoppedEventArgs Inherits EventArgs Public ReadOnly Property Host As String Public ReadOnly Property Port As Integer End Class
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
public event OnNotificationHandler OnNotification; public delegate void OnNotificationHandler(object sender, SFTPServerNotificationEventArgs e); public class SFTPServerNotificationEventArgs : EventArgs { public string EventID { get; } public string EventParam { get; } }
Public Event OnNotification As OnNotificationHandler Public Delegate Sub OnNotificationHandler(sender As Object, e As SFTPServerNotificationEventArgs) Public Class SFTPServerNotificationEventArgs Inherits EventArgs Public ReadOnly Property EventID As String Public ReadOnly Property EventParam As String End Class
Remarks
The component fires this event to let the application know about some event, occurrence, or milestone in the component. 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 component, the exact action it is performing, or the document being processed, one or both may be omitted.
This component 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
public event OnOpenClientForwardingHandler OnOpenClientForwarding; public delegate void OnOpenClientForwardingHandler(object sender, SFTPServerOpenClientForwardingEventArgs e); public class SFTPServerOpenClientForwardingEventArgs : EventArgs { public long ConnectionID { get; } public string DestHost { get; } public int DestPort { get; } public string SrcHost { get; } public int SrcPort { get; } }
Public Event OnOpenClientForwarding As OnOpenClientForwardingHandler Public Delegate Sub OnOpenClientForwardingHandler(sender As Object, e As SFTPServerOpenClientForwardingEventArgs) Public Class SFTPServerOpenClientForwardingEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property DestHost As String Public ReadOnly Property DestPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer End Class
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
public event OnOpenCommandHandler OnOpenCommand; public delegate void OnOpenCommandHandler(object sender, SFTPServerOpenCommandEventArgs e); public class SFTPServerOpenCommandEventArgs : EventArgs { public long ConnectionID { get; } public string Command { get; } }
Public Event OnOpenCommand As OnOpenCommandHandler Public Delegate Sub OnOpenCommandHandler(sender As Object, e As SFTPServerOpenCommandEventArgs) Public Class SFTPServerOpenCommandEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Command As String End Class
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
public event OnOpenFileHandler OnOpenFile; public delegate void OnOpenFileHandler(object sender, SFTPServerOpenFileEventArgs e); public class SFTPServerOpenFileEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int Modes { get; } public int Access { get; } public int OperationStatus { get; set; } public string Handle { get; set; } }
Public Event OnOpenFile As OnOpenFileHandler Public Delegate Sub OnOpenFileHandler(sender As Object, e As SFTPServerOpenFileEventArgs) Public Class SFTPServerOpenFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public ReadOnly Property Modes As Integer Public ReadOnly Property Access As Integer Public Property OperationStatus As Integer Public Property Handle As String End Class
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. Component 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
public event OnOpenServerForwardingHandler OnOpenServerForwarding; public delegate void OnOpenServerForwardingHandler(object sender, SFTPServerOpenServerForwardingEventArgs e); public class SFTPServerOpenServerForwardingEventArgs : EventArgs { public long ConnectionID { get; } public string LocalHost { get; } public int LocalPort { get; } public string SrcHost { get; } public int SrcPort { get; } }
Public Event OnOpenServerForwarding As OnOpenServerForwardingHandler Public Delegate Sub OnOpenServerForwardingHandler(sender As Object, e As SFTPServerOpenServerForwardingEventArgs) Public Class SFTPServerOpenServerForwardingEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property LocalHost As String Public ReadOnly Property LocalPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer End Class
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
public event OnOpenShellHandler OnOpenShell; public delegate void OnOpenShellHandler(object sender, SFTPServerOpenShellEventArgs e); public class SFTPServerOpenShellEventArgs : EventArgs { public long ConnectionID { get; } }
Public Event OnOpenShell As OnOpenShellHandler Public Delegate Sub OnOpenShellHandler(sender As Object, e As SFTPServerOpenShellEventArgs) Public Class SFTPServerOpenShellEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long End Class
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
public event OnReadFileHandler OnReadFile; public delegate void OnReadFileHandler(object sender, SFTPServerReadFileEventArgs e); public class SFTPServerReadFileEventArgs : EventArgs { public long ConnectionID { get; } public string Handle { get; } public long Offset { get; } public int Size { get; } public int OperationStatus { get; set; } }
Public Event OnReadFile As OnReadFileHandler Public Delegate Sub OnReadFileHandler(sender As Object, e As SFTPServerReadFileEventArgs) Public Class SFTPServerReadFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Handle As String Public ReadOnly Property Offset As Long Public ReadOnly Property Size As Integer Public Property OperationStatus As Integer End Class
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
public event OnRemoveHandler OnRemove; public delegate void OnRemoveHandler(object sender, SFTPServerRemoveEventArgs e); public class SFTPServerRemoveEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public int OperationStatus { get; set; } }
Public Event OnRemove As OnRemoveHandler Public Delegate Sub OnRemoveHandler(sender As Object, e As SFTPServerRemoveEventArgs) Public Class SFTPServerRemoveEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property OperationStatus As Integer End Class
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
public event OnRenameFileHandler OnRenameFile; public delegate void OnRenameFileHandler(object sender, SFTPServerRenameFileEventArgs e); public class SFTPServerRenameFileEventArgs : EventArgs { public long ConnectionID { get; } public string OldPath { get; } public string NewPath { get; } public int OperationStatus { get; set; } }
Public Event OnRenameFile As OnRenameFileHandler Public Delegate Sub OnRenameFileHandler(sender As Object, e As SFTPServerRenameFileEventArgs) Public Class SFTPServerRenameFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property OldPath As String Public ReadOnly Property NewPath As String Public Property OperationStatus As Integer End Class
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
public event OnRequestAttributesHandler OnRequestAttributes; public delegate void OnRequestAttributesHandler(object sender, SFTPServerRequestAttributesEventArgs e); public class SFTPServerRequestAttributesEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public string Handle { get; } public int OperationStatus { get; set; } }
Public Event OnRequestAttributes As OnRequestAttributesHandler Public Delegate Sub OnRequestAttributesHandler(sender As Object, e As SFTPServerRequestAttributesEventArgs) Public Class SFTPServerRequestAttributesEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public ReadOnly Property Handle As String Public Property OperationStatus As Integer End Class
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
public event OnServerForwardingCancelHandler OnServerForwardingCancel; public delegate void OnServerForwardingCancelHandler(object sender, SFTPServerServerForwardingCancelEventArgs e); public class SFTPServerServerForwardingCancelEventArgs : EventArgs { public long ConnectionID { get; } public string LocalHost { get; } public int LocalPort { get; } }
Public Event OnServerForwardingCancel As OnServerForwardingCancelHandler Public Delegate Sub OnServerForwardingCancelHandler(sender As Object, e As SFTPServerServerForwardingCancelEventArgs) Public Class SFTPServerServerForwardingCancelEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property LocalHost As String Public ReadOnly Property LocalPort As Integer End Class
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
public event OnServerForwardingOpenFailedHandler OnServerForwardingOpenFailed; public delegate void OnServerForwardingOpenFailedHandler(object sender, SFTPServerServerForwardingOpenFailedEventArgs e); public class SFTPServerServerForwardingOpenFailedEventArgs : EventArgs { public long ConnectionID { get; } public string LocalHost { get; } public int LocalPort { get; } public string SrcHost { get; } public int SrcPort { get; } }
Public Event OnServerForwardingOpenFailed As OnServerForwardingOpenFailedHandler Public Delegate Sub OnServerForwardingOpenFailedHandler(sender As Object, e As SFTPServerServerForwardingOpenFailedEventArgs) Public Class SFTPServerServerForwardingOpenFailedEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property LocalHost As String Public ReadOnly Property LocalPort As Integer Public ReadOnly Property SrcHost As String Public ReadOnly Property SrcPort As Integer End Class
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
public event OnServerForwardingRequestHandler OnServerForwardingRequest; public delegate void OnServerForwardingRequestHandler(object sender, SFTPServerServerForwardingRequestEventArgs e); public class SFTPServerServerForwardingRequestEventArgs : EventArgs { public long ConnectionID { get; } public string LocalHost { get; } public int LocalPort { get; set; } public int Action { get; set; } }
Public Event OnServerForwardingRequest As OnServerForwardingRequestHandler Public Delegate Sub OnServerForwardingRequestHandler(sender As Object, e As SFTPServerServerForwardingRequestEventArgs) Public Class SFTPServerServerForwardingRequestEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property LocalHost As String Public Property LocalPort As Integer Public Property Action As Integer End Class
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
public event OnSessionClosedHandler OnSessionClosed; public delegate void OnSessionClosedHandler(object sender, SFTPServerSessionClosedEventArgs e); public class SFTPServerSessionClosedEventArgs : EventArgs { public long ConnectionID { get; } }
Public Event OnSessionClosed As OnSessionClosedHandler Public Delegate Sub OnSessionClosedHandler(sender As Object, e As SFTPServerSessionClosedEventArgs) Public Class SFTPServerSessionClosedEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long End Class
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
public event OnSessionEstablishedHandler OnSessionEstablished; public delegate void OnSessionEstablishedHandler(object sender, SFTPServerSessionEstablishedEventArgs e); public class SFTPServerSessionEstablishedEventArgs : EventArgs { public long ConnectionID { get; } }
Public Event OnSessionEstablished As OnSessionEstablishedHandler Public Delegate Sub OnSessionEstablishedHandler(sender As Object, e As SFTPServerSessionEstablishedEventArgs) Public Class SFTPServerSessionEstablishedEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long End Class
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
public event OnSetAttributesHandler OnSetAttributes; public delegate void OnSetAttributesHandler(object sender, SFTPServerSetAttributesEventArgs e); public class SFTPServerSetAttributesEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public string Handle { get; } public int OperationStatus { get; set; } }
Public Event OnSetAttributes As OnSetAttributesHandler Public Delegate Sub OnSetAttributesHandler(sender As Object, e As SFTPServerSetAttributesEventArgs) Public Class SFTPServerSetAttributesEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public ReadOnly Property Handle As String Public Property OperationStatus As Integer End Class
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
public event OnTranslatePathHandler OnTranslatePath; public delegate void OnTranslatePathHandler(object sender, SFTPServerTranslatePathEventArgs e); public class SFTPServerTranslatePathEventArgs : EventArgs { public long ConnectionID { get; } public string Path { get; } public string AbsolutePath { get; set; } public int Action { get; set; } }
Public Event OnTranslatePath As OnTranslatePathHandler Public Delegate Sub OnTranslatePathHandler(sender As Object, e As SFTPServerTranslatePathEventArgs) Public Class SFTPServerTranslatePathEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Path As String Public Property AbsolutePath As String Public Property Action As Integer End Class
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
public event OnWriteFileHandler OnWriteFile; public delegate void OnWriteFileHandler(object sender, SFTPServerWriteFileEventArgs e); public class SFTPServerWriteFileEventArgs : EventArgs { public long ConnectionID { get; } public string Handle { get; } public long Offset { get; } public int OperationStatus { get; set; } }
Public Event OnWriteFile As OnWriteFileHandler Public Delegate Sub OnWriteFileHandler(sender As Object, e As SFTPServerWriteFileEventArgs) Public Class SFTPServerWriteFileEventArgs Inherits EventArgs Public ReadOnly Property ConnectionID As Long Public ReadOnly Property Handle As String Public ReadOnly Property Offset As Long Public Property OperationStatus As Integer End Class
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 |
ExternalCrypto Type
Specifies the parameters of external cryptographic calls.
Remarks
External cryptocalls are used in a Distributed Cryptography (DC) subsystem, which allows the delegation of security operations to the remote agent. For instance, it can be used to compute the signature value on the server, while retaining the client's private key locally.
Fields
AsyncDocumentID
string
Default: ""
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.
CustomParams
string
Default: ""
Custom parameters to be passed to the signing service (uninterpreted).
Data
string
Default: ""
Additional data to be included in the async state and mirrored back by the requestor.
ExternalHashCalculation
bool
Default: False
Specifies whether the message hash is to be calculated at the external endpoint. Please note that this mode is not supported by the DCAuth component.
If set to true, the component will pass a few kilobytes of to-be-signed data from the document to the OnExternalSign event. This only applies when SignExternal() is called.
HashAlgorithm
string
Default: "SHA256"
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 |
KeyID
string
Default: ""
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 KeySecret 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";
KeySecret
string
Default: ""
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 KeyID topic.
Method
AsyncSignMethods
Default: 0
Specifies the asynchronous signing method. This is typically defined by the DC server capabilities and setup.
Available options:
asmdPKCS1 | 0 |
asmdPKCS7 | 1 |
Mode
ExternalCryptoModes
Default: 0
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) |
PublicKeyAlgorithm
string
Default: ""
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 |
Constructors
public ExternalCrypto();
Public ExternalCrypto()
Creates a new ExternalCrypto object with default field values.
FTPListEntry Type
Represents a basic container for the remote file details.
Remarks
The component represents the details of a file entry returned by the FTP server.
Fields
AccessTime
string
Default: ""
Contains the last access time for this file, in UTC.
CreationTime
string
Default: ""
Contains this file's creation time, in UTC.
EntryFormat
FTPFileFormats
Default: 0
The file listing format:
cfefUnknown | 0 |
cfefUnix | 1 |
cfefWindows | 2 |
cfefMLSD | 3 |
FileType
FTPFileTypes
Default: 0
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 |
ModificationTime
string
Default: ""
File last modification date/time.
Name
string
Default: ""
The file or directory name.
Path
string
Default: ""
The full path to the file or directory.
Principal
string
Default: ""
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.
Size
long
Default: 0
File size in bytes.
UnixPerms
int
Default: 511
The file Unix permissions bit mask (e.g. rwxrwxrwx=511 (0777); rwxr--r--=484 (0744)).
UnparsedName
string
Default: ""
The unparsed entry as returned by the server. Sometimes this is also known as "long name".
Constructors
public FTPListEntry();
Public FTPListEntry()
Creates a new FTPListEntry object.
SocketSettings Type
A container for the socket settings.
Remarks
This type is a container for socket-layer parameters.
Fields
DNSMode
DNSResolveModes
Default: 0
Selects the DNS resolver to use: the component's (secure) built-in one, or the one provided by the system.
dmAuto | 0 |
dmPlatform | 1 |
dmOwn | 2 |
dmOwnSecure | 3 |
DNSPort
int
Default: 0
Specifies the port number to be used for sending queries to the DNS server.
DNSQueryTimeout
int
Default: 0
The timeout (in milliseconds) for each DNS query. The value of 0 indicates an infinite timeout.
DNSServers
string
Default: ""
The addresses of DNS servers to use for address resolution, separated by commas or semicolons.
DNSTotalTimeout
int
Default: 0
The timeout (in milliseconds) for the whole resolution process. The value of 0 indicates an infinite timeout.
IncomingSpeedLimit
int
Default: 0
The maximum number of bytes to read from the socket, per second.
LocalAddress
string
Default: ""
The local network interface to bind the socket to.
LocalPort
int
Default: 0
The local port number to bind the socket to.
OutgoingSpeedLimit
int
Default: 0
The maximum number of bytes to write to the socket, per second.
Timeout
int
Default: 60000
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).
UseIPv6
bool
Default: False
Enables or disables IP protocol version 6.
Constructors
public SocketSettings();
Public SocketSettings()
Creates a new SocketSettings object.
SSHConnectionInfo Type
Contains information about SSH connection.
Remarks
SSHConnectionInfo object contains information about one SSH connection.
Fields
ClientKeyAlgorithm
string (read-only)
Default: ""
Specifies the client's key algorithm.
ClientKeyBits
int (read-only)
Default: 0
Specifies the length of the client's key.
ClientKeyFingerprint
string (read-only)
Default: ""
The fingerprint (hash value) of the client's public key.
CloseReason
string (read-only)
Default: ""
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.
CompressionAlgorithmInbound
string (read-only)
Default: ""
Compression algorithm for the incoming traffic.
CompressionAlgorithmOutbound
string (read-only)
Default: ""
Compression algorithm for the outgoing traffic.
EncryptionAlgorithmInbound
string (read-only)
Default: ""
Encryption algorithm for the incoming traffic.
EncryptionAlgorithmOutbound
string (read-only)
Default: ""
Encryption algorithm for the outgoing traffic.
InboundEncryptionKeyBits
int (read-only)
Default: 0
Specifies the length of the key used to encrypt the incoming traffic.
KexAlgorithm
string (read-only)
Default: ""
The key exchange algorithm used during the SSH handshake.
KexBits
int (read-only)
Default: 0
The number of bits used by the key exchange algorithm.
KexLines
string (read-only)
Default: ""
The contents of the received KexInit packet.
KexInit packet contains the list of algorithms supported by the remote party.
MacAlgorithmInbound
string (read-only)
Default: ""
MAC algorithm used for the incoming connection.
MacAlgorithmOutbound
string (read-only)
Default: ""
MAC algorithm used for outbound connection.
OutboundEncryptionKeyBits
int (read-only)
Default: 0
Specifies the length of the key used to encrypt the outgoing traffic.
PublicKeyAlgorithm
string (read-only)
Default: ""
Specifies the public key algorithm which was used during the SSH handshake.
RemoteAddress
string (read-only)
Default: ""
The client's IP address.
RemotePort
int (read-only)
Default: 0
The remote port of the client connection.
ServerKeyAlgorithm
string (read-only)
Default: ""
Specifies the server's key algorithm.
ServerKeyBits
int (read-only)
Default: 0
Specifies the number of bits in the server's key.
ServerKeyFingerprint
string (read-only)
Default: ""
The fingerprint (hash value) of the server's public key.
ServerSoftwareName
string (read-only)
Default: ""
Returns the name of the SSH software running on the server side.
TotalBytesReceived
long (read-only)
Default: 0
Returns the total number of bytes received over this connection.
TotalBytesSent
long (read-only)
Default: 0
Returns the total number of bytes sent over this connection.
Version
int (read-only)
Default: 2
Specifies SSH protocol version.
Constructors
public SSHConnectionInfo();
Public SSHConnectionInfo()
Creates an empty object representing a SSH connection info.
SSHKey Type
SSHKey is used to store information about single compound public-key algorithm (such as RSA or DSA) key.
Remarks
SSH keys are used to secure the SSH protocol flow. They support different algorithms and key lengths, a very typical example being RSA-2048 bits.
Fields
Algorithm
string (read-only)
Default: ""
Specifies the key algorithm.
Bits
int (read-only)
Default: 0
The number of bits in the key: the more the better, 2048 or 4096 are typical values.
Comment
string
Default: ""
The comment for the public key.
Curve
string (read-only)
Default: ""
Specifies the elliptical curve when EC cryptography is used.
DSSG
byte[] (read-only)
Default: ""
The G (Generator) parameter of the DSS signature key. The string should contain the binary data of G.
DSSP
byte[] (read-only)
Default: ""
The P (Prime) parameter of the DSS signature key. The string should contain the binary data of P.
DSSQ
byte[] (read-only)
Default: ""
The Q (Prime Factor) parameter of the DSS signature key. The string should contain the binary data of Q.
DSSX
byte[] (read-only)
Default: ""
The X (Private key) parameter of the DSS signature key. The string should contain the binary data of X.
This parameter may be empty if there's no need to sign data with this key (e.g. if the key is a server public key needed only to authenticate the server).
DSSY
byte[] (read-only)
Default: ""
The Y (Public key) parameter of the DSS signature key. The string should contain the binary data of Y.
ECCD
byte[] (read-only)
Default: ""
The value of the secret key (the order of the public key, D) if elliptic curve (EC) cryptography is used. The string should contain the binary data of D.
ECCQX
byte[] (read-only)
Default: ""
The value of the X coordinate of the public key if elliptic curve (EC) cryptography is used. The string should contain the binary data of X.
ECCQY
byte[] (read-only)
Default: ""
The value of the Y coordinate of the public key if elliptic curve (EC) cryptography is used. The string should contain the binary data of Y.
EdPrivate
byte[] (read-only)
Default: ""
The value of the private key if EdDSA (Edwards-curve Digital Signature Algorithm) algorithm is used.
EdPublic
byte[] (read-only)
Default: ""
The value of the public key if EdDSA (Edwards-curve Digital Signature Algorithm) algorithm is used.
FingerprintMD5
string (read-only)
Default: ""
Contains the MD5 fingerprint (hash) of the key.
FingerprintSHA1
string (read-only)
Default: ""
Contains the SHA-1 fingerprint (hash) of the key.
FingerprintSHA256
string (read-only)
Default: ""
Contains the SHA-256 fingerprint (hash) of the key.
IsExtractable
bool (read-only)
Default: False
Whether the key is extractable (e.g., from a security token), or not.
IsPrivate
bool (read-only)
Default: False
Whether this key is a private key or not.
IsPublic
bool (read-only)
Default: False
Whether this key is a public key or not.
KDFRounds
int (read-only)
Default: 0
Returns the number of iterations of the Key Derivation Function (KDF) used to generate this key.
KDFSalt
byte[] (read-only)
Default: ""
The salt value used by the Key Derivation Function (KDF) to generate this key.
KeyFormat
SSHKeyFormats (read-only)
Default: 0
Specifies the format in which the key is stored.
ckfOpenSSH | 0 | |
ckfOpenSSH2 | 1 | |
ckfIETF | 2 | |
ckfPuTTY | 3 | |
ckfX509 | 4 | |
ckfBinary | 5 | |
ckfSSH1 | 6 | |
ckfPGP | 7 | |
ckfPKCS8 | 8 | |
ckfPuTTY3 | 9 |
KeyProtectionAlgorithm
string (read-only)
Default: ""
Specifies the key protection algorithm.
RSAExponent
byte[] (read-only)
Default: ""
Returns the e parameter (public exponent) of the RSA key.
RSAIQMP
byte[] (read-only)
Default: ""
Returns the iqmp parameter of the RSA key.
RSAModulus
byte[] (read-only)
Default: ""
Returns the m parameter (public modulus) of the RSA key.
RSAP
byte[] (read-only)
Default: ""
Returns the p parameter (first factor of the common modulus n) of the RSA key.
RSAPrivateExponent
byte[] (read-only)
Default: ""
Returns the d parameter (private exponent) of the RSA key.
RSAQ
byte[] (read-only)
Default: ""
Returns the q parameter (second factor of the common modulus n) of the RSA key.
Subject
string
Default: ""
Specifies the public key owner (subject). This property is used only for IETF-keys.
Constructors
Loads private key from the Bytes buffer. Parameters StartIndex and Count specify the starting index of the key data and its length, correspondingly. Provide a Password to decrypt the key.
Loads public key from the Bytes buffer. Parameters StartIndex and Count specify the starting index of the key data and its length, correspondingly.
public SSHKey(System.IO.Stream stream, string password);
Public SSHKey(ByVal Stream As System.IO.Stream, ByVal Password As String)
Loads private key from the stream. Provide a Password to decrypt the key.
public SSHKey(System.IO.Stream stream);
Public SSHKey(ByVal Stream As System.IO.Stream)
Loads public key from the stream.
Loads private key from the file. Provide a Path to the file and Password to decrypt the key.
Loads public key from the file specified by Path .
Creates a new key.
SSHSettings Type
A container for various SSH protocol settings.
Remarks
SSHSettings stores various settings of SSH client or server.
Fields
AutoAdjustCiphers
bool
Default: True
Whether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.
BaseConfiguration
SecureTransportPredefinedConfigurations
Default: 0
Allows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
CompressionAlgorithms
string
Default: ""
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
CompressionLevel
int
Default: 6
Possible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression). This setting is ignored if compression wasn't accepted.
DefaultWindowSize
int
Default: 2048000
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.
EncryptionAlgorithms
string
Default: ""
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
ForceCompression
bool
Default: False
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.
ForwardAuthAgent
bool
Default: False
Enables or disables auth agent forwarding. This allows the component to connect to the second and subsequent servers in the chain with the key agent available on the client computer.
GSSAuthTypes
string
Default: ""
A comma-separated list of authentication types. Two types are currently supported: gssapi-with-mic and gssapi-keyex.
GSSDelegateCreds
bool
Default: False
Switches credential delegation on or off.
GSSHostname
string
Default: ""
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).
GSSLib
string
Default: ""
A path to the GSS-API library (DLL or SO).
GSSMechanisms
string
Default: ""
A comma-separated list of GSS mechanisms to use. Two values are currently supported: lib and SSPI.
GSSProtocols
string
Default: ""
A comma-separated list of SSPI protocols. Two protocols are currently supported: kerberos and NTLM.
HandshakeTimeout
int
Default: 45
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.
KexAlgorithms
string
Default: ""
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
MacAlgorithms
string
Default: ""
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
MaxSSHPacketSize
int
Default: 262144
Specifies the maximum length of one SSH packet in bytes.
MinWindowSize
int
Default: 2048
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.
ObfuscateHandshake
bool
Default: False
Enables or disables handshake obfuscation.
ObfuscationPassword
string
Default: ""
Specifies the password used to encrypt the handshake when ObfuscateHandshake is set.
PublicKeyAlgorithms
string
Default: ""
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
RequestPasswordChange
bool
Default: False
Whether to request a password change when connecting.
SoftwareName
string
Default: "SecureBlackbox"
The name to be used by the component to identify itself.
TrustAllKeys
bool
Default: False
Enables or disables explicit trust to all server keys. Use with care.
UseAuthAgent
bool
Default: False
Enables or disables the use of external key agent, such as Putty key agent.
Versions
int
Default: 1
Specifies enabled SSH protocol versions (1 or 2).
Constructors
public SSHSettings();
Public SSHSettings()
Creates a new object with default settings.
UserAccount Type
A container for user account information.
Remarks
UserAccount objects are used to store user account information, such as logins and passwords.
Fields
AssociatedData
byte[]
Default: ""
Contains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
BasePath
string
Default: ""
Base path for this user in the server's file system.
Certificate
byte[]
Default: ""
Contains the user's certificate.
Data
string
Default: ""
Contains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
Email
string
Default: ""
The user's email address.
HashAlgorithm
string
Default: ""
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 |
IncomingSpeedLimit
int
Default: 0
Specifies the incoming speed limit for this user. The value of 0 (zero) means "no limitation".
OtpAlgorithm
OTPAlgorithms
Default: 0
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 |
OTPLen
int
Default: 0
Specifies the length of the user's OTP password.
OtpValue
int
Default: 0
The user's time interval (TOTP) or Counter (HOTP).
OutgoingSpeedLimit
int
Default: 0
Specifies the outgoing speed limit for this user. The value of 0 (zero) means "no limitation".
Password
string
Default: ""
The user's authentication password.
SharedSecret
byte[]
Default: ""
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.
SSHKey
byte[]
Default: ""
Contains the user's SSH key.
Username
string
Default: ""
The registered name (login) of the user.
Constructors
public UserAccount();
Public UserAccount()
Creates a new UserAccount object
Config Settings (SFTPServer Component)
The component 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 component, 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 component 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 component. |
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 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 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.
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) |