Session.ScanFingerprint Method
Scans a fingerprint of SSH server public key (host key) or FTPS/WebDAVS/S3 TLS certificate.
Advertisement
Syntax
C#
      public string ScanFingerprint( SessionOptions sessionOptions, string algorithm )
VB.NET
      Public Function ScanFingerprint( sessionOptions As SessionOptions, algorithm As String ) As String
Parameters
| Name | Description | 
|---|---|
| SessionOptions sessionOptions | Defines a server to scan the fingerprint of. The Protocolproperty must beProtocol.SftporProtocol.Scp, orProtocol.FtpwithFtpSecurebeingFtpSecure.ImplicitorFtpSecure.Explicit, orProtocol.WebdavorProtocol.S3withSecurebeing true (default forS3). Other than that only theHostNameneeds to be set. ThePortNumber,Timeoutand 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 obsoleteMD5for SSH (SFTP and SCP protocols) andSHA-1for 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.
Exceptions
| Exception | Condition | 
|---|---|
| InvalidOperationException | Session is already opened. | 
| ArgumentException ArgumentOutOfRangeException | Invalid combination of values of SessionOptionsproperties. | 
| SessionLocalException | Error communicating with winscp.com.See the exception documentation for details. | 
| SessionRemoteException | Connection has failed. See the exception documentation for details. | 
| TimeoutException | Timeout waiting for winscp.comto respond. | 
Advertisement