Sample code for 30+ languages & platforms
Visual FoxPro

SSH Key Fingerprint

See more SSH Key Examples

Generates a fingerprint for an SSH key.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loKey
LOCAL lcKeyStr
LOCAL lcFingerprint

lnSuccess = 0

loKey = CreateObject('Chilkat.SshKey')

* Load an SSH key from an encrypted OpenSSH-formatted private key:
loKey.Password = "secret"

* First load the PEM into a string:
lcKeyStr = loKey.LoadText("privkey_openssh_encrypted.pem")

* Import into the SSH key object:
lnSuccess = loKey.FromOpenSshPrivateKey(lcKeyStr)
IF (lnSuccess <> 1) THEN
    ? loKey.LastErrorText
    RELEASE loKey
    CANCEL
ENDIF

* Generate the fingerprint:

lcFingerprint = loKey.GenFingerprint()

? lcFingerprint

* A sample fingerpring looks like this:
* ssh-dss 2048 d0:5f:f7:d6:49:60:7b:50:19:f4:41:59:d4:1f:61:7

RELEASE loKey