1gnutls_verify_stored_pubkey(3) gnutls gnutls_verify_stored_pubkey(3)
2
3
4
6 gnutls_verify_stored_pubkey - API function
7
9 #include <gnutls/gnutls.h>
10
11 int gnutls_verify_stored_pubkey(const char * db_name, gnutls_tdb_t tdb,
12 const char * host, const char * service, gnutls_certificate_type_t
13 cert_type, const gnutls_datum_t * cert, unsigned int flags);
14
16 const char * db_name
17 A file specifying the stored keys (use NULL for the
18 default)
19
20 gnutls_tdb_t tdb
21 A storage structure or NULL to use the default
22
23 const char * host
24 The peer's name
25
26 const char * service
27 non-NULL if this key is specific to a service (e.g. http)
28
29 gnutls_certificate_type_t cert_type
30 The type of the certificate
31
32 const gnutls_datum_t * cert
33 The raw (der) data of the certificate
34
35 unsigned int flags
36 should be 0.
37
39 This function will try to verify a raw public-key or a public-key pro‐
40 vided via a raw (DER-encoded) certificate using a list of stored public
41 keys. The service field if non-NULL should be a port number.
42
43 The db_name variable if non-null specifies a custom backend for the
44 retrieval of entries. If it is NULL then the default file backend will
45 be used. In POSIX-like systems the file backend uses the
46 $HOME/.gnutls/known_hosts file.
47
48 Note that if the custom storage backend is provided the retrieval func‐
49 tion should return GNUTLS_E_CERTIFICATE_KEY_MISMATCH if the host/ser‐
50 vice pair is found but key doesn't match, GNUTLS_E_NO_CERTIFICATE_FOUND
51 if no such host/service with the given key is found, and 0 if it was
52 found. The storage function should return 0 on success.
53
54 As of GnuTLS 3.6.6 this function also verifies raw public keys.
55
57 If no associated public key is found then GNUTLS_E_NO_CERTIFICATE_FOUND
58 will be returned. If a key is found but does not match GNUTLS_E_CER‐
59 TIFICATE_KEY_MISMATCH is returned. On success, GNUTLS_E_SUCCESS (0) is
60 returned, or a negative error value on other errors.
61
63 3.0.13
64
66 Report bugs to <bugs@gnutls.org>.
67 Home page: https://www.gnutls.org
68
69
71 Copyright © 2001-2019 Free Software Foundation, Inc., and others.
72 Copying and distribution of this file, with or without modification,
73 are permitted in any medium without royalty provided the copyright
74 notice and this notice are preserved.
75
77 The full documentation for gnutls is maintained as a Texinfo manual.
78 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
79 visit
80
81 https://www.gnutls.org/manual/
82
83gnutls 3.6.8 gnutls_verify_stored_pubkey(3)