libssh2

Форк
0
/
libssh2_knownhost_check.3 
60 строк · 2.2 Кб
1
.\" Copyright (C) Daniel Stenberg
2
.\" SPDX-License-Identifier: BSD-3-Clause
3
.TH libssh2_knownhost_check 3 "28 May 2009" "libssh2" "libssh2"
4
.SH NAME
5
libssh2_knownhost_check - check a host+key against the list of known hosts
6
.SH SYNOPSIS
7
.nf
8
#include <libssh2.h>
9

10
int
11
libssh2_knownhost_check(LIBSSH2_KNOWNHOSTS *hosts,
12
                        const char *host,
13
                        const char *key, size_t keylen,
14
                        int typemask,
15
                        struct libssh2_knownhost **knownhost);
16
.fi
17
.SH DESCRIPTION
18
Checks a host and its associated key against the collection of known hosts,
19
and returns info back about the (partially) matched entry.
20

21
\fIhost\fP is a pointer the host name in plain text. The host name can be the
22
IP numerical address of the host or the full name.
23

24
\fIkey\fP is a pointer to the key for the given host.
25

26
\fIkeylen\fP is the total size in bytes of the key pointed to by the \fIkey\fP
27
argument
28

29
\fItypemask\fP is a bitmask that specifies format and info about the data
30
passed to this function. Specifically, it details what format the host name is,
31
what format the key is and what key type it is.
32

33
The host name is given as one of the following types:
34
LIBSSH2_KNOWNHOST_TYPE_PLAIN or LIBSSH2_KNOWNHOST_TYPE_CUSTOM.
35

36
The key is encoded using one of the following encodings:
37
LIBSSH2_KNOWNHOST_KEYENC_RAW or LIBSSH2_KNOWNHOST_KEYENC_BASE64.
38

39
\fIknownhost\fP if set to non-NULL, it must be a pointer to a 'struct
40
libssh2_knownhost' pointer that gets filled in to point to info about a known
41
host that matches or partially matches.
42
.SH RETURN VALUE
43
\fIlibssh2_knownhost_check(3)\fP returns info about how well the provided
44
host + key pair matched one of the entries in the list of known hosts.
45

46
LIBSSH2_KNOWNHOST_CHECK_FAILURE - something prevented the check to be made
47

48
LIBSSH2_KNOWNHOST_CHECK_NOTFOUND - no host match was found
49

50
LIBSSH2_KNOWNHOST_CHECK_MATCH - hosts and keys match.
51

52
LIBSSH2_KNOWNHOST_CHECK_MISMATCH - host was found, but the keys did not match!
53
.SH AVAILABILITY
54
Added in libssh2 1.2
55
.SH EXAMPLE
56
See the ssh2_exec.c example as provided in the tarball.
57
.SH SEE ALSO
58
.BR libssh2_knownhost_init(3)
59
.BR libssh2_knownhost_free(3)
60
.BR libssh2_knownhost_add(3)
61

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.