summaryrefslogtreecommitdiff
path: root/doc/api-keys.texi
diff options
context:
space:
mode:
authorArtyom Poptsov <poptsov.artyom@gmail.com>2014-05-31 18:10:08 +0400
committerArtyom Poptsov <poptsov.artyom@gmail.com>2014-05-31 18:10:08 +0400
commit20184b7c861e1aaa6567ba74063c61cc05c6c7ce (patch)
tree0844dbb1b5d7dc99aacce3163d675f2bf2b825da /doc/api-keys.texi
parentMerge branch 'master' into libssh06 (diff)
downloadguile-ssh-20184b7c861e1aaa6567ba74063c61cc05c6c7ce.tar.gz
Use new libssh 0.6 API for handling of public key fingerprints
Use new libssh 0.6 API for handling of public key fingerprints. Update TCs and documentation. * examples/sssh.scm.in (main): Update. * examples/echo/client.scm.in (main): Update. * ssh/session-func.c (guile_ssh_get_server_public_key): New procedure. (guile_ssh_get_public_key_hash): Change arguments. Move to `ssh/key-func.c'. All callers updated. * ssh/session.scm (bytevector->hex-string): Move to `ssh/key.scm'. (get-server-public-key): New procedure. * ssh/key-func.c (guile_ssh_get_public_key_hash): New procedure. * ssh/key.scm (get-public-key-hash, bytevector->hex-string): New procedures. * tests/client-server.scm ("get-public-key-hash"): Check md5 and sha1 fingerprints. * doc/api-sessions.texi (Sessions): Add documentation for `get-server-public-key'. Move `get-public-key-hash', `bytevector->hex-string' to `doc/api-keys.texi'. * doc/api-keys.texi (Keys): Update. * NEWS: Update.
Diffstat (limited to 'doc/api-keys.texi')
-rw-r--r--doc/api-keys.texi36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/api-keys.texi b/doc/api-keys.texi
index 62f9ccf..c3e1580 100644
--- a/doc/api-keys.texi
+++ b/doc/api-keys.texi
@@ -52,6 +52,42 @@ Get a symbol that represents the type of the Guile-SSH @var{key}.
Possible types are: @code{dss}, @code{rsa}, @code{rsa1}, @code{unknown}.
@end deffn
+@deffn {Scheme Procedure} get-public-key-hash public-key type
+@cindex fingerprint
+@tindex fingerprint
+Get a @var{public-key} hash of @var{type} as a bytevector. Return the
+bytevector on success, @code{#f} on error.
+
+See also @code{get-server-public-key} in @pxref{Sessions}.
+
+The @var{type} can be one of the following symbols: @code{md5},
+@code{sha1}.
+
+Example:
+
+@lisp
+(let ((pubkey (get-server-public-key session)))
+ (get-public-key-hash pubkey 'md5))
+@result{} #vu8(15 142 110 203 162 228 250 211 20 212 26 217 118 57 217 66)
+@end lisp
+
+@end deffn
+
+@deffn {Scheme Procedure} bytevector->hex-string bv
+@cindex fingerprint
+@tindex fingerprint
+Convert the given bytevector @var{bv} to a colon separated string.
+
+Example:
+
+@lisp
+(let ((hash (get-public-key-hash pubkey 'md5)))
+ (bytevector->hex-string hash))
+@result{} "0f:8e:6e:cb:a2:e4:fa:d3:14:d4:1a:d9:76:39:d9:42"
+@end lisp
+
+@end deffn
+
@c Local Variables:
@c TeX-master: "guile-ssh.texi"
@c End: