1gnutls_store_pubkey(3)              gnutls              gnutls_store_pubkey(3)
2
3
4

NAME

6       gnutls_store_pubkey - API function
7

SYNOPSIS

9       #include <gnutls/gnutls.h>
10
11       int  gnutls_store_pubkey(const  char * db_name, gnutls_tdb_t tdb, const
12       char * host, const char * service, gnutls_certificate_type_t cert_type,
13       const gnutls_datum_t * cert, time_t expiration, unsigned int flags);
14

ARGUMENTS

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 data of the certificate
34
35       time_t expiration
36                   The expiration time (use 0 to disable expiration)
37
38       unsigned int flags
39                   should be 0.
40

DESCRIPTION

42       This function will store the provided (raw or DER-encoded)  certificate
43       to  the  list  of  stored public keys. The key will be considered valid
44       until the provided expiration time.
45
46       The  store variable if non-null specifies  a  custom  backend  for  the
47       storage of entries. If it is NULL then the default file backend will be
48       used.
49
50       Unless an alternative  tdb is provided, the storage format is a textual
51       format consisting of a line for each host with fields separated by '|'.
52       The contents of the fields are a  format-identifier  which  is  set  to
53       'g0',  the  hostname  that the rest of the data applies to, the numeric
54       port or host name, the expiration time in seconds since  the  epoch  (0
55       for  no  expiration), and a base64 encoding of the raw (DER) public key
56       information (SPKI) of the peer.
57

RETURNS

59       On success, GNUTLS_E_SUCCESS (0)  is  returned,  otherwise  a  negative
60       error value.
61

SINCE

63       3.0.13
64

REPORTING BUGS

66       Report bugs to <bugs@gnutls.org>.
67       Home page: http://www.gnutls.org
68
69
71       Copyright © 2001-2018 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

SEE ALSO

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       http://www.gnutls.org/manual/
82
83gnutls                               3.6.5              gnutls_store_pubkey(3)
Impressum