libssh2
1.\" Copyright (C) The libssh2 project and its contributors.
2.\" SPDX-License-Identifier: BSD-3-Clause
3.TH libssh2_hostkey_hash 3 "1 Jun 2007" "libssh2 0.15" "libssh2"
4.SH NAME
5libssh2_hostkey_hash - return a hash of the remote host's key
6.SH SYNOPSIS
7.nf
8#include <libssh2.h>
9
10const char *
11libssh2_hostkey_hash(LIBSSH2_SESSION *session, int hash_type);
12.fi
13.SH DESCRIPTION
14\fIsession\fP - Session instance as returned by
15.BR libssh2_session_init_ex(3)
16
17\fIhash_type\fP - One of: \fBLIBSSH2_HOSTKEY_HASH_MD5\fP,
18\fBLIBSSH2_HOSTKEY_HASH_SHA1\fP or \fBLIBSSH2_HOSTKEY_HASH_SHA256\fP.
19
20Returns the computed digest of the remote system's hostkey. The length of
21the returned string is hash_type specific (e.g. 16 bytes for MD5,
2220 bytes for SHA1, 32 bytes for SHA256).
23.SH RETURN VALUE
24Computed hostkey hash value, or NULL if the information is not available
25(either the session has not yet been started up, or the requested hash
26algorithm was not available). The hash consists of raw binary bytes, not hex
27digits, so it is not directly printable.
28.SH SEE ALSO
29.BR libssh2_session_init_ex(3)
30