Description

Returns fingerprint of the private key, as byte array.


Property type

A Variant value.  


Syntax

object.FingerPrintData(KeyType, [DigestType])



The FingerPrintData Property syntax has these parts:

Part Description
object An expression evaluating to an object of type SSHKeyPair.
KeyType Required. A SSHKeyTypes enumeration, as described in settings. Type of the key (RSA or DSA).
DigestType Optional. A Variant value. Type of digest algorithm (MD5 or SHA1).

Settings

The settings for KeyType are:

Constant Value Description
 RSAkey 0 Uses RSA cipher to create keys.
 DSAkey 1 Uses DSA cipher to create keys.

Remarks

FingerPrint method will return byte array in a length of 16-20 bytes, that hold (almost) unique fingerprint for the requested key.

Fingerprints are used when there is a need to determine if some keys match. Since keys can be pretty large, checking if some keys match is pretty hard to do. Therefore when client wants to be sure of server's identity, it can connect to the server, check server's fingerprint information, and check if it matches with locally stored value. If client is connecting for the first time then there's no way of checking for stored values, so the client must decide whether he will trust received key or not. Client can ask server's maintainer (through some private channel, like telephone for example) to send fingerprint information about some key and then on each connection test if it matches received key. 20 byte fingerprint is much easier to test than few hundreds bytes that are actually contained in each key. Digest algorithms MD5 or SHA1 are used to calculate 16/20 byte fingerprint which is different for each key.

You can use this method to read fingerprint information for some key, and you can, for example, publicly announce it on your webpage or similar place , so users that connect can be sure that they are connecting to proper server and no one is tampering on your connection.

Instead of byte array expression, you can read fingerprint data also as a String, using FingerPrint method.