edgeport - v1.0.6
    Preparing search index...

    Function fingerprint

    • Computes the OpenSSH SHA-256 fingerprint of a raw SSH key blob.

      This is the SHA256:... form that ssh-keygen -l prints and that servers advertise for host-key pinning: the base64 (standard alphabet, no = padding) of the SHA-256 digest of the wire-encoded key. Pass the raw key bytes a HostKeyVerifier receives to derive a stable fingerprint to compare against a trusted value (trust-on-first-use, then pin).

      Parameters

      Returns Promise<string>

      The fingerprint string, e.g. SHA256:n3b0K... (43 base64 chars after the prefix).

      1.0.4

      import { connect, fingerprint } from 'edgeport/ssh';

      const session = await connect({
      hostname: 'box',
      username: 'u',
      password: pw,
      hostKey: {
      async verify(_type, key) {
      const fp = await fingerprint(key);
      return fp === trustedFingerprint; // pin against a stored value
      }
      }
      });