Session.ScanFingerprint Method

Scans a fingerprint of SSH server public key (host key) or FTPS/WebDAVS/S3 TLS certificate.



public string ScanFingerprint(
    SessionOptions sessionOptions,
    string algorithm
Public Function ScanFingerprint(
    sessionOptions As SessionOptions,
    algorithm As String
) As String


Name Description
SessionOptions sessionOptions Defines a server to scan the fingerprint of.
The Protocol property must be Protocol.Sftp or Protocol.Scp, or Protocol.Ftp with FtpSecure being FtpSecure.Implicit or FtpSecure.Explicit, or Protocol.Webdav or Protocol.S3 with Secure being true (default for S3). Other than that only the HostName needs to be set. The PortNumber, Timeout and few raw session settings can be set, if necessary. The other properties are ignored.
string algorithm Fingerprint algorithm to use.
The recommended algorithm is SHA-256. You can also use obsolete MD5 for SSH (SFTP and SCP protocols) and SHA-1 for TLS/SSL (FTPS, WebDAVS and S3).

Return Value

A fingerprint of the SSH server public key (hostkey) for SFTP and SCP protocols. A fingerprint of server’s TLS certificate for FTPS, WebDAVS and S3 protocols.


Exception Condition
InvalidOperationException Session is already opened.
Invalid combination of values of SessionOptions properties.
SessionLocalException Error communicating with
See the exception documentation for details.
SessionRemoteException Connection has failed.
See the exception documentation for details.
TimeoutException Timeout waiting for to respond.



Real-Life Examples

Last modified: by martin