From 2d34e43c8c37fa153927f1aae78032da5ab176a8 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Thu, 3 Nov 2016 13:18:59 +0100 Subject: public_key: ssh host key fingerprint generator added --- lib/public_key/doc/src/public_key.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'lib/public_key/doc') diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml index 385604677c..edebfe0f84 100644 --- a/lib/public_key/doc/src/public_key.xml +++ b/lib/public_key/doc/src/public_key.xml @@ -821,6 +821,36 @@ fun(#'DistributionPoint'{}, #'CertificateList'{}, + + ssh_hostkey_fingerprint(HostKey) -> string() + ssh_hostkey_fingerprint(DigestType, HostKey) -> string() + Calculates a ssh fingerprint for a hostkey. + + Key = public_key() + DigestType = digest_type() + + +

Calculates a ssh fingerprint from a public host key as openssh does.

+

The algorithm in ssh_hostkey_fingerprint/1 is md5 to be compatible with older + ssh-keygen commands. The string from the second variant is prepended by the algorithm name + in uppercase as in newer ssh-keygen commands.

+

Examples:

+ + 2> public_key:ssh_hostkey_fingerprint(Key). + "f5:64:a6:c1:5a:cb:9f:0a:10:46:a2:5c:3e:2f:57:84" + + 3> public_key:ssh_hostkey_fingerprint(md5,Key). + "MD5:f5:64:a6:c1:5a:cb:9f:0a:10:46:a2:5c:3e:2f:57:84" + + 4> public_key:ssh_hostkey_fingerprint(sha,Key). + "SHA1:bSLY/C4QXLDL/Iwmhyg0PGW9UbY" + + 5> public_key:ssh_hostkey_fingerprint(sha256,Key). + "SHA256:aZGXhabfbf4oxglxltItWeHU7ub3Dc31NcNw2cMJePQ" + +
+
+ verify(Msg, DigestType, Signature, Key) -> boolean() Verifies a digital signature. -- cgit v1.2.3