16
17
<refsynopsisdiv id="gnutls-openpgp.synopsis" role="synopsis">
17
18
<title role="synopsis.title">Synopsis</title>
20
enum <link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link>;
20
<synopsis>enum <link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link>;
21
21
typedef <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link>;
22
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-init">gnutls_openpgp_crt_init</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> *key);
23
<link linkend="void">void</link> <link linkend="gnutls-openpgp-crt-deinit">gnutls_openpgp_crt_deinit</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);
24
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-import">gnutls_openpgp_crt_import</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
25
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
26
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
27
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-export">gnutls_openpgp_crt_export</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
28
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format,
29
<link linkend="void">void</link> *output_data,
30
<link linkend="size-t">size_t</link> *output_data_size);
31
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-print">gnutls_openpgp_crt_print</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> cert,
32
<link linkend="gnutls-certificate-print-formats-t">gnutls_certificate_print_formats_t</link> format,
33
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *out);
34
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-key-usage">gnutls_openpgp_crt_get_key_usage</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
35
unsigned <link linkend="int">int</link> *key_usage);
36
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-fingerprint">gnutls_openpgp_crt_get_fingerprint</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
37
<link linkend="void">void</link> *fpr,
38
<link linkend="size-t">size_t</link> *fprlen);
39
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-fingerprint">gnutls_openpgp_crt_get_subkey_fingerprint</link>
40
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
41
unsigned <link linkend="int">int</link> idx,
42
<link linkend="void">void</link> *fpr,
43
<link linkend="size-t">size_t</link> *fprlen);
44
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-name">gnutls_openpgp_crt_get_name</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
45
<link linkend="int">int</link> idx,
46
<link linkend="char">char</link> *buf,
47
<link linkend="size-t">size_t</link> *sizeof_buf);
48
<link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> <link linkend="gnutls-openpgp-crt-get-pk-algorithm">gnutls_openpgp_crt_get_pk_algorithm</link>
49
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
50
unsigned <link linkend="int">int</link> *bits);
51
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-version">gnutls_openpgp_crt_get_version</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);
52
<link linkend="time-t">time_t</link> <link linkend="gnutls-openpgp-crt-get-creation-time">gnutls_openpgp_crt_get_creation_time</link>
53
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);
54
<link linkend="time-t">time_t</link> <link linkend="gnutls-openpgp-crt-get-expiration-time">gnutls_openpgp_crt_get_expiration_time</link>
55
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);
56
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-key-id">gnutls_openpgp_crt_get_key_id</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
57
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
58
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-check-hostname">gnutls_openpgp_crt_check_hostname</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
59
const <link linkend="char">char</link> *hostname);
60
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-revoked-status">gnutls_openpgp_crt_get_revoked_status</link>
61
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);
62
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-count">gnutls_openpgp_crt_get_subkey_count</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);
63
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-idx">gnutls_openpgp_crt_get_subkey_idx</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
64
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
65
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-revoked-status">gnutls_openpgp_crt_get_subkey_revoked_status</link>
66
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
67
unsigned <link linkend="int">int</link> idx);
68
<link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> <link linkend="gnutls-openpgp-crt-get-subkey-pk-algorithm">gnutls_openpgp_crt_get_subkey_pk_algorithm</link>
69
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
70
unsigned <link linkend="int">int</link> idx,
71
unsigned <link linkend="int">int</link> *bits);
72
<link linkend="time-t">time_t</link> <link linkend="gnutls-openpgp-crt-get-subkey-creation-time">gnutls_openpgp_crt_get_subkey_creation_time</link>
73
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
74
unsigned <link linkend="int">int</link> idx);
75
<link linkend="time-t">time_t</link> <link linkend="gnutls-openpgp-crt-get-subkey-expiration-time">gnutls_openpgp_crt_get_subkey_expiration_time</link>
76
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
77
unsigned <link linkend="int">int</link> idx);
78
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-id">gnutls_openpgp_crt_get_subkey_id</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
79
unsigned <link linkend="int">int</link> idx,
80
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
81
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-usage">gnutls_openpgp_crt_get_subkey_usage</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
82
unsigned <link linkend="int">int</link> idx,
83
unsigned <link linkend="int">int</link> *key_usage);
84
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-pk-dsa-raw">gnutls_openpgp_crt_get_subkey_pk_dsa_raw</link>
85
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
86
unsigned <link linkend="int">int</link> idx,
87
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
88
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
89
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
90
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y);
91
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-subkey-pk-rsa-raw">gnutls_openpgp_crt_get_subkey_pk_rsa_raw</link>
92
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
93
unsigned <link linkend="int">int</link> idx,
94
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
95
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e);
96
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-pk-dsa-raw">gnutls_openpgp_crt_get_pk_dsa_raw</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
97
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
98
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
99
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
100
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y);
101
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-pk-rsa-raw">gnutls_openpgp_crt_get_pk_rsa_raw</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
102
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
103
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e);
104
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-preferred-key-id">gnutls_openpgp_crt_get_preferred_key_id</link>
105
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
106
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
107
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-set-preferred-key-id">gnutls_openpgp_crt_set_preferred_key_id</link>
108
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
109
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
110
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-init">gnutls_openpgp_privkey_init</link> (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> *key);
111
<link linkend="void">void</link> <link linkend="gnutls-openpgp-privkey-deinit">gnutls_openpgp_privkey_deinit</link> (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key);
112
<link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> <link linkend="gnutls-openpgp-privkey-get-pk-algorithm">gnutls_openpgp_privkey_get_pk_algorithm</link>
113
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
114
unsigned <link linkend="int">int</link> *bits);
115
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-import">gnutls_openpgp_privkey_import</link> (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
116
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
117
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format,
118
const <link linkend="char">char</link> *password,
119
unsigned <link linkend="int">int</link> flags);
120
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-sign-hash">gnutls_openpgp_privkey_sign_hash</link> (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
121
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *hash,
122
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *signature);
123
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-fingerprint">gnutls_openpgp_privkey_get_fingerprint</link>
124
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
125
<link linkend="void">void</link> *fpr,
126
<link linkend="size-t">size_t</link> *fprlen);
127
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-subkey-fingerprint">gnutls_openpgp_privkey_get_subkey_fingerprint</link>
128
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
129
unsigned <link linkend="int">int</link> idx,
130
<link linkend="void">void</link> *fpr,
131
<link linkend="size-t">size_t</link> *fprlen);
132
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-key-id">gnutls_openpgp_privkey_get_key_id</link> (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
133
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
134
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-subkey-count">gnutls_openpgp_privkey_get_subkey_count</link>
135
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key);
136
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-subkey-idx">gnutls_openpgp_privkey_get_subkey_idx</link>
137
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
138
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
139
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-subkey-revoked-status">gnutls_openpgp_privkey_get_subkey_revoked_status</link>
140
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
141
unsigned <link linkend="int">int</link> idx);
142
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-revoked-status">gnutls_openpgp_privkey_get_revoked_status</link>
143
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key);
144
<link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> <link linkend="gnutls-openpgp-privkey-get-subkey-pk-algorithm">gnutls_openpgp_privkey_get_subkey_pk_algorithm</link>
145
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
146
unsigned <link linkend="int">int</link> idx,
147
unsigned <link linkend="int">int</link> *bits);
148
<link linkend="time-t">time_t</link> <link linkend="gnutls-openpgp-privkey-get-subkey-expiration-time">gnutls_openpgp_privkey_get_subkey_expiration_time</link>
149
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
150
unsigned <link linkend="int">int</link> idx);
151
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-subkey-id">gnutls_openpgp_privkey_get_subkey_id</link>
152
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
153
unsigned <link linkend="int">int</link> idx,
154
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
155
<link linkend="time-t">time_t</link> <link linkend="gnutls-openpgp-privkey-get-subkey-creation-time">gnutls_openpgp_privkey_get_subkey_creation_time</link>
156
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
157
unsigned <link linkend="int">int</link> idx);
158
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-export-subkey-dsa-raw">gnutls_openpgp_privkey_export_subkey_dsa_raw</link>
159
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
160
unsigned <link linkend="int">int</link> idx,
161
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
162
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
163
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
164
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y,
165
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *x);
166
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-export-subkey-rsa-raw">gnutls_openpgp_privkey_export_subkey_rsa_raw</link>
167
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
168
unsigned <link linkend="int">int</link> idx,
169
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
170
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e,
171
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *d,
172
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
173
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
174
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *u);
175
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-export-dsa-raw">gnutls_openpgp_privkey_export_dsa_raw</link>
176
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
177
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
178
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
179
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
180
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y,
181
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *x);
182
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-export-rsa-raw">gnutls_openpgp_privkey_export_rsa_raw</link>
183
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
184
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
185
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e,
186
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *d,
187
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
188
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
189
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *u);
190
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-export">gnutls_openpgp_privkey_export</link> (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
191
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format,
192
const <link linkend="char">char</link> *password,
193
unsigned <link linkend="int">int</link> flags,
194
<link linkend="void">void</link> *output_data,
195
<link linkend="size-t">size_t</link> *output_data_size);
196
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-set-preferred-key-id">gnutls_openpgp_privkey_set_preferred_key_id</link>
197
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
198
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
199
<link linkend="int">int</link> <link linkend="gnutls-openpgp-privkey-get-preferred-key-id">gnutls_openpgp_privkey_get_preferred_key_id</link>
200
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
201
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);
202
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-get-auth-subkey">gnutls_openpgp_crt_get_auth_subkey</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
203
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid,
204
unsigned <link linkend="int">int</link> flag);
205
<link linkend="int">int</link> <link linkend="gnutls-openpgp-keyring-init">gnutls_openpgp_keyring_init</link> (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> *keyring);
206
<link linkend="void">void</link> <link linkend="gnutls-openpgp-keyring-deinit">gnutls_openpgp_keyring_deinit</link> (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> keyring);
207
<link linkend="int">int</link> <link linkend="gnutls-openpgp-keyring-import">gnutls_openpgp_keyring_import</link> (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> keyring,
208
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
209
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
210
<link linkend="int">int</link> <link linkend="gnutls-openpgp-keyring-check-id">gnutls_openpgp_keyring_check_id</link> (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> ring,
211
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid,
212
unsigned <link linkend="int">int</link> flags);
213
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-verify-ring">gnutls_openpgp_crt_verify_ring</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
214
<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> keyring,
215
unsigned <link linkend="int">int</link> flags,
216
unsigned <link linkend="int">int</link> *verify);
217
<link linkend="int">int</link> <link linkend="gnutls-openpgp-crt-verify-self">gnutls_openpgp_crt_verify_self</link> (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
218
unsigned <link linkend="int">int</link> flags,
219
unsigned <link linkend="int">int</link> *verify);
220
<link linkend="int">int</link> <link linkend="gnutls-openpgp-keyring-get-crt">gnutls_openpgp_keyring_get_crt</link> (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> ring,
221
unsigned <link linkend="int">int</link> idx,
222
<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> *cert);
223
<link linkend="int">int</link> <link linkend="gnutls-openpgp-keyring-get-crt-count">gnutls_openpgp_keyring_get_crt_count</link>
224
(<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> ring);
225
<link linkend="int">int</link> (<link linkend="gnutls-openpgp-recv-key-func">*gnutls_openpgp_recv_key_func</link>) (<link linkend="gnutls-session-t">gnutls_session_t</link> session,
226
unsigned <link linkend="char">char</link> *keyfpr,
227
unsigned <link linkend="int">int</link> keyfpr_length,
228
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *key);
229
<link linkend="void">void</link> <link linkend="gnutls-openpgp-set-recv-key-function">gnutls_openpgp_set_recv_key_function</link>
230
(<link linkend="gnutls-session-t">gnutls_session_t</link> session,
231
<link linkend="gnutls-openpgp-recv-key-func">gnutls_openpgp_recv_key_func</link> func);
232
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-key">gnutls_certificate_set_openpgp_key</link> (<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
233
<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
234
<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey);
235
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-key-file">gnutls_certificate_set_openpgp_key_file</link>
236
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
237
const <link linkend="char">char</link> *certfile,
238
const <link linkend="char">char</link> *keyfile,
239
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
240
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-key-mem">gnutls_certificate_set_openpgp_key_mem</link>
241
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
242
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *cert,
243
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *key,
244
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
245
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-key-file2">gnutls_certificate_set_openpgp_key_file2</link>
246
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
247
const <link linkend="char">char</link> *certfile,
248
const <link linkend="char">char</link> *keyfile,
249
const <link linkend="char">char</link> *subkey_id,
250
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
251
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-key-mem2">gnutls_certificate_set_openpgp_key_mem2</link>
252
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
253
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *cert,
254
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *key,
255
const <link linkend="char">char</link> *subkey_id,
256
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
257
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-keyring-mem">gnutls_certificate_set_openpgp_keyring_mem</link>
258
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> c,
259
unsigned <link linkend="char">char</link> *data,
260
<link linkend="size-t">size_t</link> dlen,
261
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
262
<link linkend="int">int</link> <link linkend="gnutls-certificate-set-openpgp-keyring-file">gnutls_certificate_set_openpgp_keyring_file</link>
263
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> c,
264
const <link linkend="char">char</link> *file,
265
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);
22
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-init">gnutls_openpgp_crt_init</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> *key</parameter>);
23
<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="gnutls-openpgp-crt-deinit">gnutls_openpgp_crt_deinit</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);
24
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-import">gnutls_openpgp_crt_import</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
25
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
26
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
27
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-export">gnutls_openpgp_crt_export</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
28
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>,
29
<parameter><link linkend="void"><type>void</type></link> *output_data</parameter>,
30
<parameter><link linkend="size-t"><type>size_t</type></link> *output_data_size</parameter>);
31
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-print">gnutls_openpgp_crt_print</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> cert</parameter>,
32
<parameter><link linkend="gnutls-certificate-print-formats-t"><type>gnutls_certificate_print_formats_t</type></link> format</parameter>,
33
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *out</parameter>);
34
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-key-usage">gnutls_openpgp_crt_get_key_usage</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
35
<parameter>unsigned <link linkend="int"><type>int</type></link> *key_usage</parameter>);
36
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-fingerprint">gnutls_openpgp_crt_get_fingerprint</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
37
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
38
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);
39
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-fingerprint">gnutls_openpgp_crt_get_subkey_fingerprint</link>
40
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
41
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
42
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
43
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);
44
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-name">gnutls_openpgp_crt_get_name</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
45
<parameter><link linkend="int"><type>int</type></link> idx</parameter>,
46
<parameter><link linkend="char"><type>char</type></link> *buf</parameter>,
47
<parameter><link linkend="size-t"><type>size_t</type></link> *sizeof_buf</parameter>);
48
<link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-pk-algorithm">gnutls_openpgp_crt_get_pk_algorithm</link>
49
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
50
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);
51
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-version">gnutls_openpgp_crt_get_version</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);
52
<link linkend="time-t"><returnvalue>time_t</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-creation-time">gnutls_openpgp_crt_get_creation_time</link>
53
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);
54
<link linkend="time-t"><returnvalue>time_t</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-expiration-time">gnutls_openpgp_crt_get_expiration_time</link>
55
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);
56
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-key-id">gnutls_openpgp_crt_get_key_id</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
57
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
58
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-check-hostname">gnutls_openpgp_crt_check_hostname</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
59
<parameter>const <link linkend="char"><type>char</type></link> *hostname</parameter>);
60
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-revoked-status">gnutls_openpgp_crt_get_revoked_status</link>
61
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);
62
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-count">gnutls_openpgp_crt_get_subkey_count</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);
63
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-idx">gnutls_openpgp_crt_get_subkey_idx</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
64
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
65
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-revoked-status">gnutls_openpgp_crt_get_subkey_revoked_status</link>
66
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
67
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);
68
<link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-pk-algorithm">gnutls_openpgp_crt_get_subkey_pk_algorithm</link>
69
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
70
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
71
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);
72
<link linkend="time-t"><returnvalue>time_t</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-creation-time">gnutls_openpgp_crt_get_subkey_creation_time</link>
73
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
74
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);
75
<link linkend="time-t"><returnvalue>time_t</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-expiration-time">gnutls_openpgp_crt_get_subkey_expiration_time</link>
76
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
77
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);
78
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-id">gnutls_openpgp_crt_get_subkey_id</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
79
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
80
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
81
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-usage">gnutls_openpgp_crt_get_subkey_usage</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
82
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
83
<parameter>unsigned <link linkend="int"><type>int</type></link> *key_usage</parameter>);
84
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-pk-dsa-raw">gnutls_openpgp_crt_get_subkey_pk_dsa_raw</link>
85
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
86
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
87
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
88
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
89
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
90
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>);
91
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-subkey-pk-rsa-raw">gnutls_openpgp_crt_get_subkey_pk_rsa_raw</link>
92
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
93
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
94
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
95
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>);
96
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-pk-dsa-raw">gnutls_openpgp_crt_get_pk_dsa_raw</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
97
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
98
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
99
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
100
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>);
101
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-pk-rsa-raw">gnutls_openpgp_crt_get_pk_rsa_raw</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
102
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
103
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>);
104
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-preferred-key-id">gnutls_openpgp_crt_get_preferred_key_id</link>
105
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
106
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
107
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-set-preferred-key-id">gnutls_openpgp_crt_set_preferred_key_id</link>
108
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
109
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
110
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-init">gnutls_openpgp_privkey_init</link> (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> *key</parameter>);
111
<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="gnutls-openpgp-privkey-deinit">gnutls_openpgp_privkey_deinit</link> (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>);
112
<link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-pk-algorithm">gnutls_openpgp_privkey_get_pk_algorithm</link>
113
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
114
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);
115
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-import">gnutls_openpgp_privkey_import</link> (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
116
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
117
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>,
118
<parameter>const <link linkend="char"><type>char</type></link> *password</parameter>,
119
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);
120
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-sign-hash">gnutls_openpgp_privkey_sign_hash</link> (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
121
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *hash</parameter>,
122
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *signature</parameter>);
123
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-fingerprint">gnutls_openpgp_privkey_get_fingerprint</link>
124
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
125
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
126
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);
127
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-fingerprint">gnutls_openpgp_privkey_get_subkey_fingerprint</link>
128
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
129
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
130
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
131
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);
132
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-key-id">gnutls_openpgp_privkey_get_key_id</link> (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
133
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
134
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-count">gnutls_openpgp_privkey_get_subkey_count</link>
135
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>);
136
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-idx">gnutls_openpgp_privkey_get_subkey_idx</link>
137
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
138
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
139
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-revoked-status">gnutls_openpgp_privkey_get_subkey_revoked_status</link>
140
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
141
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);
142
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-revoked-status">gnutls_openpgp_privkey_get_revoked_status</link>
143
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>);
144
<link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-pk-algorithm">gnutls_openpgp_privkey_get_subkey_pk_algorithm</link>
145
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
146
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
147
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);
148
<link linkend="time-t"><returnvalue>time_t</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-expiration-time">gnutls_openpgp_privkey_get_subkey_expiration_time</link>
149
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
150
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);
151
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-id">gnutls_openpgp_privkey_get_subkey_id</link>
152
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
153
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
154
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
155
<link linkend="time-t"><returnvalue>time_t</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-subkey-creation-time">gnutls_openpgp_privkey_get_subkey_creation_time</link>
156
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
157
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);
158
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-export-subkey-dsa-raw">gnutls_openpgp_privkey_export_subkey_dsa_raw</link>
159
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
160
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
161
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
162
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
163
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
164
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>,
165
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *x</parameter>);
166
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-export-subkey-rsa-raw">gnutls_openpgp_privkey_export_subkey_rsa_raw</link>
167
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
168
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
169
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
170
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>,
171
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *d</parameter>,
172
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
173
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
174
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *u</parameter>);
175
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-export-dsa-raw">gnutls_openpgp_privkey_export_dsa_raw</link>
176
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
177
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
178
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
179
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
180
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>,
181
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *x</parameter>);
182
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-export-rsa-raw">gnutls_openpgp_privkey_export_rsa_raw</link>
183
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
184
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
185
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>,
186
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *d</parameter>,
187
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
188
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
189
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *u</parameter>);
190
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-export">gnutls_openpgp_privkey_export</link> (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
191
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>,
192
<parameter>const <link linkend="char"><type>char</type></link> *password</parameter>,
193
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>,
194
<parameter><link linkend="void"><type>void</type></link> *output_data</parameter>,
195
<parameter><link linkend="size-t"><type>size_t</type></link> *output_data_size</parameter>);
196
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-set-preferred-key-id">gnutls_openpgp_privkey_set_preferred_key_id</link>
197
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
198
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
199
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-privkey-get-preferred-key-id">gnutls_openpgp_privkey_get_preferred_key_id</link>
200
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
201
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);
202
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-get-auth-subkey">gnutls_openpgp_crt_get_auth_subkey</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
203
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>,
204
<parameter>unsigned <link linkend="int"><type>int</type></link> flag</parameter>);
205
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-keyring-init">gnutls_openpgp_keyring_init</link> (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> *keyring</parameter>);
206
<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="gnutls-openpgp-keyring-deinit">gnutls_openpgp_keyring_deinit</link> (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> keyring</parameter>);
207
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-keyring-import">gnutls_openpgp_keyring_import</link> (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> keyring</parameter>,
208
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
209
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
210
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-keyring-check-id">gnutls_openpgp_keyring_check_id</link> (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> ring</parameter>,
211
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>,
212
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);
213
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-verify-ring">gnutls_openpgp_crt_verify_ring</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
214
<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> keyring</parameter>,
215
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>,
216
<parameter>unsigned <link linkend="int"><type>int</type></link> *verify</parameter>);
217
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-crt-verify-self">gnutls_openpgp_crt_verify_self</link> (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
218
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>,
219
<parameter>unsigned <link linkend="int"><type>int</type></link> *verify</parameter>);
220
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-keyring-get-crt">gnutls_openpgp_keyring_get_crt</link> (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> ring</parameter>,
221
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
222
<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> *cert</parameter>);
223
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-openpgp-keyring-get-crt-count">gnutls_openpgp_keyring_get_crt_count</link>
224
(<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> ring</parameter>);
225
<link linkend="int"><returnvalue>int</returnvalue></link> (<link linkend="gnutls-openpgp-recv-key-func">*gnutls_openpgp_recv_key_func</link>) (<parameter><link linkend="gnutls-session-t"><type>gnutls_session_t</type></link> session</parameter>,
226
<parameter>unsigned <link linkend="char"><type>char</type></link> *keyfpr</parameter>,
227
<parameter>unsigned <link linkend="int"><type>int</type></link> keyfpr_length</parameter>,
228
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *key</parameter>);
229
<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="gnutls-openpgp-set-recv-key-function">gnutls_openpgp_set_recv_key_function</link>
230
(<parameter><link linkend="gnutls-session-t"><type>gnutls_session_t</type></link> session</parameter>,
231
<parameter><link linkend="gnutls-openpgp-recv-key-func"><type>gnutls_openpgp_recv_key_func</type></link> func</parameter>);
232
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-key">gnutls_certificate_set_openpgp_key</link> (<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
233
<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
234
<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>);
235
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-key-file">gnutls_certificate_set_openpgp_key_file</link>
236
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
237
<parameter>const <link linkend="char"><type>char</type></link> *certfile</parameter>,
238
<parameter>const <link linkend="char"><type>char</type></link> *keyfile</parameter>,
239
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
240
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-key-mem">gnutls_certificate_set_openpgp_key_mem</link>
241
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
242
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *cert</parameter>,
243
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *key</parameter>,
244
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
245
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-key-file2">gnutls_certificate_set_openpgp_key_file2</link>
246
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
247
<parameter>const <link linkend="char"><type>char</type></link> *certfile</parameter>,
248
<parameter>const <link linkend="char"><type>char</type></link> *keyfile</parameter>,
249
<parameter>const <link linkend="char"><type>char</type></link> *subkey_id</parameter>,
250
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
251
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-key-mem2">gnutls_certificate_set_openpgp_key_mem2</link>
252
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
253
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *cert</parameter>,
254
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *key</parameter>,
255
<parameter>const <link linkend="char"><type>char</type></link> *subkey_id</parameter>,
256
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
257
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-keyring-mem">gnutls_certificate_set_openpgp_keyring_mem</link>
258
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> c</parameter>,
259
<parameter>unsigned <link linkend="char"><type>char</type></link> *data</parameter>,
260
<parameter><link linkend="size-t"><type>size_t</type></link> dlen</parameter>,
261
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
262
<link linkend="int"><returnvalue>int</returnvalue></link> <link linkend="gnutls-certificate-set-openpgp-keyring-file">gnutls_certificate_set_openpgp_keyring_file</link>
263
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> c</parameter>,
264
<parameter>const <link linkend="char"><type>char</type></link> *file</parameter>,
265
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);
267
267
</refsynopsisdiv>
277
269
<refsect1 id="gnutls-openpgp.description" role="desc">
278
270
<title role="desc.title">Description</title>
283
274
<refsect1 id="gnutls-openpgp.details" role="details">
284
275
<title role="details.title">Details</title>
285
276
<refsect2 id="gnutls-openpgp-crt-fmt-t" role="enum">
286
277
<title>enum gnutls_openpgp_crt_fmt_t</title>
287
<indexterm zone="gnutls-openpgp-crt-fmt-t"><primary sortas="gnutls_openpgp_crt_fmt_t">gnutls_openpgp_crt_fmt_t</primary></indexterm><programlisting> typedef enum gnutls_openpgp_crt_fmt
278
<indexterm zone="gnutls-openpgp-crt-fmt-t"><primary>gnutls_openpgp_crt_fmt_t</primary></indexterm>
279
<programlisting> typedef enum gnutls_openpgp_crt_fmt
288
280
{ GNUTLS_OPENPGP_FMT_RAW,
289
281
GNUTLS_OPENPGP_FMT_BASE64
290
282
} gnutls_openpgp_crt_fmt_t;
293
285
</para></refsect2>
294
286
<refsect2 id="gnutls-openpgp-keyid-t" role="typedef">
295
287
<title>gnutls_openpgp_keyid_t</title>
296
<indexterm zone="gnutls-openpgp-keyid-t"><primary sortas="gnutls_openpgp_keyid_t">gnutls_openpgp_keyid_t</primary></indexterm><programlisting> typedef unsigned char gnutls_openpgp_keyid_t[8];
288
<indexterm zone="gnutls-openpgp-keyid-t"><primary>gnutls_openpgp_keyid_t</primary></indexterm>
289
<programlisting> typedef unsigned char gnutls_openpgp_keyid_t[8];
297
290
</programlisting>
299
292
</para></refsect2>
300
293
<refsect2 id="gnutls-openpgp-crt-init" role="function">
301
294
<title>gnutls_openpgp_crt_init ()</title>
302
<indexterm zone="gnutls-openpgp-crt-init"><primary sortas="gnutls_openpgp_crt_init">gnutls_openpgp_crt_init</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_init (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> *key);</programlisting>
304
This function will initialize an OpenPGP key structure.</para>
295
<indexterm zone="gnutls-openpgp-crt-init"><primary>gnutls_openpgp_crt_init</primary></indexterm>
296
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_init (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> *key</parameter>);</programlisting>
306
298
</para><variablelist role="params">
307
299
<varlistentry><term><parameter>key</parameter> :</term>
308
<listitem><simpara> The structure to be initialized
309
301
</simpara></listitem></varlistentry>
310
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
302
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
311
303
</simpara></listitem></varlistentry>
312
304
</variablelist></refsect2>
313
305
<refsect2 id="gnutls-openpgp-crt-deinit" role="function">
314
306
<title>gnutls_openpgp_crt_deinit ()</title>
315
<indexterm zone="gnutls-openpgp-crt-deinit"><primary sortas="gnutls_openpgp_crt_deinit">gnutls_openpgp_crt_deinit</primary></indexterm><programlisting><link linkend="void">void</link> gnutls_openpgp_crt_deinit (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);</programlisting>
317
This function will deinitialize a key structure.</para>
307
<indexterm zone="gnutls-openpgp-crt-deinit"><primary>gnutls_openpgp_crt_deinit</primary></indexterm>
308
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> gnutls_openpgp_crt_deinit (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);</programlisting>
319
310
</para><variablelist role="params">
320
311
<varlistentry><term><parameter>key</parameter> :</term>
321
<listitem><simpara> The structure to be initialized
322
313
</simpara></listitem></varlistentry>
323
314
</variablelist></refsect2>
324
315
<refsect2 id="gnutls-openpgp-crt-import" role="function">
325
316
<title>gnutls_openpgp_crt_import ()</title>
326
<indexterm zone="gnutls-openpgp-crt-import"><primary sortas="gnutls_openpgp_crt_import">gnutls_openpgp_crt_import</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_import (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
327
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
328
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
330
This function will convert the given RAW or Base64 encoded key to
331
the native <link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> format. The output will be stored
317
<indexterm zone="gnutls-openpgp-crt-import"><primary>gnutls_openpgp_crt_import</primary></indexterm>
318
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_import (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
319
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
320
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
334
322
</para><variablelist role="params">
335
323
<varlistentry><term><parameter>key</parameter> :</term>
336
<listitem><simpara> The structure to store the parsed key.
337
325
</simpara></listitem></varlistentry>
338
326
<varlistentry><term><parameter>data</parameter> :</term>
339
<listitem><simpara> The RAW or BASE64 encoded key.
340
328
</simpara></listitem></varlistentry>
341
329
<varlistentry><term><parameter>format</parameter> :</term>
342
<listitem><simpara> One of gnutls_openpgp_crt_fmt_t elements.
343
331
</simpara></listitem></varlistentry>
344
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
332
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
345
333
</simpara></listitem></varlistentry>
346
334
</variablelist></refsect2>
347
335
<refsect2 id="gnutls-openpgp-crt-export" role="function">
348
336
<title>gnutls_openpgp_crt_export ()</title>
349
<indexterm zone="gnutls-openpgp-crt-export"><primary sortas="gnutls_openpgp_crt_export">gnutls_openpgp_crt_export</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_export (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
350
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format,
351
<link linkend="void">void</link> *output_data,
352
<link linkend="size-t">size_t</link> *output_data_size);</programlisting>
354
This function will convert the given key to RAW or Base64 format.
355
If the buffer provided is not long enough to hold the output, then
356
<link linkend="GNUTLS-E-SHORT-MEMORY-BUFFER--CAPS"><literal>GNUTLS_E_SHORT_MEMORY_BUFFER</literal></link> will be returned.</para>
337
<indexterm zone="gnutls-openpgp-crt-export"><primary>gnutls_openpgp_crt_export</primary></indexterm>
338
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_export (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
339
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>,
340
<parameter><link linkend="void"><type>void</type></link> *output_data</parameter>,
341
<parameter><link linkend="size-t"><type>size_t</type></link> *output_data_size</parameter>);</programlisting>
358
343
</para><variablelist role="params">
359
344
<varlistentry><term><parameter>key</parameter> :</term>
360
<listitem><simpara> Holds the key.
361
346
</simpara></listitem></varlistentry>
362
347
<varlistentry><term><parameter>format</parameter> :</term>
363
<listitem><simpara> One of gnutls_openpgp_crt_fmt_t elements.
364
349
</simpara></listitem></varlistentry>
365
350
<varlistentry><term><parameter>output_data</parameter> :</term>
366
<listitem><simpara> will contain the key base64 encoded or raw
367
352
</simpara></listitem></varlistentry>
368
353
<varlistentry><term><parameter>output_data_size</parameter> :</term>
369
<listitem><simpara> holds the size of output_data (and will
370
be replaced by the actual size of parameters)
371
355
</simpara></listitem></varlistentry>
372
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
356
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
373
357
</simpara></listitem></varlistentry>
374
358
</variablelist></refsect2>
375
359
<refsect2 id="gnutls-openpgp-crt-print" role="function">
376
360
<title>gnutls_openpgp_crt_print ()</title>
377
<indexterm zone="gnutls-openpgp-crt-print"><primary sortas="gnutls_openpgp_crt_print">gnutls_openpgp_crt_print</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_print (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> cert,
378
<link linkend="gnutls-certificate-print-formats-t">gnutls_certificate_print_formats_t</link> format,
379
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *out);</programlisting>
381
This function will pretty print an OpenPGP certificate, suitable
382
for display to a human.
385
The format should be zero for future compatibility.
388
The output <parameter>out</parameter> needs to be deallocate using <link linkend="gnutls-free"><function>gnutls_free()</function></link>.</para>
361
<indexterm zone="gnutls-openpgp-crt-print"><primary>gnutls_openpgp_crt_print</primary></indexterm>
362
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_print (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> cert</parameter>,
363
<parameter><link linkend="gnutls-certificate-print-formats-t"><type>gnutls_certificate_print_formats_t</type></link> format</parameter>,
364
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *out</parameter>);</programlisting>
390
366
</para><variablelist role="params">
391
367
<varlistentry><term><parameter>cert</parameter> :</term>
392
<listitem><simpara> The structure to be printed
393
369
</simpara></listitem></varlistentry>
394
370
<varlistentry><term><parameter>format</parameter> :</term>
395
<listitem><simpara> Indicate the format to use
396
372
</simpara></listitem></varlistentry>
397
373
<varlistentry><term><parameter>out</parameter> :</term>
398
<listitem><simpara> Newly allocated datum with zero terminated string.
399
375
</simpara></listitem></varlistentry>
400
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
376
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
401
377
</simpara></listitem></varlistentry>
402
378
</variablelist></refsect2>
403
379
<refsect2 id="gnutls-openpgp-crt-get-key-usage" role="function">
404
380
<title>gnutls_openpgp_crt_get_key_usage ()</title>
405
<indexterm zone="gnutls-openpgp-crt-get-key-usage"><primary sortas="gnutls_openpgp_crt_get_key_usage">gnutls_openpgp_crt_get_key_usage</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_key_usage (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
406
unsigned <link linkend="int">int</link> *key_usage);</programlisting>
408
This function will return certificate's key usage, by checking the
409
key algorithm. The key usage value will ORed values of the:
410
<link linkend="GNUTLS-KEY-DIGITAL-SIGNATURE--CAPS"><literal>GNUTLS_KEY_DIGITAL_SIGNATURE</literal></link>, <link linkend="GNUTLS-KEY-KEY-ENCIPHERMENT--CAPS"><literal>GNUTLS_KEY_KEY_ENCIPHERMENT</literal></link>.</para>
381
<indexterm zone="gnutls-openpgp-crt-get-key-usage"><primary>gnutls_openpgp_crt_get_key_usage</primary></indexterm>
382
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_key_usage (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
383
<parameter>unsigned <link linkend="int"><type>int</type></link> *key_usage</parameter>);</programlisting>
412
385
</para><variablelist role="params">
413
386
<varlistentry><term><parameter>key</parameter> :</term>
414
<listitem><simpara> should contain a gnutls_openpgp_crt_t structure
415
388
</simpara></listitem></varlistentry>
416
389
<varlistentry><term><parameter>key_usage</parameter> :</term>
417
<listitem><simpara> where the key usage bits will be stored
418
391
</simpara></listitem></varlistentry>
419
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
392
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
420
393
</simpara></listitem></varlistentry>
421
394
</variablelist></refsect2>
422
395
<refsect2 id="gnutls-openpgp-crt-get-fingerprint" role="function">
423
396
<title>gnutls_openpgp_crt_get_fingerprint ()</title>
424
<indexterm zone="gnutls-openpgp-crt-get-fingerprint"><primary sortas="gnutls_openpgp_crt_get_fingerprint">gnutls_openpgp_crt_get_fingerprint</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_fingerprint (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
425
<link linkend="void">void</link> *fpr,
426
<link linkend="size-t">size_t</link> *fprlen);</programlisting>
428
Get key fingerprint. Depending on the algorithm, the fingerprint
429
can be 16 or 20 bytes.</para>
397
<indexterm zone="gnutls-openpgp-crt-get-fingerprint"><primary>gnutls_openpgp_crt_get_fingerprint</primary></indexterm>
398
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_fingerprint (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
399
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
400
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);</programlisting>
431
402
</para><variablelist role="params">
432
403
<varlistentry><term><parameter>key</parameter> :</term>
433
<listitem><simpara> the raw data that contains the OpenPGP public key.
434
405
</simpara></listitem></varlistentry>
435
406
<varlistentry><term><parameter>fpr</parameter> :</term>
436
<listitem><simpara> the buffer to save the fingerprint, must hold at least 20 bytes.
437
408
</simpara></listitem></varlistentry>
438
409
<varlistentry><term><parameter>fprlen</parameter> :</term>
439
<listitem><simpara> the integer to save the length of the fingerprint.
440
411
</simpara></listitem></varlistentry>
441
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, 0 is returned. Otherwise, an error code.
412
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
442
413
</simpara></listitem></varlistentry>
443
414
</variablelist></refsect2>
444
<refsect2 id="gnutls-openpgp-crt-get-subkey-fingerprint" role="function" condition="since:2.4.0">
415
<refsect2 id="gnutls-openpgp-crt-get-subkey-fingerprint" role="function">
445
416
<title>gnutls_openpgp_crt_get_subkey_fingerprint ()</title>
446
<indexterm zone="gnutls-openpgp-crt-get-subkey-fingerprint" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_fingerprint">gnutls_openpgp_crt_get_subkey_fingerprint</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_fingerprint
447
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
448
unsigned <link linkend="int">int</link> idx,
449
<link linkend="void">void</link> *fpr,
450
<link linkend="size-t">size_t</link> *fprlen);</programlisting>
452
Get key fingerprint of a subkey. Depending on the algorithm, the
453
fingerprint can be 16 or 20 bytes.</para>
417
<indexterm zone="gnutls-openpgp-crt-get-subkey-fingerprint"><primary>gnutls_openpgp_crt_get_subkey_fingerprint</primary></indexterm>
418
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_fingerprint
419
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
420
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
421
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
422
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);</programlisting>
455
424
</para><variablelist role="params">
456
425
<varlistentry><term><parameter>key</parameter> :</term>
457
<listitem><simpara> the raw data that contains the OpenPGP public key.
458
427
</simpara></listitem></varlistentry>
459
428
<varlistentry><term><parameter>idx</parameter> :</term>
460
<listitem><simpara> the subkey index
461
430
</simpara></listitem></varlistentry>
462
431
<varlistentry><term><parameter>fpr</parameter> :</term>
463
<listitem><simpara> the buffer to save the fingerprint, must hold at least 20 bytes.
464
433
</simpara></listitem></varlistentry>
465
434
<varlistentry><term><parameter>fprlen</parameter> :</term>
466
<listitem><simpara> the integer to save the length of the fingerprint.
467
</simpara></listitem></varlistentry>
468
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, 0 is returned. Otherwise, an error code.
470
</simpara></listitem></varlistentry>
471
</variablelist><para role="since">Since 2.4.0</para></refsect2>
436
</simpara></listitem></varlistentry>
437
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
438
</simpara></listitem></varlistentry>
439
</variablelist></refsect2>
472
440
<refsect2 id="gnutls-openpgp-crt-get-name" role="function">
473
441
<title>gnutls_openpgp_crt_get_name ()</title>
474
<indexterm zone="gnutls-openpgp-crt-get-name"><primary sortas="gnutls_openpgp_crt_get_name">gnutls_openpgp_crt_get_name</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_name (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
475
<link linkend="int">int</link> idx,
476
<link linkend="char">char</link> *buf,
477
<link linkend="size-t">size_t</link> *sizeof_buf);</programlisting>
479
Extracts the userID from the parsed OpenPGP key.</para>
442
<indexterm zone="gnutls-openpgp-crt-get-name"><primary>gnutls_openpgp_crt_get_name</primary></indexterm>
443
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_name (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
444
<parameter><link linkend="int"><type>int</type></link> idx</parameter>,
445
<parameter><link linkend="char"><type>char</type></link> *buf</parameter>,
446
<parameter><link linkend="size-t"><type>size_t</type></link> *sizeof_buf</parameter>);</programlisting>
481
448
</para><variablelist role="params">
482
449
<varlistentry><term><parameter>key</parameter> :</term>
483
<listitem><simpara> the structure that contains the OpenPGP public key.
484
451
</simpara></listitem></varlistentry>
485
452
<varlistentry><term><parameter>idx</parameter> :</term>
486
<listitem><simpara> the index of the ID to extract
487
454
</simpara></listitem></varlistentry>
488
455
<varlistentry><term><parameter>buf</parameter> :</term>
489
<listitem><simpara> a pointer to a structure to hold the name
490
457
</simpara></listitem></varlistentry>
491
458
<varlistentry><term><parameter>sizeof_buf</parameter> :</term>
492
<listitem><simpara> holds the maximum size of <parameter>buf</parameter>, on return hold the
493
actual/required size of <parameter>buf</parameter>.
494
460
</simpara></listitem></varlistentry>
495
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, and if the index of the ID
496
does not exist <link linkend="GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE--CAPS"><literal>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</literal></link>, or an
461
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
498
462
</simpara></listitem></varlistentry>
499
463
</variablelist></refsect2>
500
464
<refsect2 id="gnutls-openpgp-crt-get-pk-algorithm" role="function">
501
465
<title>gnutls_openpgp_crt_get_pk_algorithm ()</title>
502
<indexterm zone="gnutls-openpgp-crt-get-pk-algorithm"><primary sortas="gnutls_openpgp_crt_get_pk_algorithm">gnutls_openpgp_crt_get_pk_algorithm</primary></indexterm><programlisting><link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> gnutls_openpgp_crt_get_pk_algorithm
503
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
504
unsigned <link linkend="int">int</link> *bits);</programlisting>
506
This function will return the public key algorithm of an OpenPGP
510
If bits is non null, it should have enough size to hold the parameters
511
size in bits. For RSA the bits returned is the modulus.
512
For DSA the bits returned are of the public exponent.</para>
466
<indexterm zone="gnutls-openpgp-crt-get-pk-algorithm"><primary>gnutls_openpgp_crt_get_pk_algorithm</primary></indexterm>
467
<programlisting><link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> gnutls_openpgp_crt_get_pk_algorithm
468
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
469
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);</programlisting>
514
471
</para><variablelist role="params">
515
472
<varlistentry><term><parameter>key</parameter> :</term>
516
<listitem><simpara> is an OpenPGP key
517
474
</simpara></listitem></varlistentry>
518
475
<varlistentry><term><parameter>bits</parameter> :</term>
519
<listitem><simpara> if bits is non null it will hold the size of the parameters' in bits
520
477
</simpara></listitem></varlistentry>
521
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a member of the <link linkend="gnutls-pk-algorithm-t"><type>gnutls_pk_algorithm_t</type></link> enumeration on
522
success, or a negative value on error.
478
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
523
479
</simpara></listitem></varlistentry>
524
480
</variablelist></refsect2>
525
481
<refsect2 id="gnutls-openpgp-crt-get-version" role="function">
526
482
<title>gnutls_openpgp_crt_get_version ()</title>
527
<indexterm zone="gnutls-openpgp-crt-get-version"><primary sortas="gnutls_openpgp_crt_get_version">gnutls_openpgp_crt_get_version</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_version (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);</programlisting>
529
Extract the version of the OpenPGP key.</para>
483
<indexterm zone="gnutls-openpgp-crt-get-version"><primary>gnutls_openpgp_crt_get_version</primary></indexterm>
484
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_version (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);</programlisting>
531
486
</para><variablelist role="params">
532
487
<varlistentry><term><parameter>key</parameter> :</term>
533
<listitem><simpara> the structure that contains the OpenPGP public key.
534
489
</simpara></listitem></varlistentry>
535
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the version number is returned, or a negative value on errors.
490
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
536
491
</simpara></listitem></varlistentry>
537
492
</variablelist></refsect2>
538
493
<refsect2 id="gnutls-openpgp-crt-get-creation-time" role="function">
539
494
<title>gnutls_openpgp_crt_get_creation_time ()</title>
540
<indexterm zone="gnutls-openpgp-crt-get-creation-time"><primary sortas="gnutls_openpgp_crt_get_creation_time">gnutls_openpgp_crt_get_creation_time</primary></indexterm><programlisting><link linkend="time-t">time_t</link> gnutls_openpgp_crt_get_creation_time
541
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);</programlisting>
543
Get key creation time.</para>
495
<indexterm zone="gnutls-openpgp-crt-get-creation-time"><primary>gnutls_openpgp_crt_get_creation_time</primary></indexterm>
496
<programlisting><link linkend="time-t"><returnvalue>time_t</returnvalue></link> gnutls_openpgp_crt_get_creation_time
497
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);</programlisting>
545
499
</para><variablelist role="params">
546
500
<varlistentry><term><parameter>key</parameter> :</term>
547
<listitem><simpara> the structure that contains the OpenPGP public key.
548
502
</simpara></listitem></varlistentry>
549
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the timestamp when the OpenPGP key was created.
503
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
550
504
</simpara></listitem></varlistentry>
551
505
</variablelist></refsect2>
552
506
<refsect2 id="gnutls-openpgp-crt-get-expiration-time" role="function">
553
507
<title>gnutls_openpgp_crt_get_expiration_time ()</title>
554
<indexterm zone="gnutls-openpgp-crt-get-expiration-time"><primary sortas="gnutls_openpgp_crt_get_expiration_time">gnutls_openpgp_crt_get_expiration_time</primary></indexterm><programlisting><link linkend="time-t">time_t</link> gnutls_openpgp_crt_get_expiration_time
555
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);</programlisting>
557
Get key expiration time. A value of '0' means that the key doesn't
558
expire at all.</para>
508
<indexterm zone="gnutls-openpgp-crt-get-expiration-time"><primary>gnutls_openpgp_crt_get_expiration_time</primary></indexterm>
509
<programlisting><link linkend="time-t"><returnvalue>time_t</returnvalue></link> gnutls_openpgp_crt_get_expiration_time
510
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);</programlisting>
560
512
</para><variablelist role="params">
561
513
<varlistentry><term><parameter>key</parameter> :</term>
562
<listitem><simpara> the structure that contains the OpenPGP public key.
563
515
</simpara></listitem></varlistentry>
564
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the time when the OpenPGP key expires.
516
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
565
517
</simpara></listitem></varlistentry>
566
518
</variablelist></refsect2>
567
<refsect2 id="gnutls-openpgp-crt-get-key-id" role="function" condition="since:2.4.0">
519
<refsect2 id="gnutls-openpgp-crt-get-key-id" role="function">
568
520
<title>gnutls_openpgp_crt_get_key_id ()</title>
569
<indexterm zone="gnutls-openpgp-crt-get-key-id" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_key_id">gnutls_openpgp_crt_get_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_key_id (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
570
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
572
Get key id string.</para>
521
<indexterm zone="gnutls-openpgp-crt-get-key-id"><primary>gnutls_openpgp_crt_get_key_id</primary></indexterm>
522
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_key_id (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
523
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
574
525
</para><variablelist role="params">
575
526
<varlistentry><term><parameter>key</parameter> :</term>
576
<listitem><simpara> the structure that contains the OpenPGP public key.
577
528
</simpara></listitem></varlistentry>
578
529
<varlistentry><term><parameter>keyid</parameter> :</term>
579
<listitem><simpara> the buffer to save the keyid.
580
</simpara></listitem></varlistentry>
581
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the 64-bit keyID of the OpenPGP key.
583
</simpara></listitem></varlistentry>
584
</variablelist><para role="since">Since 2.4.0</para></refsect2>
531
</simpara></listitem></varlistentry>
532
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
533
</simpara></listitem></varlistentry>
534
</variablelist></refsect2>
585
535
<refsect2 id="gnutls-openpgp-crt-check-hostname" role="function">
586
536
<title>gnutls_openpgp_crt_check_hostname ()</title>
587
<indexterm zone="gnutls-openpgp-crt-check-hostname"><primary sortas="gnutls_openpgp_crt_check_hostname">gnutls_openpgp_crt_check_hostname</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_check_hostname (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
588
const <link linkend="char">char</link> *hostname);</programlisting>
590
This function will check if the given key's owner matches the
591
given hostname. This is a basic implementation of the matching
592
described in RFC2818 (HTTPS), which takes into account wildcards.</para>
537
<indexterm zone="gnutls-openpgp-crt-check-hostname"><primary>gnutls_openpgp_crt_check_hostname</primary></indexterm>
538
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_check_hostname (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
539
<parameter>const <link linkend="char"><type>char</type></link> *hostname</parameter>);</programlisting>
594
541
</para><variablelist role="params">
595
542
<varlistentry><term><parameter>key</parameter> :</term>
596
<listitem><simpara> should contain a <link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> structure
597
544
</simpara></listitem></varlistentry>
598
545
<varlistentry><term><parameter>hostname</parameter> :</term>
599
<listitem><simpara> A null terminated string that contains a DNS name
600
547
</simpara></listitem></varlistentry>
601
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
548
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
602
549
</simpara></listitem></varlistentry>
603
550
</variablelist></refsect2>
604
<refsect2 id="gnutls-openpgp-crt-get-revoked-status" role="function" condition="since:2.4.0">
551
<refsect2 id="gnutls-openpgp-crt-get-revoked-status" role="function">
605
552
<title>gnutls_openpgp_crt_get_revoked_status ()</title>
606
<indexterm zone="gnutls-openpgp-crt-get-revoked-status" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_revoked_status">gnutls_openpgp_crt_get_revoked_status</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_revoked_status
607
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);</programlisting>
609
Get revocation status of key.</para>
553
<indexterm zone="gnutls-openpgp-crt-get-revoked-status"><primary>gnutls_openpgp_crt_get_revoked_status</primary></indexterm>
554
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_revoked_status
555
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);</programlisting>
611
557
</para><variablelist role="params">
612
558
<varlistentry><term><parameter>key</parameter> :</term>
613
<listitem><simpara> the structure that contains the OpenPGP public key.
614
</simpara></listitem></varlistentry>
615
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> true (1) if the key has been revoked, or false (0) if it
618
</simpara></listitem></varlistentry>
619
</variablelist><para role="since">Since 2.4.0</para></refsect2>
620
<refsect2 id="gnutls-openpgp-crt-get-subkey-count" role="function" condition="since:2.4.0">
560
</simpara></listitem></varlistentry>
561
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
562
</simpara></listitem></varlistentry>
563
</variablelist></refsect2>
564
<refsect2 id="gnutls-openpgp-crt-get-subkey-count" role="function">
621
565
<title>gnutls_openpgp_crt_get_subkey_count ()</title>
622
<indexterm zone="gnutls-openpgp-crt-get-subkey-count" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_count">gnutls_openpgp_crt_get_subkey_count</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_count (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key);</programlisting>
624
This function will return the number of subkeys present in the
625
given OpenPGP certificate.</para>
566
<indexterm zone="gnutls-openpgp-crt-get-subkey-count"><primary>gnutls_openpgp_crt_get_subkey_count</primary></indexterm>
567
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_count (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>);</programlisting>
627
569
</para><variablelist role="params">
628
570
<varlistentry><term><parameter>key</parameter> :</term>
629
<listitem><simpara> is an OpenPGP key
630
</simpara></listitem></varlistentry>
631
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of subkeys, or a negative value on error.
633
</simpara></listitem></varlistentry>
634
</variablelist><para role="since">Since 2.4.0</para></refsect2>
635
<refsect2 id="gnutls-openpgp-crt-get-subkey-idx" role="function" condition="since:2.4.0">
572
</simpara></listitem></varlistentry>
573
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
574
</simpara></listitem></varlistentry>
575
</variablelist></refsect2>
576
<refsect2 id="gnutls-openpgp-crt-get-subkey-idx" role="function">
636
577
<title>gnutls_openpgp_crt_get_subkey_idx ()</title>
637
<indexterm zone="gnutls-openpgp-crt-get-subkey-idx" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_idx">gnutls_openpgp_crt_get_subkey_idx</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_idx (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
638
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
640
Get subkey's index.</para>
578
<indexterm zone="gnutls-openpgp-crt-get-subkey-idx"><primary>gnutls_openpgp_crt_get_subkey_idx</primary></indexterm>
579
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_idx (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
580
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
642
582
</para><variablelist role="params">
643
583
<varlistentry><term><parameter>key</parameter> :</term>
644
<listitem><simpara> the structure that contains the OpenPGP public key.
645
585
</simpara></listitem></varlistentry>
646
586
<varlistentry><term><parameter>keyid</parameter> :</term>
647
<listitem><simpara> the keyid.
648
</simpara></listitem></varlistentry>
649
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the index of the subkey or a negative error value.
651
</simpara></listitem></varlistentry>
652
</variablelist><para role="since">Since 2.4.0</para></refsect2>
653
<refsect2 id="gnutls-openpgp-crt-get-subkey-revoked-status" role="function" condition="since:2.4.0">
588
</simpara></listitem></varlistentry>
589
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
590
</simpara></listitem></varlistentry>
591
</variablelist></refsect2>
592
<refsect2 id="gnutls-openpgp-crt-get-subkey-revoked-status" role="function">
654
593
<title>gnutls_openpgp_crt_get_subkey_revoked_status ()</title>
655
<indexterm zone="gnutls-openpgp-crt-get-subkey-revoked-status" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_revoked_status">gnutls_openpgp_crt_get_subkey_revoked_status</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_revoked_status
656
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
657
unsigned <link linkend="int">int</link> idx);</programlisting>
659
Get subkey revocation status. A negative value indicates an error.</para>
594
<indexterm zone="gnutls-openpgp-crt-get-subkey-revoked-status"><primary>gnutls_openpgp_crt_get_subkey_revoked_status</primary></indexterm>
595
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_revoked_status
596
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
597
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
661
599
</para><variablelist role="params">
662
600
<varlistentry><term><parameter>key</parameter> :</term>
663
<listitem><simpara> the structure that contains the OpenPGP public key.
664
602
</simpara></listitem></varlistentry>
665
603
<varlistentry><term><parameter>idx</parameter> :</term>
666
<listitem><simpara> is the subkey index
667
</simpara></listitem></varlistentry>
668
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> true (1) if the key has been revoked, or false (0) if it
671
</simpara></listitem></varlistentry>
672
</variablelist><para role="since">Since 2.4.0</para></refsect2>
673
<refsect2 id="gnutls-openpgp-crt-get-subkey-pk-algorithm" role="function" condition="since:2.4.0">
605
</simpara></listitem></varlistentry>
606
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
607
</simpara></listitem></varlistentry>
608
</variablelist></refsect2>
609
<refsect2 id="gnutls-openpgp-crt-get-subkey-pk-algorithm" role="function">
674
610
<title>gnutls_openpgp_crt_get_subkey_pk_algorithm ()</title>
675
<indexterm zone="gnutls-openpgp-crt-get-subkey-pk-algorithm" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_pk_algorithm">gnutls_openpgp_crt_get_subkey_pk_algorithm</primary></indexterm><programlisting><link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> gnutls_openpgp_crt_get_subkey_pk_algorithm
676
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
677
unsigned <link linkend="int">int</link> idx,
678
unsigned <link linkend="int">int</link> *bits);</programlisting>
680
This function will return the public key algorithm of a subkey of an OpenPGP
684
If bits is non null, it should have enough size to hold the
685
parameters size in bits. For RSA the bits returned is the modulus.
686
For DSA the bits returned are of the public exponent.</para>
611
<indexterm zone="gnutls-openpgp-crt-get-subkey-pk-algorithm"><primary>gnutls_openpgp_crt_get_subkey_pk_algorithm</primary></indexterm>
612
<programlisting><link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> gnutls_openpgp_crt_get_subkey_pk_algorithm
613
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
614
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
615
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);</programlisting>
688
617
</para><variablelist role="params">
689
618
<varlistentry><term><parameter>key</parameter> :</term>
690
<listitem><simpara> is an OpenPGP key
691
620
</simpara></listitem></varlistentry>
692
621
<varlistentry><term><parameter>idx</parameter> :</term>
693
<listitem><simpara> is the subkey index
694
623
</simpara></listitem></varlistentry>
695
624
<varlistentry><term><parameter>bits</parameter> :</term>
696
<listitem><simpara> if bits is non null it will hold the size of the parameters' in bits
697
</simpara></listitem></varlistentry>
698
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a member of the <link linkend="gnutls-pk-algorithm-t"><type>gnutls_pk_algorithm_t</type></link> enumeration on
699
success, or a negative value on error.
701
</simpara></listitem></varlistentry>
702
</variablelist><para role="since">Since 2.4.0</para></refsect2>
703
<refsect2 id="gnutls-openpgp-crt-get-subkey-creation-time" role="function" condition="since:2.4.0">
626
</simpara></listitem></varlistentry>
627
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
628
</simpara></listitem></varlistentry>
629
</variablelist></refsect2>
630
<refsect2 id="gnutls-openpgp-crt-get-subkey-creation-time" role="function">
704
631
<title>gnutls_openpgp_crt_get_subkey_creation_time ()</title>
705
<indexterm zone="gnutls-openpgp-crt-get-subkey-creation-time" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_creation_time">gnutls_openpgp_crt_get_subkey_creation_time</primary></indexterm><programlisting><link linkend="time-t">time_t</link> gnutls_openpgp_crt_get_subkey_creation_time
706
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
707
unsigned <link linkend="int">int</link> idx);</programlisting>
709
Get subkey creation time.</para>
632
<indexterm zone="gnutls-openpgp-crt-get-subkey-creation-time"><primary>gnutls_openpgp_crt_get_subkey_creation_time</primary></indexterm>
633
<programlisting><link linkend="time-t"><returnvalue>time_t</returnvalue></link> gnutls_openpgp_crt_get_subkey_creation_time
634
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
635
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
711
637
</para><variablelist role="params">
712
638
<varlistentry><term><parameter>key</parameter> :</term>
713
<listitem><simpara> the structure that contains the OpenPGP public key.
714
640
</simpara></listitem></varlistentry>
715
641
<varlistentry><term><parameter>idx</parameter> :</term>
716
<listitem><simpara> the subkey index
717
</simpara></listitem></varlistentry>
718
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the timestamp when the OpenPGP sub-key was created.
720
</simpara></listitem></varlistentry>
721
</variablelist><para role="since">Since 2.4.0</para></refsect2>
722
<refsect2 id="gnutls-openpgp-crt-get-subkey-expiration-time" role="function" condition="since:2.4.0">
643
</simpara></listitem></varlistentry>
644
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
645
</simpara></listitem></varlistentry>
646
</variablelist></refsect2>
647
<refsect2 id="gnutls-openpgp-crt-get-subkey-expiration-time" role="function">
723
648
<title>gnutls_openpgp_crt_get_subkey_expiration_time ()</title>
724
<indexterm zone="gnutls-openpgp-crt-get-subkey-expiration-time" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_expiration_time">gnutls_openpgp_crt_get_subkey_expiration_time</primary></indexterm><programlisting><link linkend="time-t">time_t</link> gnutls_openpgp_crt_get_subkey_expiration_time
725
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
726
unsigned <link linkend="int">int</link> idx);</programlisting>
728
Get subkey expiration time. A value of '0' means that the key
729
doesn't expire at all.</para>
649
<indexterm zone="gnutls-openpgp-crt-get-subkey-expiration-time"><primary>gnutls_openpgp_crt_get_subkey_expiration_time</primary></indexterm>
650
<programlisting><link linkend="time-t"><returnvalue>time_t</returnvalue></link> gnutls_openpgp_crt_get_subkey_expiration_time
651
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
652
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
731
654
</para><variablelist role="params">
732
655
<varlistentry><term><parameter>key</parameter> :</term>
733
<listitem><simpara> the structure that contains the OpenPGP public key.
734
657
</simpara></listitem></varlistentry>
735
658
<varlistentry><term><parameter>idx</parameter> :</term>
736
<listitem><simpara> the subkey index
737
</simpara></listitem></varlistentry>
738
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the time when the OpenPGP key expires.
740
</simpara></listitem></varlistentry>
741
</variablelist><para role="since">Since 2.4.0</para></refsect2>
660
</simpara></listitem></varlistentry>
661
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
662
</simpara></listitem></varlistentry>
663
</variablelist></refsect2>
742
664
<refsect2 id="gnutls-openpgp-crt-get-subkey-id" role="function">
743
665
<title>gnutls_openpgp_crt_get_subkey_id ()</title>
744
<indexterm zone="gnutls-openpgp-crt-get-subkey-id"><primary sortas="gnutls_openpgp_crt_get_subkey_id">gnutls_openpgp_crt_get_subkey_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_id (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
745
unsigned <link linkend="int">int</link> idx,
746
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
748
Get the subkey's key-id.</para>
666
<indexterm zone="gnutls-openpgp-crt-get-subkey-id"><primary>gnutls_openpgp_crt_get_subkey_id</primary></indexterm>
667
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_id (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
668
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
669
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
750
671
</para><variablelist role="params">
751
672
<varlistentry><term><parameter>key</parameter> :</term>
752
<listitem><simpara> the structure that contains the OpenPGP public key.
753
674
</simpara></listitem></varlistentry>
754
675
<varlistentry><term><parameter>idx</parameter> :</term>
755
<listitem><simpara> the subkey index
756
677
</simpara></listitem></varlistentry>
757
678
<varlistentry><term><parameter>keyid</parameter> :</term>
758
<listitem><simpara> the buffer to save the keyid.
759
680
</simpara></listitem></varlistentry>
760
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the 64-bit keyID of the OpenPGP key.
681
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
761
682
</simpara></listitem></varlistentry>
762
683
</variablelist></refsect2>
763
<refsect2 id="gnutls-openpgp-crt-get-subkey-usage" role="function" condition="since:2.4.0">
684
<refsect2 id="gnutls-openpgp-crt-get-subkey-usage" role="function">
764
685
<title>gnutls_openpgp_crt_get_subkey_usage ()</title>
765
<indexterm zone="gnutls-openpgp-crt-get-subkey-usage" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_usage">gnutls_openpgp_crt_get_subkey_usage</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_usage (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
766
unsigned <link linkend="int">int</link> idx,
767
unsigned <link linkend="int">int</link> *key_usage);</programlisting>
769
This function will return certificate's key usage, by checking the
770
key algorithm. The key usage value will ORed values of
771
<link linkend="GNUTLS-KEY-DIGITAL-SIGNATURE--CAPS"><literal>GNUTLS_KEY_DIGITAL_SIGNATURE</literal></link> or <link linkend="GNUTLS-KEY-KEY-ENCIPHERMENT--CAPS"><literal>GNUTLS_KEY_KEY_ENCIPHERMENT</literal></link>.
774
A negative value may be returned in case of parsing error.</para>
686
<indexterm zone="gnutls-openpgp-crt-get-subkey-usage"><primary>gnutls_openpgp_crt_get_subkey_usage</primary></indexterm>
687
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_usage (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
688
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
689
<parameter>unsigned <link linkend="int"><type>int</type></link> *key_usage</parameter>);</programlisting>
776
691
</para><variablelist role="params">
777
692
<varlistentry><term><parameter>key</parameter> :</term>
778
<listitem><simpara> should contain a gnutls_openpgp_crt_t structure
779
694
</simpara></listitem></varlistentry>
780
695
<varlistentry><term><parameter>idx</parameter> :</term>
781
<listitem><simpara> the subkey index
782
697
</simpara></listitem></varlistentry>
783
698
<varlistentry><term><parameter>key_usage</parameter> :</term>
784
<listitem><simpara> where the key usage bits will be stored
785
</simpara></listitem></varlistentry>
786
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> key usage value.
788
</simpara></listitem></varlistentry>
789
</variablelist><para role="since">Since 2.4.0</para></refsect2>
790
<refsect2 id="gnutls-openpgp-crt-get-subkey-pk-dsa-raw" role="function" condition="since:2.4.0">
700
</simpara></listitem></varlistentry>
701
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
702
</simpara></listitem></varlistentry>
703
</variablelist></refsect2>
704
<refsect2 id="gnutls-openpgp-crt-get-subkey-pk-dsa-raw" role="function">
791
705
<title>gnutls_openpgp_crt_get_subkey_pk_dsa_raw ()</title>
792
<indexterm zone="gnutls-openpgp-crt-get-subkey-pk-dsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_pk_dsa_raw">gnutls_openpgp_crt_get_subkey_pk_dsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_pk_dsa_raw
793
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
794
unsigned <link linkend="int">int</link> idx,
795
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
796
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
797
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
798
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y);</programlisting>
800
This function will export the DSA public key's parameters found in
801
the given certificate. The new parameters will be allocated using
802
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
706
<indexterm zone="gnutls-openpgp-crt-get-subkey-pk-dsa-raw"><primary>gnutls_openpgp_crt_get_subkey_pk_dsa_raw</primary></indexterm>
707
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_pk_dsa_raw
708
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
709
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
710
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
711
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
712
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
713
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>);</programlisting>
804
715
</para><variablelist role="params">
805
716
<varlistentry><term><parameter>crt</parameter> :</term>
806
<listitem><simpara> Holds the certificate
807
718
</simpara></listitem></varlistentry>
808
719
<varlistentry><term><parameter>idx</parameter> :</term>
809
<listitem><simpara> Is the subkey index
810
721
</simpara></listitem></varlistentry>
811
722
<varlistentry><term><parameter>p</parameter> :</term>
812
<listitem><simpara> will hold the p
813
724
</simpara></listitem></varlistentry>
814
725
<varlistentry><term><parameter>q</parameter> :</term>
815
<listitem><simpara> will hold the q
816
727
</simpara></listitem></varlistentry>
817
728
<varlistentry><term><parameter>g</parameter> :</term>
818
<listitem><simpara> will hold the g
819
730
</simpara></listitem></varlistentry>
820
731
<varlistentry><term><parameter>y</parameter> :</term>
821
<listitem><simpara> will hold the y
822
</simpara></listitem></varlistentry>
823
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
825
</simpara></listitem></varlistentry>
826
</variablelist><para role="since">Since 2.4.0</para></refsect2>
827
<refsect2 id="gnutls-openpgp-crt-get-subkey-pk-rsa-raw" role="function" condition="since:2.4.0">
733
</simpara></listitem></varlistentry>
734
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
735
</simpara></listitem></varlistentry>
736
</variablelist></refsect2>
737
<refsect2 id="gnutls-openpgp-crt-get-subkey-pk-rsa-raw" role="function">
828
738
<title>gnutls_openpgp_crt_get_subkey_pk_rsa_raw ()</title>
829
<indexterm zone="gnutls-openpgp-crt-get-subkey-pk-rsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_subkey_pk_rsa_raw">gnutls_openpgp_crt_get_subkey_pk_rsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_subkey_pk_rsa_raw
830
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
831
unsigned <link linkend="int">int</link> idx,
832
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
833
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e);</programlisting>
835
This function will export the RSA public key's parameters found in
836
the given structure. The new parameters will be allocated using
837
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
739
<indexterm zone="gnutls-openpgp-crt-get-subkey-pk-rsa-raw"><primary>gnutls_openpgp_crt_get_subkey_pk_rsa_raw</primary></indexterm>
740
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_subkey_pk_rsa_raw
741
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
742
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
743
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
744
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>);</programlisting>
839
746
</para><variablelist role="params">
840
747
<varlistentry><term><parameter>crt</parameter> :</term>
841
<listitem><simpara> Holds the certificate
842
749
</simpara></listitem></varlistentry>
843
750
<varlistentry><term><parameter>idx</parameter> :</term>
844
<listitem><simpara> Is the subkey index
845
752
</simpara></listitem></varlistentry>
846
753
<varlistentry><term><parameter>m</parameter> :</term>
847
<listitem><simpara> will hold the modulus
848
755
</simpara></listitem></varlistentry>
849
756
<varlistentry><term><parameter>e</parameter> :</term>
850
<listitem><simpara> will hold the public exponent
851
</simpara></listitem></varlistentry>
852
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
854
</simpara></listitem></varlistentry>
855
</variablelist><para role="since">Since 2.4.0</para></refsect2>
856
<refsect2 id="gnutls-openpgp-crt-get-pk-dsa-raw" role="function" condition="since:2.4.0">
758
</simpara></listitem></varlistentry>
759
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
760
</simpara></listitem></varlistentry>
761
</variablelist></refsect2>
762
<refsect2 id="gnutls-openpgp-crt-get-pk-dsa-raw" role="function">
857
763
<title>gnutls_openpgp_crt_get_pk_dsa_raw ()</title>
858
<indexterm zone="gnutls-openpgp-crt-get-pk-dsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_pk_dsa_raw">gnutls_openpgp_crt_get_pk_dsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_pk_dsa_raw (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
859
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
860
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
861
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
862
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y);</programlisting>
864
This function will export the DSA public key's parameters found in
865
the given certificate. The new parameters will be allocated using
866
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
764
<indexterm zone="gnutls-openpgp-crt-get-pk-dsa-raw"><primary>gnutls_openpgp_crt_get_pk_dsa_raw</primary></indexterm>
765
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_pk_dsa_raw (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
766
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
767
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
768
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
769
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>);</programlisting>
868
771
</para><variablelist role="params">
869
772
<varlistentry><term><parameter>crt</parameter> :</term>
870
<listitem><simpara> Holds the certificate
871
774
</simpara></listitem></varlistentry>
872
775
<varlistentry><term><parameter>p</parameter> :</term>
873
<listitem><simpara> will hold the p
874
777
</simpara></listitem></varlistentry>
875
778
<varlistentry><term><parameter>q</parameter> :</term>
876
<listitem><simpara> will hold the q
877
780
</simpara></listitem></varlistentry>
878
781
<varlistentry><term><parameter>g</parameter> :</term>
879
<listitem><simpara> will hold the g
880
783
</simpara></listitem></varlistentry>
881
784
<varlistentry><term><parameter>y</parameter> :</term>
882
<listitem><simpara> will hold the y
883
</simpara></listitem></varlistentry>
884
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
886
</simpara></listitem></varlistentry>
887
</variablelist><para role="since">Since 2.4.0</para></refsect2>
888
<refsect2 id="gnutls-openpgp-crt-get-pk-rsa-raw" role="function" condition="since:2.4.0">
786
</simpara></listitem></varlistentry>
787
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
788
</simpara></listitem></varlistentry>
789
</variablelist></refsect2>
790
<refsect2 id="gnutls-openpgp-crt-get-pk-rsa-raw" role="function">
889
791
<title>gnutls_openpgp_crt_get_pk_rsa_raw ()</title>
890
<indexterm zone="gnutls-openpgp-crt-get-pk-rsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_crt_get_pk_rsa_raw">gnutls_openpgp_crt_get_pk_rsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_pk_rsa_raw (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
891
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
892
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e);</programlisting>
894
This function will export the RSA public key's parameters found in
895
the given structure. The new parameters will be allocated using
896
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
792
<indexterm zone="gnutls-openpgp-crt-get-pk-rsa-raw"><primary>gnutls_openpgp_crt_get_pk_rsa_raw</primary></indexterm>
793
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_pk_rsa_raw (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
794
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
795
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>);</programlisting>
898
797
</para><variablelist role="params">
899
798
<varlistentry><term><parameter>crt</parameter> :</term>
900
<listitem><simpara> Holds the certificate
901
800
</simpara></listitem></varlistentry>
902
801
<varlistentry><term><parameter>m</parameter> :</term>
903
<listitem><simpara> will hold the modulus
904
803
</simpara></listitem></varlistentry>
905
804
<varlistentry><term><parameter>e</parameter> :</term>
906
<listitem><simpara> will hold the public exponent
907
</simpara></listitem></varlistentry>
908
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
910
</simpara></listitem></varlistentry>
911
</variablelist><para role="since">Since 2.4.0</para></refsect2>
806
</simpara></listitem></varlistentry>
807
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
808
</simpara></listitem></varlistentry>
809
</variablelist></refsect2>
912
810
<refsect2 id="gnutls-openpgp-crt-get-preferred-key-id" role="function">
913
811
<title>gnutls_openpgp_crt_get_preferred_key_id ()</title>
914
<indexterm zone="gnutls-openpgp-crt-get-preferred-key-id"><primary sortas="gnutls_openpgp_crt_get_preferred_key_id">gnutls_openpgp_crt_get_preferred_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_preferred_key_id
915
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
916
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
918
Get preferred key id. If it hasn't been set it returns
919
<link linkend="GNUTLS-E-INVALID-REQUEST--CAPS"><literal>GNUTLS_E_INVALID_REQUEST</literal></link>.</para>
812
<indexterm zone="gnutls-openpgp-crt-get-preferred-key-id"><primary>gnutls_openpgp_crt_get_preferred_key_id</primary></indexterm>
813
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_preferred_key_id
814
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
815
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
921
817
</para><variablelist role="params">
922
818
<varlistentry><term><parameter>key</parameter> :</term>
923
<listitem><simpara> the structure that contains the OpenPGP public key.
924
820
</simpara></listitem></varlistentry>
925
821
<varlistentry><term><parameter>keyid</parameter> :</term>
926
<listitem><simpara> the struct to save the keyid.
927
823
</simpara></listitem></varlistentry>
928
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the 64-bit preferred keyID of the OpenPGP key.
824
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
929
825
</simpara></listitem></varlistentry>
930
826
</variablelist></refsect2>
931
827
<refsect2 id="gnutls-openpgp-crt-set-preferred-key-id" role="function">
932
828
<title>gnutls_openpgp_crt_set_preferred_key_id ()</title>
933
<indexterm zone="gnutls-openpgp-crt-set-preferred-key-id"><primary sortas="gnutls_openpgp_crt_set_preferred_key_id">gnutls_openpgp_crt_set_preferred_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_set_preferred_key_id
934
(<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
935
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
937
This allows setting a preferred key id for the given certificate.
938
This key will be used by functions that involve key handling.</para>
829
<indexterm zone="gnutls-openpgp-crt-set-preferred-key-id"><primary>gnutls_openpgp_crt_set_preferred_key_id</primary></indexterm>
830
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_set_preferred_key_id
831
(<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
832
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
940
834
</para><variablelist role="params">
941
835
<varlistentry><term><parameter>key</parameter> :</term>
942
<listitem><simpara> the structure that contains the OpenPGP public key.
943
837
</simpara></listitem></varlistentry>
944
838
<varlistentry><term><parameter>keyid</parameter> :</term>
945
<listitem><simpara> the selected keyid
946
840
</simpara></listitem></varlistentry>
947
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> (zero) is returned,
948
otherwise an error code is returned.
841
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
949
842
</simpara></listitem></varlistentry>
950
843
</variablelist></refsect2>
951
844
<refsect2 id="gnutls-openpgp-privkey-init" role="function">
952
845
<title>gnutls_openpgp_privkey_init ()</title>
953
<indexterm zone="gnutls-openpgp-privkey-init"><primary sortas="gnutls_openpgp_privkey_init">gnutls_openpgp_privkey_init</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_init (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> *key);</programlisting>
955
This function will initialize an OpenPGP key structure.</para>
846
<indexterm zone="gnutls-openpgp-privkey-init"><primary>gnutls_openpgp_privkey_init</primary></indexterm>
847
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_init (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> *key</parameter>);</programlisting>
957
849
</para><variablelist role="params">
958
850
<varlistentry><term><parameter>key</parameter> :</term>
959
<listitem><simpara> The structure to be initialized
960
852
</simpara></listitem></varlistentry>
961
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
853
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
962
854
</simpara></listitem></varlistentry>
963
855
</variablelist></refsect2>
964
856
<refsect2 id="gnutls-openpgp-privkey-deinit" role="function">
965
857
<title>gnutls_openpgp_privkey_deinit ()</title>
966
<indexterm zone="gnutls-openpgp-privkey-deinit"><primary sortas="gnutls_openpgp_privkey_deinit">gnutls_openpgp_privkey_deinit</primary></indexterm><programlisting><link linkend="void">void</link> gnutls_openpgp_privkey_deinit (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key);</programlisting>
968
This function will deinitialize a key structure.</para>
858
<indexterm zone="gnutls-openpgp-privkey-deinit"><primary>gnutls_openpgp_privkey_deinit</primary></indexterm>
859
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> gnutls_openpgp_privkey_deinit (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>);</programlisting>
970
861
</para><variablelist role="params">
971
862
<varlistentry><term><parameter>key</parameter> :</term>
972
<listitem><simpara> The structure to be initialized
973
864
</simpara></listitem></varlistentry>
974
865
</variablelist></refsect2>
975
<refsect2 id="gnutls-openpgp-privkey-get-pk-algorithm" role="function" condition="since:2.4.0">
866
<refsect2 id="gnutls-openpgp-privkey-get-pk-algorithm" role="function">
976
867
<title>gnutls_openpgp_privkey_get_pk_algorithm ()</title>
977
<indexterm zone="gnutls-openpgp-privkey-get-pk-algorithm" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_pk_algorithm">gnutls_openpgp_privkey_get_pk_algorithm</primary></indexterm><programlisting><link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> gnutls_openpgp_privkey_get_pk_algorithm
978
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
979
unsigned <link linkend="int">int</link> *bits);</programlisting>
981
This function will return the public key algorithm of an OpenPGP
985
If bits is non null, it should have enough size to hold the parameters
986
size in bits. For RSA the bits returned is the modulus.
987
For DSA the bits returned are of the public exponent.</para>
868
<indexterm zone="gnutls-openpgp-privkey-get-pk-algorithm"><primary>gnutls_openpgp_privkey_get_pk_algorithm</primary></indexterm>
869
<programlisting><link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> gnutls_openpgp_privkey_get_pk_algorithm
870
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
871
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);</programlisting>
989
873
</para><variablelist role="params">
990
874
<varlistentry><term><parameter>key</parameter> :</term>
991
<listitem><simpara> is an OpenPGP key
992
876
</simpara></listitem></varlistentry>
993
877
<varlistentry><term><parameter>bits</parameter> :</term>
994
<listitem><simpara> if bits is non null it will hold the size of the parameters' in bits
995
</simpara></listitem></varlistentry>
996
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a member of the <link linkend="gnutls-pk-algorithm-t"><type>gnutls_pk_algorithm_t</type></link> enumeration on
997
success, or a negative value on error.
999
</simpara></listitem></varlistentry>
1000
</variablelist><para role="since">Since 2.4.0</para></refsect2>
879
</simpara></listitem></varlistentry>
880
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
881
</simpara></listitem></varlistentry>
882
</variablelist></refsect2>
1001
883
<refsect2 id="gnutls-openpgp-privkey-import" role="function">
1002
884
<title>gnutls_openpgp_privkey_import ()</title>
1003
<indexterm zone="gnutls-openpgp-privkey-import"><primary sortas="gnutls_openpgp_privkey_import">gnutls_openpgp_privkey_import</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_import (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1004
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
1005
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format,
1006
const <link linkend="char">char</link> *password,
1007
unsigned <link linkend="int">int</link> flags);</programlisting>
1009
This function will convert the given RAW or Base64 encoded key to
1010
the native gnutls_openpgp_privkey_t format. The output will be
1011
stored in 'key'.</para>
885
<indexterm zone="gnutls-openpgp-privkey-import"><primary>gnutls_openpgp_privkey_import</primary></indexterm>
886
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_import (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
887
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
888
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>,
889
<parameter>const <link linkend="char"><type>char</type></link> *password</parameter>,
890
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);</programlisting>
1013
892
</para><variablelist role="params">
1014
893
<varlistentry><term><parameter>key</parameter> :</term>
1015
<listitem><simpara> The structure to store the parsed key.
1016
895
</simpara></listitem></varlistentry>
1017
896
<varlistentry><term><parameter>data</parameter> :</term>
1018
<listitem><simpara> The RAW or BASE64 encoded key.
1019
898
</simpara></listitem></varlistentry>
1020
899
<varlistentry><term><parameter>format</parameter> :</term>
1021
<listitem><simpara> One of <link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> elements.
1022
901
</simpara></listitem></varlistentry>
1023
902
<varlistentry><term><parameter>password</parameter> :</term>
1024
<listitem><simpara> not used for now
1025
904
</simpara></listitem></varlistentry>
1026
905
<varlistentry><term><parameter>flags</parameter> :</term>
1027
<listitem><simpara> should be zero
1028
907
</simpara></listitem></varlistentry>
1029
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
908
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1030
909
</simpara></listitem></varlistentry>
1031
910
</variablelist></refsect2>
1032
911
<refsect2 id="gnutls-openpgp-privkey-sign-hash" role="function">
1033
912
<title>gnutls_openpgp_privkey_sign_hash ()</title>
1034
<indexterm zone="gnutls-openpgp-privkey-sign-hash"><primary sortas="gnutls_openpgp_privkey_sign_hash">gnutls_openpgp_privkey_sign_hash</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_sign_hash (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1035
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *hash,
1036
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *signature);</programlisting>
1038
This function will sign the given hash using the private key. You
1039
should use <link linkend="gnutls-openpgp-privkey-set-subkey"><function>gnutls_openpgp_privkey_set_subkey()</function></link> before calling this
1040
function to set the subkey to use.</para>
913
<indexterm zone="gnutls-openpgp-privkey-sign-hash"><primary>gnutls_openpgp_privkey_sign_hash</primary></indexterm>
914
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_sign_hash (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
915
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *hash</parameter>,
916
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *signature</parameter>);</programlisting>
1042
918
</para><variablelist role="params">
1043
919
<varlistentry><term><parameter>key</parameter> :</term>
1044
<listitem><simpara> Holds the key
1045
921
</simpara></listitem></varlistentry>
1046
922
<varlistentry><term><parameter>hash</parameter> :</term>
1047
<listitem><simpara> holds the data to be signed
1048
924
</simpara></listitem></varlistentry>
1049
925
<varlistentry><term><parameter>signature</parameter> :</term>
1050
<listitem><simpara> will contain newly allocated signature
1051
927
</simpara></listitem></varlistentry>
1052
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1053
negative error value.
928
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1054
929
</simpara></listitem></varlistentry>
1055
930
</variablelist></refsect2>
1056
<refsect2 id="gnutls-openpgp-privkey-get-fingerprint" role="function" condition="since:2.4.0">
931
<refsect2 id="gnutls-openpgp-privkey-get-fingerprint" role="function">
1057
932
<title>gnutls_openpgp_privkey_get_fingerprint ()</title>
1058
<indexterm zone="gnutls-openpgp-privkey-get-fingerprint" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_fingerprint">gnutls_openpgp_privkey_get_fingerprint</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_fingerprint
1059
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1060
<link linkend="void">void</link> *fpr,
1061
<link linkend="size-t">size_t</link> *fprlen);</programlisting>
1063
Get the fingerprint of the OpenPGP key. Depends on the
1064
algorithm, the fingerprint can be 16 or 20 bytes.</para>
933
<indexterm zone="gnutls-openpgp-privkey-get-fingerprint"><primary>gnutls_openpgp_privkey_get_fingerprint</primary></indexterm>
934
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_fingerprint
935
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
936
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
937
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);</programlisting>
1066
939
</para><variablelist role="params">
1067
940
<varlistentry><term><parameter>key</parameter> :</term>
1068
<listitem><simpara> the raw data that contains the OpenPGP secret key.
1069
942
</simpara></listitem></varlistentry>
1070
943
<varlistentry><term><parameter>fpr</parameter> :</term>
1071
<listitem><simpara> the buffer to save the fingerprint, must hold at least 20 bytes.
1072
945
</simpara></listitem></varlistentry>
1073
946
<varlistentry><term><parameter>fprlen</parameter> :</term>
1074
<listitem><simpara> the integer to save the length of the fingerprint.
1075
</simpara></listitem></varlistentry>
1076
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, 0 is returned, or an error code.
1078
</simpara></listitem></varlistentry>
1079
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1080
<refsect2 id="gnutls-openpgp-privkey-get-subkey-fingerprint" role="function" condition="since:2.4.0">
948
</simpara></listitem></varlistentry>
949
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
950
</simpara></listitem></varlistentry>
951
</variablelist></refsect2>
952
<refsect2 id="gnutls-openpgp-privkey-get-subkey-fingerprint" role="function">
1081
953
<title>gnutls_openpgp_privkey_get_subkey_fingerprint ()</title>
1082
<indexterm zone="gnutls-openpgp-privkey-get-subkey-fingerprint" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_fingerprint">gnutls_openpgp_privkey_get_subkey_fingerprint</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_subkey_fingerprint
1083
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1084
unsigned <link linkend="int">int</link> idx,
1085
<link linkend="void">void</link> *fpr,
1086
<link linkend="size-t">size_t</link> *fprlen);</programlisting>
1088
Get the fingerprint of an OpenPGP subkey. Depends on the
1089
algorithm, the fingerprint can be 16 or 20 bytes.</para>
954
<indexterm zone="gnutls-openpgp-privkey-get-subkey-fingerprint"><primary>gnutls_openpgp_privkey_get_subkey_fingerprint</primary></indexterm>
955
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_subkey_fingerprint
956
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
957
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
958
<parameter><link linkend="void"><type>void</type></link> *fpr</parameter>,
959
<parameter><link linkend="size-t"><type>size_t</type></link> *fprlen</parameter>);</programlisting>
1091
961
</para><variablelist role="params">
1092
962
<varlistentry><term><parameter>key</parameter> :</term>
1093
<listitem><simpara> the raw data that contains the OpenPGP secret key.
1094
964
</simpara></listitem></varlistentry>
1095
965
<varlistentry><term><parameter>idx</parameter> :</term>
1096
<listitem><simpara> the subkey index
1097
967
</simpara></listitem></varlistentry>
1098
968
<varlistentry><term><parameter>fpr</parameter> :</term>
1099
<listitem><simpara> the buffer to save the fingerprint, must hold at least 20 bytes.
1100
970
</simpara></listitem></varlistentry>
1101
971
<varlistentry><term><parameter>fprlen</parameter> :</term>
1102
<listitem><simpara> the integer to save the length of the fingerprint.
1103
</simpara></listitem></varlistentry>
1104
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, 0 is returned, or an error code.
1106
</simpara></listitem></varlistentry>
1107
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1108
<refsect2 id="gnutls-openpgp-privkey-get-key-id" role="function" condition="since:2.4.0">
973
</simpara></listitem></varlistentry>
974
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
975
</simpara></listitem></varlistentry>
976
</variablelist></refsect2>
977
<refsect2 id="gnutls-openpgp-privkey-get-key-id" role="function">
1109
978
<title>gnutls_openpgp_privkey_get_key_id ()</title>
1110
<indexterm zone="gnutls-openpgp-privkey-get-key-id" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_key_id">gnutls_openpgp_privkey_get_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_key_id (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1111
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
979
<indexterm zone="gnutls-openpgp-privkey-get-key-id"><primary>gnutls_openpgp_privkey_get_key_id</primary></indexterm>
980
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_key_id (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
981
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
1115
983
</para><variablelist role="params">
1116
984
<varlistentry><term><parameter>key</parameter> :</term>
1117
<listitem><simpara> the structure that contains the OpenPGP secret key.
1118
986
</simpara></listitem></varlistentry>
1119
987
<varlistentry><term><parameter>keyid</parameter> :</term>
1120
<listitem><simpara> the buffer to save the keyid.
1121
</simpara></listitem></varlistentry>
1122
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the 64-bit keyID of the OpenPGP key.
1124
</simpara></listitem></varlistentry>
1125
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1126
<refsect2 id="gnutls-openpgp-privkey-get-subkey-count" role="function" condition="since:2.4.0">
989
</simpara></listitem></varlistentry>
990
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
991
</simpara></listitem></varlistentry>
992
</variablelist></refsect2>
993
<refsect2 id="gnutls-openpgp-privkey-get-subkey-count" role="function">
1127
994
<title>gnutls_openpgp_privkey_get_subkey_count ()</title>
1128
<indexterm zone="gnutls-openpgp-privkey-get-subkey-count" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_count">gnutls_openpgp_privkey_get_subkey_count</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_subkey_count
1129
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key);</programlisting>
1131
This function will return the number of subkeys present in the
1132
given OpenPGP certificate.</para>
995
<indexterm zone="gnutls-openpgp-privkey-get-subkey-count"><primary>gnutls_openpgp_privkey_get_subkey_count</primary></indexterm>
996
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_subkey_count
997
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>);</programlisting>
1134
999
</para><variablelist role="params">
1135
1000
<varlistentry><term><parameter>key</parameter> :</term>
1136
<listitem><simpara> is an OpenPGP key
1137
</simpara></listitem></varlistentry>
1138
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of subkeys, or a negative value on error.
1140
</simpara></listitem></varlistentry>
1141
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1142
<refsect2 id="gnutls-openpgp-privkey-get-subkey-idx" role="function" condition="since:2.4.0">
1002
</simpara></listitem></varlistentry>
1003
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1004
</simpara></listitem></varlistentry>
1005
</variablelist></refsect2>
1006
<refsect2 id="gnutls-openpgp-privkey-get-subkey-idx" role="function">
1143
1007
<title>gnutls_openpgp_privkey_get_subkey_idx ()</title>
1144
<indexterm zone="gnutls-openpgp-privkey-get-subkey-idx" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_idx">gnutls_openpgp_privkey_get_subkey_idx</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_subkey_idx
1145
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1146
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
1148
Get index of subkey.</para>
1008
<indexterm zone="gnutls-openpgp-privkey-get-subkey-idx"><primary>gnutls_openpgp_privkey_get_subkey_idx</primary></indexterm>
1009
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_subkey_idx
1010
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1011
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
1150
1013
</para><variablelist role="params">
1151
1014
<varlistentry><term><parameter>key</parameter> :</term>
1152
<listitem><simpara> the structure that contains the OpenPGP private key.
1153
1016
</simpara></listitem></varlistentry>
1154
1017
<varlistentry><term><parameter>keyid</parameter> :</term>
1155
<listitem><simpara> the keyid.
1156
</simpara></listitem></varlistentry>
1157
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the index of the subkey or a negative error value.
1159
</simpara></listitem></varlistentry>
1160
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1019
</simpara></listitem></varlistentry>
1020
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1021
</simpara></listitem></varlistentry>
1022
</variablelist></refsect2>
1161
1023
<refsect2 id="gnutls-openpgp-privkey-get-subkey-revoked-status" role="function">
1162
1024
<title>gnutls_openpgp_privkey_get_subkey_revoked_status ()</title>
1163
<indexterm zone="gnutls-openpgp-privkey-get-subkey-revoked-status"><primary sortas="gnutls_openpgp_privkey_get_subkey_revoked_status">gnutls_openpgp_privkey_get_subkey_revoked_status</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_subkey_revoked_status
1164
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1165
unsigned <link linkend="int">int</link> idx);</programlisting>
1025
<indexterm zone="gnutls-openpgp-privkey-get-subkey-revoked-status"><primary>gnutls_openpgp_privkey_get_subkey_revoked_status</primary></indexterm>
1026
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_subkey_revoked_status
1027
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1028
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
1167
1030
</para><variablelist role="params">
1168
1031
<varlistentry><term><parameter>key</parameter> :</term>
1186
1050
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1187
1051
</simpara></listitem></varlistentry>
1188
1052
</variablelist></refsect2>
1189
<refsect2 id="gnutls-openpgp-privkey-get-subkey-pk-algorithm" role="function" condition="since:2.4.0">
1053
<refsect2 id="gnutls-openpgp-privkey-get-subkey-pk-algorithm" role="function">
1190
1054
<title>gnutls_openpgp_privkey_get_subkey_pk_algorithm ()</title>
1191
<indexterm zone="gnutls-openpgp-privkey-get-subkey-pk-algorithm" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_pk_algorithm">gnutls_openpgp_privkey_get_subkey_pk_algorithm</primary></indexterm><programlisting><link linkend="gnutls-pk-algorithm-t">gnutls_pk_algorithm_t</link> gnutls_openpgp_privkey_get_subkey_pk_algorithm
1192
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1193
unsigned <link linkend="int">int</link> idx,
1194
unsigned <link linkend="int">int</link> *bits);</programlisting>
1196
This function will return the public key algorithm of a subkey of an OpenPGP
1200
If bits is non null, it should have enough size to hold the parameters
1201
size in bits. For RSA the bits returned is the modulus.
1202
For DSA the bits returned are of the public exponent.</para>
1055
<indexterm zone="gnutls-openpgp-privkey-get-subkey-pk-algorithm"><primary>gnutls_openpgp_privkey_get_subkey_pk_algorithm</primary></indexterm>
1056
<programlisting><link linkend="gnutls-pk-algorithm-t"><returnvalue>gnutls_pk_algorithm_t</returnvalue></link> gnutls_openpgp_privkey_get_subkey_pk_algorithm
1057
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1058
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
1059
<parameter>unsigned <link linkend="int"><type>int</type></link> *bits</parameter>);</programlisting>
1204
1061
</para><variablelist role="params">
1205
1062
<varlistentry><term><parameter>key</parameter> :</term>
1206
<listitem><simpara> is an OpenPGP key
1207
1064
</simpara></listitem></varlistentry>
1208
1065
<varlistentry><term><parameter>idx</parameter> :</term>
1209
<listitem><simpara> is the subkey index
1210
1067
</simpara></listitem></varlistentry>
1211
1068
<varlistentry><term><parameter>bits</parameter> :</term>
1212
<listitem><simpara> if bits is non null it will hold the size of the parameters' in bits
1213
</simpara></listitem></varlistentry>
1214
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a member of the <link linkend="gnutls-pk-algorithm-t"><type>gnutls_pk_algorithm_t</type></link> enumeration on
1215
success, or a negative value on error.
1217
</simpara></listitem></varlistentry>
1218
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1219
<refsect2 id="gnutls-openpgp-privkey-get-subkey-expiration-time" role="function" condition="since:2.4.0">
1070
</simpara></listitem></varlistentry>
1071
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1072
</simpara></listitem></varlistentry>
1073
</variablelist></refsect2>
1074
<refsect2 id="gnutls-openpgp-privkey-get-subkey-expiration-time" role="function">
1220
1075
<title>gnutls_openpgp_privkey_get_subkey_expiration_time ()</title>
1221
<indexterm zone="gnutls-openpgp-privkey-get-subkey-expiration-time" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_expiration_time">gnutls_openpgp_privkey_get_subkey_expiration_time</primary></indexterm><programlisting><link linkend="time-t">time_t</link> gnutls_openpgp_privkey_get_subkey_expiration_time
1222
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1223
unsigned <link linkend="int">int</link> idx);</programlisting>
1225
Get subkey expiration time. A value of '0' means that the key
1226
doesn't expire at all.</para>
1076
<indexterm zone="gnutls-openpgp-privkey-get-subkey-expiration-time"><primary>gnutls_openpgp_privkey_get_subkey_expiration_time</primary></indexterm>
1077
<programlisting><link linkend="time-t"><returnvalue>time_t</returnvalue></link> gnutls_openpgp_privkey_get_subkey_expiration_time
1078
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1079
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
1228
1081
</para><variablelist role="params">
1229
1082
<varlistentry><term><parameter>key</parameter> :</term>
1230
<listitem><simpara> the structure that contains the OpenPGP private key.
1231
1084
</simpara></listitem></varlistentry>
1232
1085
<varlistentry><term><parameter>idx</parameter> :</term>
1233
<listitem><simpara> the subkey index
1234
</simpara></listitem></varlistentry>
1235
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the time when the OpenPGP key expires.
1237
</simpara></listitem></varlistentry>
1238
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1239
<refsect2 id="gnutls-openpgp-privkey-get-subkey-id" role="function" condition="since:2.4.0">
1087
</simpara></listitem></varlistentry>
1088
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1089
</simpara></listitem></varlistentry>
1090
</variablelist></refsect2>
1091
<refsect2 id="gnutls-openpgp-privkey-get-subkey-id" role="function">
1240
1092
<title>gnutls_openpgp_privkey_get_subkey_id ()</title>
1241
<indexterm zone="gnutls-openpgp-privkey-get-subkey-id" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_id">gnutls_openpgp_privkey_get_subkey_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_subkey_id
1242
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1243
unsigned <link linkend="int">int</link> idx,
1244
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
1246
Get the key-id for the subkey.</para>
1093
<indexterm zone="gnutls-openpgp-privkey-get-subkey-id"><primary>gnutls_openpgp_privkey_get_subkey_id</primary></indexterm>
1094
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_subkey_id
1095
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1096
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
1097
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
1248
1099
</para><variablelist role="params">
1249
1100
<varlistentry><term><parameter>key</parameter> :</term>
1250
<listitem><simpara> the structure that contains the OpenPGP secret key.
1251
1102
</simpara></listitem></varlistentry>
1252
1103
<varlistentry><term><parameter>idx</parameter> :</term>
1253
<listitem><simpara> the subkey index
1254
1105
</simpara></listitem></varlistentry>
1255
1106
<varlistentry><term><parameter>keyid</parameter> :</term>
1256
<listitem><simpara> the buffer to save the keyid.
1257
</simpara></listitem></varlistentry>
1258
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the 64-bit keyID of the OpenPGP key.
1260
</simpara></listitem></varlistentry>
1261
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1262
<refsect2 id="gnutls-openpgp-privkey-get-subkey-creation-time" role="function" condition="since:2.4.0">
1108
</simpara></listitem></varlistentry>
1109
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1110
</simpara></listitem></varlistentry>
1111
</variablelist></refsect2>
1112
<refsect2 id="gnutls-openpgp-privkey-get-subkey-creation-time" role="function">
1263
1113
<title>gnutls_openpgp_privkey_get_subkey_creation_time ()</title>
1264
<indexterm zone="gnutls-openpgp-privkey-get-subkey-creation-time" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_get_subkey_creation_time">gnutls_openpgp_privkey_get_subkey_creation_time</primary></indexterm><programlisting><link linkend="time-t">time_t</link> gnutls_openpgp_privkey_get_subkey_creation_time
1265
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1266
unsigned <link linkend="int">int</link> idx);</programlisting>
1268
Get subkey creation time.</para>
1114
<indexterm zone="gnutls-openpgp-privkey-get-subkey-creation-time"><primary>gnutls_openpgp_privkey_get_subkey_creation_time</primary></indexterm>
1115
<programlisting><link linkend="time-t"><returnvalue>time_t</returnvalue></link> gnutls_openpgp_privkey_get_subkey_creation_time
1116
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1117
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
1270
1119
</para><variablelist role="params">
1271
1120
<varlistentry><term><parameter>key</parameter> :</term>
1272
<listitem><simpara> the structure that contains the OpenPGP private key.
1273
1122
</simpara></listitem></varlistentry>
1274
1123
<varlistentry><term><parameter>idx</parameter> :</term>
1275
<listitem><simpara> the subkey index
1276
</simpara></listitem></varlistentry>
1277
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the timestamp when the OpenPGP key was created.
1279
</simpara></listitem></varlistentry>
1280
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1281
<refsect2 id="gnutls-openpgp-privkey-export-subkey-dsa-raw" role="function" condition="since:2.4.0">
1125
</simpara></listitem></varlistentry>
1126
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1127
</simpara></listitem></varlistentry>
1128
</variablelist></refsect2>
1129
<refsect2 id="gnutls-openpgp-privkey-export-subkey-dsa-raw" role="function">
1282
1130
<title>gnutls_openpgp_privkey_export_subkey_dsa_raw ()</title>
1283
<indexterm zone="gnutls-openpgp-privkey-export-subkey-dsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_export_subkey_dsa_raw">gnutls_openpgp_privkey_export_subkey_dsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_export_subkey_dsa_raw
1284
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
1285
unsigned <link linkend="int">int</link> idx,
1286
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
1287
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
1288
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
1289
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y,
1290
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *x);</programlisting>
1292
This function will export the DSA private key's parameters found
1293
in the given certificate. The new parameters will be allocated
1294
using <link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
1131
<indexterm zone="gnutls-openpgp-privkey-export-subkey-dsa-raw"><primary>gnutls_openpgp_privkey_export_subkey_dsa_raw</primary></indexterm>
1132
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_export_subkey_dsa_raw
1133
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
1134
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
1135
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
1136
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
1137
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
1138
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>,
1139
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *x</parameter>);</programlisting>
1296
1141
</para><variablelist role="params">
1297
1142
<varlistentry><term><parameter>pkey</parameter> :</term>
1298
<listitem><simpara> Holds the certificate
1299
1144
</simpara></listitem></varlistentry>
1300
1145
<varlistentry><term><parameter>idx</parameter> :</term>
1301
<listitem><simpara> Is the subkey index
1302
1147
</simpara></listitem></varlistentry>
1303
1148
<varlistentry><term><parameter>p</parameter> :</term>
1304
<listitem><simpara> will hold the p
1305
1150
</simpara></listitem></varlistentry>
1306
1151
<varlistentry><term><parameter>q</parameter> :</term>
1307
<listitem><simpara> will hold the q
1308
1153
</simpara></listitem></varlistentry>
1309
1154
<varlistentry><term><parameter>g</parameter> :</term>
1310
<listitem><simpara> will hold the g
1311
1156
</simpara></listitem></varlistentry>
1312
1157
<varlistentry><term><parameter>y</parameter> :</term>
1313
<listitem><simpara> will hold the y
1314
1159
</simpara></listitem></varlistentry>
1315
1160
<varlistentry><term><parameter>x</parameter> :</term>
1316
<listitem><simpara> will hold the x
1317
</simpara></listitem></varlistentry>
1318
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
1320
</simpara></listitem></varlistentry>
1321
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1322
<refsect2 id="gnutls-openpgp-privkey-export-subkey-rsa-raw" role="function" condition="since:2.4.0">
1162
</simpara></listitem></varlistentry>
1163
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1164
</simpara></listitem></varlistentry>
1165
</variablelist></refsect2>
1166
<refsect2 id="gnutls-openpgp-privkey-export-subkey-rsa-raw" role="function">
1323
1167
<title>gnutls_openpgp_privkey_export_subkey_rsa_raw ()</title>
1324
<indexterm zone="gnutls-openpgp-privkey-export-subkey-rsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_export_subkey_rsa_raw">gnutls_openpgp_privkey_export_subkey_rsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_export_subkey_rsa_raw
1325
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
1326
unsigned <link linkend="int">int</link> idx,
1327
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
1328
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e,
1329
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *d,
1330
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
1331
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
1332
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *u);</programlisting>
1334
This function will export the RSA private key's parameters found in
1335
the given structure. The new parameters will be allocated using
1336
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
1168
<indexterm zone="gnutls-openpgp-privkey-export-subkey-rsa-raw"><primary>gnutls_openpgp_privkey_export_subkey_rsa_raw</primary></indexterm>
1169
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_export_subkey_rsa_raw
1170
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
1171
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
1172
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
1173
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>,
1174
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *d</parameter>,
1175
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
1176
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
1177
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *u</parameter>);</programlisting>
1338
1179
</para><variablelist role="params">
1339
1180
<varlistentry><term><parameter>pkey</parameter> :</term>
1340
<listitem><simpara> Holds the certificate
1341
1182
</simpara></listitem></varlistentry>
1342
1183
<varlistentry><term><parameter>idx</parameter> :</term>
1343
<listitem><simpara> Is the subkey index
1344
1185
</simpara></listitem></varlistentry>
1345
1186
<varlistentry><term><parameter>m</parameter> :</term>
1346
<listitem><simpara> will hold the modulus
1347
1188
</simpara></listitem></varlistentry>
1348
1189
<varlistentry><term><parameter>e</parameter> :</term>
1349
<listitem><simpara> will hold the public exponent
1350
1191
</simpara></listitem></varlistentry>
1351
1192
<varlistentry><term><parameter>d</parameter> :</term>
1352
<listitem><simpara> will hold the private exponent
1353
1194
</simpara></listitem></varlistentry>
1354
1195
<varlistentry><term><parameter>p</parameter> :</term>
1355
<listitem><simpara> will hold the first prime (p)
1356
1197
</simpara></listitem></varlistentry>
1357
1198
<varlistentry><term><parameter>q</parameter> :</term>
1358
<listitem><simpara> will hold the second prime (q)
1359
1200
</simpara></listitem></varlistentry>
1360
1201
<varlistentry><term><parameter>u</parameter> :</term>
1361
<listitem><simpara> will hold the coefficient
1362
</simpara></listitem></varlistentry>
1363
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
1365
</simpara></listitem></varlistentry>
1366
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1367
<refsect2 id="gnutls-openpgp-privkey-export-dsa-raw" role="function" condition="since:2.4.0">
1203
</simpara></listitem></varlistentry>
1204
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1205
</simpara></listitem></varlistentry>
1206
</variablelist></refsect2>
1207
<refsect2 id="gnutls-openpgp-privkey-export-dsa-raw" role="function">
1368
1208
<title>gnutls_openpgp_privkey_export_dsa_raw ()</title>
1369
<indexterm zone="gnutls-openpgp-privkey-export-dsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_export_dsa_raw">gnutls_openpgp_privkey_export_dsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_export_dsa_raw
1370
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
1371
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
1372
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
1373
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *g,
1374
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *y,
1375
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *x);</programlisting>
1377
This function will export the DSA private key's parameters found in
1378
the given certificate. The new parameters will be allocated using
1379
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
1209
<indexterm zone="gnutls-openpgp-privkey-export-dsa-raw"><primary>gnutls_openpgp_privkey_export_dsa_raw</primary></indexterm>
1210
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_export_dsa_raw
1211
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
1212
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
1213
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
1214
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *g</parameter>,
1215
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *y</parameter>,
1216
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *x</parameter>);</programlisting>
1381
1218
</para><variablelist role="params">
1382
1219
<varlistentry><term><parameter>pkey</parameter> :</term>
1383
<listitem><simpara> Holds the certificate
1384
1221
</simpara></listitem></varlistentry>
1385
1222
<varlistentry><term><parameter>p</parameter> :</term>
1386
<listitem><simpara> will hold the p
1387
1224
</simpara></listitem></varlistentry>
1388
1225
<varlistentry><term><parameter>q</parameter> :</term>
1389
<listitem><simpara> will hold the q
1390
1227
</simpara></listitem></varlistentry>
1391
1228
<varlistentry><term><parameter>g</parameter> :</term>
1392
<listitem><simpara> will hold the g
1393
1230
</simpara></listitem></varlistentry>
1394
1231
<varlistentry><term><parameter>y</parameter> :</term>
1395
<listitem><simpara> will hold the y
1396
1233
</simpara></listitem></varlistentry>
1397
1234
<varlistentry><term><parameter>x</parameter> :</term>
1398
<listitem><simpara> will hold the x
1399
</simpara></listitem></varlistentry>
1400
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
1402
</simpara></listitem></varlistentry>
1403
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1404
<refsect2 id="gnutls-openpgp-privkey-export-rsa-raw" role="function" condition="since:2.4.0">
1236
</simpara></listitem></varlistentry>
1237
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1238
</simpara></listitem></varlistentry>
1239
</variablelist></refsect2>
1240
<refsect2 id="gnutls-openpgp-privkey-export-rsa-raw" role="function">
1405
1241
<title>gnutls_openpgp_privkey_export_rsa_raw ()</title>
1406
<indexterm zone="gnutls-openpgp-privkey-export-rsa-raw" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_export_rsa_raw">gnutls_openpgp_privkey_export_rsa_raw</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_export_rsa_raw
1407
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey,
1408
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *m,
1409
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *e,
1410
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *d,
1411
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *p,
1412
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *q,
1413
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *u);</programlisting>
1415
This function will export the RSA private key's parameters found in
1416
the given structure. The new parameters will be allocated using
1417
<link linkend="gnutls-malloc"><function>gnutls_malloc()</function></link> and will be stored in the appropriate datum.</para>
1242
<indexterm zone="gnutls-openpgp-privkey-export-rsa-raw"><primary>gnutls_openpgp_privkey_export_rsa_raw</primary></indexterm>
1243
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_export_rsa_raw
1244
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>,
1245
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *m</parameter>,
1246
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *e</parameter>,
1247
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *d</parameter>,
1248
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *p</parameter>,
1249
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *q</parameter>,
1250
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *u</parameter>);</programlisting>
1419
1252
</para><variablelist role="params">
1420
1253
<varlistentry><term><parameter>pkey</parameter> :</term>
1421
<listitem><simpara> Holds the certificate
1422
1255
</simpara></listitem></varlistentry>
1423
1256
<varlistentry><term><parameter>m</parameter> :</term>
1424
<listitem><simpara> will hold the modulus
1425
1258
</simpara></listitem></varlistentry>
1426
1259
<varlistentry><term><parameter>e</parameter> :</term>
1427
<listitem><simpara> will hold the public exponent
1428
1261
</simpara></listitem></varlistentry>
1429
1262
<varlistentry><term><parameter>d</parameter> :</term>
1430
<listitem><simpara> will hold the private exponent
1431
1264
</simpara></listitem></varlistentry>
1432
1265
<varlistentry><term><parameter>p</parameter> :</term>
1433
<listitem><simpara> will hold the first prime (p)
1434
1267
</simpara></listitem></varlistentry>
1435
1268
<varlistentry><term><parameter>q</parameter> :</term>
1436
<listitem><simpara> will hold the second prime (q)
1437
1270
</simpara></listitem></varlistentry>
1438
1271
<varlistentry><term><parameter>u</parameter> :</term>
1439
<listitem><simpara> will hold the coefficient
1440
</simpara></listitem></varlistentry>
1441
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, otherwise an error.
1443
</simpara></listitem></varlistentry>
1444
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1445
<refsect2 id="gnutls-openpgp-privkey-export" role="function" condition="since:2.4.0">
1273
</simpara></listitem></varlistentry>
1274
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1275
</simpara></listitem></varlistentry>
1276
</variablelist></refsect2>
1277
<refsect2 id="gnutls-openpgp-privkey-export" role="function">
1446
1278
<title>gnutls_openpgp_privkey_export ()</title>
1447
<indexterm zone="gnutls-openpgp-privkey-export" role="2.4.0"><primary sortas="gnutls_openpgp_privkey_export">gnutls_openpgp_privkey_export</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_export (<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1448
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format,
1449
const <link linkend="char">char</link> *password,
1450
unsigned <link linkend="int">int</link> flags,
1451
<link linkend="void">void</link> *output_data,
1452
<link linkend="size-t">size_t</link> *output_data_size);</programlisting>
1454
This function will convert the given key to RAW or Base64 format.
1455
If the buffer provided is not long enough to hold the output, then
1456
GNUTLS_E_SHORT_MEMORY_BUFFER will be returned.</para>
1279
<indexterm zone="gnutls-openpgp-privkey-export"><primary>gnutls_openpgp_privkey_export</primary></indexterm>
1280
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_export (<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1281
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>,
1282
<parameter>const <link linkend="char"><type>char</type></link> *password</parameter>,
1283
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>,
1284
<parameter><link linkend="void"><type>void</type></link> *output_data</parameter>,
1285
<parameter><link linkend="size-t"><type>size_t</type></link> *output_data_size</parameter>);</programlisting>
1458
1287
</para><variablelist role="params">
1459
1288
<varlistentry><term><parameter>key</parameter> :</term>
1460
<listitem><simpara> Holds the key.
1461
1290
</simpara></listitem></varlistentry>
1462
1291
<varlistentry><term><parameter>format</parameter> :</term>
1463
<listitem><simpara> One of gnutls_openpgp_crt_fmt_t elements.
1464
1293
</simpara></listitem></varlistentry>
1465
1294
<varlistentry><term><parameter>password</parameter> :</term>
1466
<listitem><simpara> the password that will be used to encrypt the key. (unused for now)
1467
1296
</simpara></listitem></varlistentry>
1468
1297
<varlistentry><term><parameter>flags</parameter> :</term>
1469
<listitem><simpara> zero for future compatibility
1470
1299
</simpara></listitem></varlistentry>
1471
1300
<varlistentry><term><parameter>output_data</parameter> :</term>
1472
<listitem><simpara> will contain the key base64 encoded or raw
1473
1302
</simpara></listitem></varlistentry>
1474
1303
<varlistentry><term><parameter>output_data_size</parameter> :</term>
1475
<listitem><simpara> holds the size of output_data (and will be
1476
replaced by the actual size of parameters)
1477
</simpara></listitem></varlistentry>
1478
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1480
</simpara></listitem></varlistentry>
1481
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1305
</simpara></listitem></varlistentry>
1306
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1307
</simpara></listitem></varlistentry>
1308
</variablelist></refsect2>
1482
1309
<refsect2 id="gnutls-openpgp-privkey-set-preferred-key-id" role="function">
1483
1310
<title>gnutls_openpgp_privkey_set_preferred_key_id ()</title>
1484
<indexterm zone="gnutls-openpgp-privkey-set-preferred-key-id"><primary sortas="gnutls_openpgp_privkey_set_preferred_key_id">gnutls_openpgp_privkey_set_preferred_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_set_preferred_key_id
1485
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1486
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
1488
This allows setting a preferred key id for the given certificate.
1489
This key will be used by functions that involve key handling.</para>
1311
<indexterm zone="gnutls-openpgp-privkey-set-preferred-key-id"><primary>gnutls_openpgp_privkey_set_preferred_key_id</primary></indexterm>
1312
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_set_preferred_key_id
1313
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1314
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
1491
1316
</para><variablelist role="params">
1492
1317
<varlistentry><term><parameter>key</parameter> :</term>
1493
<listitem><simpara> the structure that contains the OpenPGP public key.
1494
1319
</simpara></listitem></varlistentry>
1495
1320
<varlistentry><term><parameter>keyid</parameter> :</term>
1496
<listitem><simpara> the selected keyid
1497
1322
</simpara></listitem></varlistentry>
1498
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, 0 is returned, or an error code.
1323
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1499
1324
</simpara></listitem></varlistentry>
1500
1325
</variablelist></refsect2>
1501
1326
<refsect2 id="gnutls-openpgp-privkey-get-preferred-key-id" role="function">
1502
1327
<title>gnutls_openpgp_privkey_get_preferred_key_id ()</title>
1503
<indexterm zone="gnutls-openpgp-privkey-get-preferred-key-id"><primary sortas="gnutls_openpgp_privkey_get_preferred_key_id">gnutls_openpgp_privkey_get_preferred_key_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_privkey_get_preferred_key_id
1504
(<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> key,
1505
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid);</programlisting>
1507
Get the preferred key-id for the key.</para>
1328
<indexterm zone="gnutls-openpgp-privkey-get-preferred-key-id"><primary>gnutls_openpgp_privkey_get_preferred_key_id</primary></indexterm>
1329
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_privkey_get_preferred_key_id
1330
(<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> key</parameter>,
1331
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>);</programlisting>
1509
1333
</para><variablelist role="params">
1510
1334
<varlistentry><term><parameter>key</parameter> :</term>
1511
<listitem><simpara> the structure that contains the OpenPGP public key.
1512
1336
</simpara></listitem></varlistentry>
1513
1337
<varlistentry><term><parameter>keyid</parameter> :</term>
1514
<listitem><simpara> the struct to save the keyid.
1515
1339
</simpara></listitem></varlistentry>
1516
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the 64-bit preferred keyID of the OpenPGP key, or if it
1517
hasn't been set it returns <link linkend="GNUTLS-E-INVALID-REQUEST--CAPS"><literal>GNUTLS_E_INVALID_REQUEST</literal></link>.
1340
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1518
1341
</simpara></listitem></varlistentry>
1519
1342
</variablelist></refsect2>
1520
1343
<refsect2 id="gnutls-openpgp-crt-get-auth-subkey" role="function">
1521
1344
<title>gnutls_openpgp_crt_get_auth_subkey ()</title>
1522
<indexterm zone="gnutls-openpgp-crt-get-auth-subkey"><primary sortas="gnutls_openpgp_crt_get_auth_subkey">gnutls_openpgp_crt_get_auth_subkey</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_get_auth_subkey (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> crt,
1523
<link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid,
1524
unsigned <link linkend="int">int</link> flag);</programlisting>
1526
Returns the 64-bit keyID of the first valid OpenPGP subkey marked
1527
for authentication. If flag is non zero and no authentication
1528
subkey exists, then a valid subkey will be returned even if it is
1529
not marked for authentication.
1530
Returns the 64-bit keyID of the first valid OpenPGP subkey marked
1531
for authentication. If flag is non zero and no authentication
1532
subkey exists, then a valid subkey will be returned even if it is
1533
not marked for authentication.</para>
1345
<indexterm zone="gnutls-openpgp-crt-get-auth-subkey"><primary>gnutls_openpgp_crt_get_auth_subkey</primary></indexterm>
1346
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_get_auth_subkey (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> crt</parameter>,
1347
<parameter><link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>,
1348
<parameter>unsigned <link linkend="int"><type>int</type></link> flag</parameter>);</programlisting>
1535
1350
</para><variablelist role="params">
1536
1351
<varlistentry><term><parameter>crt</parameter> :</term>
1537
<listitem><simpara> the structure that contains the OpenPGP public key.
1538
1353
</simpara></listitem></varlistentry>
1539
1354
<varlistentry><term><parameter>keyid</parameter> :</term>
1540
<listitem><simpara> the struct to save the keyid.
1541
1356
</simpara></listitem></varlistentry>
1542
1357
<varlistentry><term><parameter>flag</parameter> :</term>
1543
<listitem><simpara> Non zero indicates that a valid subkey is always returned.
1544
1359
</simpara></listitem></varlistentry>
1545
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1360
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1546
1361
</simpara></listitem></varlistentry>
1547
1362
</variablelist></refsect2>
1548
1363
<refsect2 id="gnutls-openpgp-keyring-init" role="function">
1549
1364
<title>gnutls_openpgp_keyring_init ()</title>
1550
<indexterm zone="gnutls-openpgp-keyring-init"><primary sortas="gnutls_openpgp_keyring_init">gnutls_openpgp_keyring_init</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_keyring_init (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> *keyring);</programlisting>
1552
This function will initialize an keyring structure.</para>
1365
<indexterm zone="gnutls-openpgp-keyring-init"><primary>gnutls_openpgp_keyring_init</primary></indexterm>
1366
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_keyring_init (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> *keyring</parameter>);</programlisting>
1554
1368
</para><variablelist role="params">
1555
1369
<varlistentry><term><parameter>keyring</parameter> :</term>
1556
<listitem><simpara> The structure to be initialized
1557
1371
</simpara></listitem></varlistentry>
1558
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1372
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1559
1373
</simpara></listitem></varlistentry>
1560
1374
</variablelist></refsect2>
1561
1375
<refsect2 id="gnutls-openpgp-keyring-deinit" role="function">
1562
1376
<title>gnutls_openpgp_keyring_deinit ()</title>
1563
<indexterm zone="gnutls-openpgp-keyring-deinit"><primary sortas="gnutls_openpgp_keyring_deinit">gnutls_openpgp_keyring_deinit</primary></indexterm><programlisting><link linkend="void">void</link> gnutls_openpgp_keyring_deinit (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> keyring);</programlisting>
1565
This function will deinitialize a keyring structure.</para>
1377
<indexterm zone="gnutls-openpgp-keyring-deinit"><primary>gnutls_openpgp_keyring_deinit</primary></indexterm>
1378
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> gnutls_openpgp_keyring_deinit (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> keyring</parameter>);</programlisting>
1567
1380
</para><variablelist role="params">
1568
1381
<varlistentry><term><parameter>keyring</parameter> :</term>
1569
<listitem><simpara> The structure to be initialized
1570
1383
</simpara></listitem></varlistentry>
1571
1384
</variablelist></refsect2>
1572
1385
<refsect2 id="gnutls-openpgp-keyring-import" role="function">
1573
1386
<title>gnutls_openpgp_keyring_import ()</title>
1574
<indexterm zone="gnutls-openpgp-keyring-import"><primary sortas="gnutls_openpgp_keyring_import">gnutls_openpgp_keyring_import</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_keyring_import (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> keyring,
1575
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *data,
1576
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1578
This function will convert the given RAW or Base64 encoded keyring
1579
to the native <link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> format. The output will be
1580
stored in 'keyring'.</para>
1387
<indexterm zone="gnutls-openpgp-keyring-import"><primary>gnutls_openpgp_keyring_import</primary></indexterm>
1388
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_keyring_import (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> keyring</parameter>,
1389
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *data</parameter>,
1390
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1582
1392
</para><variablelist role="params">
1583
1393
<varlistentry><term><parameter>keyring</parameter> :</term>
1584
<listitem><simpara> The structure to store the parsed key.
1585
1395
</simpara></listitem></varlistentry>
1586
1396
<varlistentry><term><parameter>data</parameter> :</term>
1587
<listitem><simpara> The RAW or BASE64 encoded keyring.
1588
1398
</simpara></listitem></varlistentry>
1589
1399
<varlistentry><term><parameter>format</parameter> :</term>
1590
<listitem><simpara> One of <link linkend="gnutls-openpgp-keyring-fmt"><type>gnutls_openpgp_keyring_fmt</type></link> elements.
1591
1401
</simpara></listitem></varlistentry>
1592
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1402
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1593
1403
</simpara></listitem></varlistentry>
1594
1404
</variablelist></refsect2>
1595
1405
<refsect2 id="gnutls-openpgp-keyring-check-id" role="function">
1596
1406
<title>gnutls_openpgp_keyring_check_id ()</title>
1597
<indexterm zone="gnutls-openpgp-keyring-check-id"><primary sortas="gnutls_openpgp_keyring_check_id">gnutls_openpgp_keyring_check_id</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_keyring_check_id (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> ring,
1598
const <link linkend="gnutls-openpgp-keyid-t">gnutls_openpgp_keyid_t</link> keyid,
1599
unsigned <link linkend="int">int</link> flags);</programlisting>
1601
Check if a given key ID exists in the keyring.</para>
1407
<indexterm zone="gnutls-openpgp-keyring-check-id"><primary>gnutls_openpgp_keyring_check_id</primary></indexterm>
1408
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_keyring_check_id (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> ring</parameter>,
1409
<parameter>const <link linkend="gnutls-openpgp-keyid-t"><type>gnutls_openpgp_keyid_t</type></link> keyid</parameter>,
1410
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>);</programlisting>
1603
1412
</para><variablelist role="params">
1604
1413
<varlistentry><term><parameter>ring</parameter> :</term>
1605
<listitem><simpara> holds the keyring to check against
1606
1415
</simpara></listitem></varlistentry>
1607
1416
<varlistentry><term><parameter>keyid</parameter> :</term>
1608
<listitem><simpara> will hold the keyid to check for.
1609
1418
</simpara></listitem></varlistentry>
1610
1419
<varlistentry><term><parameter>flags</parameter> :</term>
1611
<listitem><simpara> unused (should be 0)
1612
1421
</simpara></listitem></varlistentry>
1613
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success (if keyid exists) and a
1614
negative error code on failure.
1422
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1615
1423
</simpara></listitem></varlistentry>
1616
1424
</variablelist></refsect2>
1617
1425
<refsect2 id="gnutls-openpgp-crt-verify-ring" role="function">
1618
1426
<title>gnutls_openpgp_crt_verify_ring ()</title>
1619
<indexterm zone="gnutls-openpgp-crt-verify-ring"><primary sortas="gnutls_openpgp_crt_verify_ring">gnutls_openpgp_crt_verify_ring</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_verify_ring (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
1620
<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> keyring,
1621
unsigned <link linkend="int">int</link> flags,
1622
unsigned <link linkend="int">int</link> *verify);</programlisting>
1624
Verify all signatures in the key, using the given set of keys
1628
The key verification output will be put in <parameter>verify</parameter> and will be one
1629
or more of the <link linkend="gnutls-certificate-status-t"><type>gnutls_certificate_status_t</type></link> enumerated elements
1633
<link linkend="GNUTLS-CERT-INVALID--CAPS"><literal>GNUTLS_CERT_INVALID</literal></link>: A signature on the key is invalid.
1636
<link linkend="GNUTLS-CERT-REVOKED--CAPS"><literal>GNUTLS_CERT_REVOKED</literal></link>: The key has been revoked.
1639
Note that this function does not verify using any "web of trust".
1640
You may use GnuPG for that purpose, or any other external PGP
1427
<indexterm zone="gnutls-openpgp-crt-verify-ring"><primary>gnutls_openpgp_crt_verify_ring</primary></indexterm>
1428
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_verify_ring (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
1429
<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> keyring</parameter>,
1430
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>,
1431
<parameter>unsigned <link linkend="int"><type>int</type></link> *verify</parameter>);</programlisting>
1643
1433
</para><variablelist role="params">
1644
1434
<varlistentry><term><parameter>key</parameter> :</term>
1645
<listitem><simpara> the structure that holds the key.
1646
1436
</simpara></listitem></varlistentry>
1647
1437
<varlistentry><term><parameter>keyring</parameter> :</term>
1648
<listitem><simpara> holds the keyring to check against
1649
1439
</simpara></listitem></varlistentry>
1650
1440
<varlistentry><term><parameter>flags</parameter> :</term>
1651
<listitem><simpara> unused (should be 0)
1652
1442
</simpara></listitem></varlistentry>
1653
1443
<varlistentry><term><parameter>verify</parameter> :</term>
1654
<listitem><simpara> will hold the certificate verification output.
1655
1445
</simpara></listitem></varlistentry>
1656
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1446
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1657
1447
</simpara></listitem></varlistentry>
1658
1448
</variablelist></refsect2>
1659
1449
<refsect2 id="gnutls-openpgp-crt-verify-self" role="function">
1660
1450
<title>gnutls_openpgp_crt_verify_self ()</title>
1661
<indexterm zone="gnutls-openpgp-crt-verify-self"><primary sortas="gnutls_openpgp_crt_verify_self">gnutls_openpgp_crt_verify_self</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_crt_verify_self (<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
1662
unsigned <link linkend="int">int</link> flags,
1663
unsigned <link linkend="int">int</link> *verify);</programlisting>
1665
Verifies the self signature in the key. The key verification
1666
output will be put in <parameter>verify</parameter> and will be one or more of the
1667
gnutls_certificate_status_t enumerated elements bitwise or'd.
1670
<link linkend="GNUTLS-CERT-INVALID--CAPS"><literal>GNUTLS_CERT_INVALID</literal></link>: The self signature on the key is invalid.</para>
1451
<indexterm zone="gnutls-openpgp-crt-verify-self"><primary>gnutls_openpgp_crt_verify_self</primary></indexterm>
1452
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_crt_verify_self (<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
1453
<parameter>unsigned <link linkend="int"><type>int</type></link> flags</parameter>,
1454
<parameter>unsigned <link linkend="int"><type>int</type></link> *verify</parameter>);</programlisting>
1672
1456
</para><variablelist role="params">
1673
1457
<varlistentry><term><parameter>key</parameter> :</term>
1674
<listitem><simpara> the structure that holds the key.
1675
1459
</simpara></listitem></varlistentry>
1676
1460
<varlistentry><term><parameter>flags</parameter> :</term>
1677
<listitem><simpara> unused (should be 0)
1678
1462
</simpara></listitem></varlistentry>
1679
1463
<varlistentry><term><parameter>verify</parameter> :</term>
1680
<listitem><simpara> will hold the key verification output.
1681
1465
</simpara></listitem></varlistentry>
1682
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1466
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1683
1467
</simpara></listitem></varlistentry>
1684
1468
</variablelist></refsect2>
1685
1469
<refsect2 id="gnutls-openpgp-keyring-get-crt" role="function">
1686
1470
<title>gnutls_openpgp_keyring_get_crt ()</title>
1687
<indexterm zone="gnutls-openpgp-keyring-get-crt"><primary sortas="gnutls_openpgp_keyring_get_crt">gnutls_openpgp_keyring_get_crt</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_keyring_get_crt (<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> ring,
1688
unsigned <link linkend="int">int</link> idx,
1689
<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> *cert);</programlisting>
1691
This function will extract an OpenPGP certificate from the given
1692
keyring. If the index given is out of range
1693
<link linkend="GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE--CAPS"><literal>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</literal></link> will be returned. The
1694
returned structure needs to be deinited.</para>
1471
<indexterm zone="gnutls-openpgp-keyring-get-crt"><primary>gnutls_openpgp_keyring_get_crt</primary></indexterm>
1472
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_keyring_get_crt (<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> ring</parameter>,
1473
<parameter>unsigned <link linkend="int"><type>int</type></link> idx</parameter>,
1474
<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> *cert</parameter>);</programlisting>
1696
1476
</para><variablelist role="params">
1697
1477
<varlistentry><term><parameter>ring</parameter> :</term>
1698
<listitem><simpara> Holds the keyring.
1699
1479
</simpara></listitem></varlistentry>
1700
1480
<varlistentry><term><parameter>idx</parameter> :</term>
1701
<listitem><simpara> the index of the certificate to export
1702
1482
</simpara></listitem></varlistentry>
1703
1483
<varlistentry><term><parameter>cert</parameter> :</term>
1704
<listitem><simpara> An uninitialized <link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> structure
1705
1485
</simpara></listitem></varlistentry>
1706
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> on success, or an error code.
1486
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1707
1487
</simpara></listitem></varlistentry>
1708
1488
</variablelist></refsect2>
1709
1489
<refsect2 id="gnutls-openpgp-keyring-get-crt-count" role="function">
1710
1490
<title>gnutls_openpgp_keyring_get_crt_count ()</title>
1711
<indexterm zone="gnutls-openpgp-keyring-get-crt-count"><primary sortas="gnutls_openpgp_keyring_get_crt_count">gnutls_openpgp_keyring_get_crt_count</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_openpgp_keyring_get_crt_count
1712
(<link linkend="gnutls-openpgp-keyring-t">gnutls_openpgp_keyring_t</link> ring);</programlisting>
1714
This function will return the number of OpenPGP certificates
1715
present in the given keyring.</para>
1491
<indexterm zone="gnutls-openpgp-keyring-get-crt-count"><primary>gnutls_openpgp_keyring_get_crt_count</primary></indexterm>
1492
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_openpgp_keyring_get_crt_count
1493
(<parameter><link linkend="gnutls-openpgp-keyring-t"><type>gnutls_openpgp_keyring_t</type></link> ring</parameter>);</programlisting>
1717
1495
</para><variablelist role="params">
1718
1496
<varlistentry><term><parameter>ring</parameter> :</term>
1719
<listitem><simpara> is an OpenPGP key ring
1720
1498
</simpara></listitem></varlistentry>
1721
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of subkeys, or a negative value on error.
1499
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1722
1500
</simpara></listitem></varlistentry>
1723
1501
</variablelist></refsect2>
1724
1502
<refsect2 id="gnutls-openpgp-recv-key-func" role="function">
1725
1503
<title>gnutls_openpgp_recv_key_func ()</title>
1726
<indexterm zone="gnutls-openpgp-recv-key-func"><primary sortas="gnutls_openpgp_recv_key_func">gnutls_openpgp_recv_key_func</primary></indexterm><programlisting><link linkend="int">int</link> (*gnutls_openpgp_recv_key_func) (<link linkend="gnutls-session-t">gnutls_session_t</link> session,
1727
unsigned <link linkend="char">char</link> *keyfpr,
1728
unsigned <link linkend="int">int</link> keyfpr_length,
1729
<link linkend="gnutls-datum-t">gnutls_datum_t</link> *key);</programlisting>
1731
A callback of this type is used to retrieve OpenPGP keys. Only
1732
useful on the server, and will only be used if the peer send a key
1733
fingerprint instead of a full key. See also
1734
<link linkend="gnutls-openpgp-set-recv-key-function"><function>gnutls_openpgp_set_recv_key_function()</function></link>.</para>
1504
<indexterm zone="gnutls-openpgp-recv-key-func"><primary>gnutls_openpgp_recv_key_func</primary></indexterm>
1505
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> (*gnutls_openpgp_recv_key_func) (<parameter><link linkend="gnutls-session-t"><type>gnutls_session_t</type></link> session</parameter>,
1506
<parameter>unsigned <link linkend="char"><type>char</type></link> *keyfpr</parameter>,
1507
<parameter>unsigned <link linkend="int"><type>int</type></link> keyfpr_length</parameter>,
1508
<parameter><link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *key</parameter>);</programlisting>
1736
1510
</para><variablelist role="params">
1737
1511
<varlistentry><term><parameter>session</parameter> :</term>
1738
<listitem><simpara> a TLS session
1739
1513
</simpara></listitem></varlistentry>
1740
1514
<varlistentry><term><parameter>keyfpr</parameter> :</term>
1741
<listitem><simpara> key fingerprint
1742
1516
</simpara></listitem></varlistentry>
1743
1517
<varlistentry><term><parameter>keyfpr_length</parameter> :</term>
1744
<listitem><simpara> length of key fingerprint
1745
1519
</simpara></listitem></varlistentry>
1746
1520
<varlistentry><term><parameter>key</parameter> :</term>
1747
<listitem><simpara> output key.
1748
1522
</simpara></listitem></varlistentry>
1749
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> (zero) is returned,
1750
otherwise an error code is returned.
1523
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1751
1524
</simpara></listitem></varlistentry>
1752
1525
</variablelist></refsect2>
1753
1526
<refsect2 id="gnutls-openpgp-set-recv-key-function" role="function">
1754
1527
<title>gnutls_openpgp_set_recv_key_function ()</title>
1755
<indexterm zone="gnutls-openpgp-set-recv-key-function"><primary sortas="gnutls_openpgp_set_recv_key_function">gnutls_openpgp_set_recv_key_function</primary></indexterm><programlisting><link linkend="void">void</link> gnutls_openpgp_set_recv_key_function
1756
(<link linkend="gnutls-session-t">gnutls_session_t</link> session,
1757
<link linkend="gnutls-openpgp-recv-key-func">gnutls_openpgp_recv_key_func</link> func);</programlisting>
1759
This funtion will set a key retrieval function for OpenPGP keys. This
1760
callback is only useful in server side, and will be used if the peer
1761
sent a key fingerprint instead of a full key.</para>
1528
<indexterm zone="gnutls-openpgp-set-recv-key-function"><primary>gnutls_openpgp_set_recv_key_function</primary></indexterm>
1529
<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> gnutls_openpgp_set_recv_key_function
1530
(<parameter><link linkend="gnutls-session-t"><type>gnutls_session_t</type></link> session</parameter>,
1531
<parameter><link linkend="gnutls-openpgp-recv-key-func"><type>gnutls_openpgp_recv_key_func</type></link> func</parameter>);</programlisting>
1763
1533
</para><variablelist role="params">
1764
1534
<varlistentry><term><parameter>session</parameter> :</term>
1765
<listitem><simpara> a TLS session
1766
1536
</simpara></listitem></varlistentry>
1767
1537
<varlistentry><term><parameter>func</parameter> :</term>
1768
<listitem><simpara> the callback
1769
1539
</simpara></listitem></varlistentry>
1770
1540
</variablelist></refsect2>
1771
1541
<refsect2 id="gnutls-certificate-set-openpgp-key" role="function">
1772
1542
<title>gnutls_certificate_set_openpgp_key ()</title>
1773
<indexterm zone="gnutls-certificate-set-openpgp-key"><primary sortas="gnutls_certificate_set_openpgp_key">gnutls_certificate_set_openpgp_key</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_key (<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
1774
<link linkend="gnutls-openpgp-crt-t">gnutls_openpgp_crt_t</link> key,
1775
<link linkend="gnutls-openpgp-privkey-t">gnutls_openpgp_privkey_t</link> pkey);</programlisting>
1777
This function sets a certificate/private key pair in the
1778
gnutls_certificate_credentials_t structure. This function may be
1779
called more than once (in case multiple keys/certificates exist
1783
With this function the subkeys of the certificate are not used.</para>
1543
<indexterm zone="gnutls-certificate-set-openpgp-key"><primary>gnutls_certificate_set_openpgp_key</primary></indexterm>
1544
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_key (<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
1545
<parameter><link linkend="gnutls-openpgp-crt-t"><type>gnutls_openpgp_crt_t</type></link> key</parameter>,
1546
<parameter><link linkend="gnutls-openpgp-privkey-t"><type>gnutls_openpgp_privkey_t</type></link> pkey</parameter>);</programlisting>
1785
1548
</para><variablelist role="params">
1786
1549
<varlistentry><term><parameter>res</parameter> :</term>
1787
<listitem><simpara> is a <link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> structure.
1788
1551
</simpara></listitem></varlistentry>
1789
1552
<varlistentry><term><parameter>key</parameter> :</term>
1790
<listitem><simpara> contains an openpgp public key
1791
1554
</simpara></listitem></varlistentry>
1792
1555
<varlistentry><term><parameter>pkey</parameter> :</term>
1793
<listitem><simpara> is an openpgp private key
1794
1557
</simpara></listitem></varlistentry>
1795
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> (zero) is returned,
1796
otherwise an error code is returned.
1558
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1797
1559
</simpara></listitem></varlistentry>
1798
1560
</variablelist></refsect2>
1799
1561
<refsect2 id="gnutls-certificate-set-openpgp-key-file" role="function">
1800
1562
<title>gnutls_certificate_set_openpgp_key_file ()</title>
1801
<indexterm zone="gnutls-certificate-set-openpgp-key-file"><primary sortas="gnutls_certificate_set_openpgp_key_file">gnutls_certificate_set_openpgp_key_file</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_key_file
1802
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
1803
const <link linkend="char">char</link> *certfile,
1804
const <link linkend="char">char</link> *keyfile,
1805
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1807
This funtion is used to load OpenPGP keys into the GnuTLS
1808
credentials structure. The files should only contain one key which
1809
is not encrypted.</para>
1563
<indexterm zone="gnutls-certificate-set-openpgp-key-file"><primary>gnutls_certificate_set_openpgp_key_file</primary></indexterm>
1564
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_key_file
1565
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
1566
<parameter>const <link linkend="char"><type>char</type></link> *certfile</parameter>,
1567
<parameter>const <link linkend="char"><type>char</type></link> *keyfile</parameter>,
1568
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1811
1570
</para><variablelist role="params">
1812
1571
<varlistentry><term><parameter>res</parameter> :</term>
1813
<listitem><simpara> the destination context to save the data.
1814
1573
</simpara></listitem></varlistentry>
1815
1574
<varlistentry><term><parameter>certfile</parameter> :</term>
1816
<listitem><simpara> the file that contains the public key.
1817
1576
</simpara></listitem></varlistentry>
1818
1577
<varlistentry><term><parameter>keyfile</parameter> :</term>
1819
<listitem><simpara> the file that contains the secret key.
1820
1579
</simpara></listitem></varlistentry>
1821
1580
<varlistentry><term><parameter>format</parameter> :</term>
1822
<listitem><simpara> the format of the keys
1823
1582
</simpara></listitem></varlistentry>
1824
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1825
negative error value.
1583
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1826
1584
</simpara></listitem></varlistentry>
1827
1585
</variablelist></refsect2>
1828
1586
<refsect2 id="gnutls-certificate-set-openpgp-key-mem" role="function">
1829
1587
<title>gnutls_certificate_set_openpgp_key_mem ()</title>
1830
<indexterm zone="gnutls-certificate-set-openpgp-key-mem"><primary sortas="gnutls_certificate_set_openpgp_key_mem">gnutls_certificate_set_openpgp_key_mem</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_key_mem
1831
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
1832
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *cert,
1833
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *key,
1834
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1836
This funtion is used to load OpenPGP keys into the GnuTLS credential
1837
structure. The files should contain non encrypted keys.</para>
1588
<indexterm zone="gnutls-certificate-set-openpgp-key-mem"><primary>gnutls_certificate_set_openpgp_key_mem</primary></indexterm>
1589
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_key_mem
1590
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
1591
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *cert</parameter>,
1592
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *key</parameter>,
1593
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1839
1595
</para><variablelist role="params">
1840
1596
<varlistentry><term><parameter>res</parameter> :</term>
1841
<listitem><simpara> the destination context to save the data.
1842
1598
</simpara></listitem></varlistentry>
1843
1599
<varlistentry><term><parameter>cert</parameter> :</term>
1844
<listitem><simpara> the datum that contains the public key.
1845
1601
</simpara></listitem></varlistentry>
1846
1602
<varlistentry><term><parameter>key</parameter> :</term>
1847
<listitem><simpara> the datum that contains the secret key.
1848
1604
</simpara></listitem></varlistentry>
1849
1605
<varlistentry><term><parameter>format</parameter> :</term>
1850
<listitem><simpara> the format of the keys
1851
1607
</simpara></listitem></varlistentry>
1852
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1853
negative error value.
1608
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1854
1609
</simpara></listitem></varlistentry>
1855
1610
</variablelist></refsect2>
1856
<refsect2 id="gnutls-certificate-set-openpgp-key-file2" role="function" condition="since:2.4.0">
1611
<refsect2 id="gnutls-certificate-set-openpgp-key-file2" role="function">
1857
1612
<title>gnutls_certificate_set_openpgp_key_file2 ()</title>
1858
<indexterm zone="gnutls-certificate-set-openpgp-key-file2" role="2.4.0"><primary sortas="gnutls_certificate_set_openpgp_key_file2">gnutls_certificate_set_openpgp_key_file2</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_key_file2
1859
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
1860
const <link linkend="char">char</link> *certfile,
1861
const <link linkend="char">char</link> *keyfile,
1862
const <link linkend="char">char</link> *subkey_id,
1863
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1865
This funtion is used to load OpenPGP keys into the GnuTLS credential
1866
structure. The files should contain non encrypted keys.
1869
The special keyword "auto" is also accepted as <parameter>subkey_id</parameter>. In that
1870
case the <link linkend="gnutls-openpgp-crt-get-auth-subkey"><function>gnutls_openpgp_crt_get_auth_subkey()</function></link> will be used to
1871
retrieve the subkey.</para>
1613
<indexterm zone="gnutls-certificate-set-openpgp-key-file2"><primary>gnutls_certificate_set_openpgp_key_file2</primary></indexterm>
1614
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_key_file2
1615
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
1616
<parameter>const <link linkend="char"><type>char</type></link> *certfile</parameter>,
1617
<parameter>const <link linkend="char"><type>char</type></link> *keyfile</parameter>,
1618
<parameter>const <link linkend="char"><type>char</type></link> *subkey_id</parameter>,
1619
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1873
1621
</para><variablelist role="params">
1874
1622
<varlistentry><term><parameter>res</parameter> :</term>
1875
<listitem><simpara> the destination context to save the data.
1876
1624
</simpara></listitem></varlistentry>
1877
1625
<varlistentry><term><parameter>certfile</parameter> :</term>
1878
<listitem><simpara> the file that contains the public key.
1879
1627
</simpara></listitem></varlistentry>
1880
1628
<varlistentry><term><parameter>keyfile</parameter> :</term>
1881
<listitem><simpara> the file that contains the secret key.
1882
1630
</simpara></listitem></varlistentry>
1883
1631
<varlistentry><term><parameter>subkey_id</parameter> :</term>
1884
<listitem><simpara> a hex encoded subkey id
1885
1633
</simpara></listitem></varlistentry>
1886
1634
<varlistentry><term><parameter>format</parameter> :</term>
1887
<listitem><simpara> the format of the keys
1888
</simpara></listitem></varlistentry>
1889
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1890
negative error value.
1892
</simpara></listitem></varlistentry>
1893
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1894
<refsect2 id="gnutls-certificate-set-openpgp-key-mem2" role="function" condition="since:2.4.0">
1636
</simpara></listitem></varlistentry>
1637
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1638
</simpara></listitem></varlistentry>
1639
</variablelist></refsect2>
1640
<refsect2 id="gnutls-certificate-set-openpgp-key-mem2" role="function">
1895
1641
<title>gnutls_certificate_set_openpgp_key_mem2 ()</title>
1896
<indexterm zone="gnutls-certificate-set-openpgp-key-mem2" role="2.4.0"><primary sortas="gnutls_certificate_set_openpgp_key_mem2">gnutls_certificate_set_openpgp_key_mem2</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_key_mem2
1897
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> res,
1898
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *cert,
1899
const <link linkend="gnutls-datum-t">gnutls_datum_t</link> *key,
1900
const <link linkend="char">char</link> *subkey_id,
1901
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1903
This funtion is used to load OpenPGP keys into the GnuTLS
1904
credentials structure. The files should only contain one key which
1908
The special keyword "auto" is also accepted as <parameter>subkey_id</parameter>. In that
1909
case the <link linkend="gnutls-openpgp-crt-get-auth-subkey"><function>gnutls_openpgp_crt_get_auth_subkey()</function></link> will be used to
1910
retrieve the subkey.</para>
1642
<indexterm zone="gnutls-certificate-set-openpgp-key-mem2"><primary>gnutls_certificate_set_openpgp_key_mem2</primary></indexterm>
1643
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_key_mem2
1644
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> res</parameter>,
1645
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *cert</parameter>,
1646
<parameter>const <link linkend="gnutls-datum-t"><type>gnutls_datum_t</type></link> *key</parameter>,
1647
<parameter>const <link linkend="char"><type>char</type></link> *subkey_id</parameter>,
1648
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1912
1650
</para><variablelist role="params">
1913
1651
<varlistentry><term><parameter>res</parameter> :</term>
1914
<listitem><simpara> the destination context to save the data.
1915
1653
</simpara></listitem></varlistentry>
1916
1654
<varlistentry><term><parameter>cert</parameter> :</term>
1917
<listitem><simpara> the datum that contains the public key.
1918
1656
</simpara></listitem></varlistentry>
1919
1657
<varlistentry><term><parameter>key</parameter> :</term>
1920
<listitem><simpara> the datum that contains the secret key.
1921
1659
</simpara></listitem></varlistentry>
1922
1660
<varlistentry><term><parameter>subkey_id</parameter> :</term>
1923
<listitem><simpara> a hex encoded subkey id
1924
1662
</simpara></listitem></varlistentry>
1925
1663
<varlistentry><term><parameter>format</parameter> :</term>
1926
<listitem><simpara> the format of the keys
1927
</simpara></listitem></varlistentry>
1928
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1929
negative error value.
1931
</simpara></listitem></varlistentry>
1932
</variablelist><para role="since">Since 2.4.0</para></refsect2>
1665
</simpara></listitem></varlistentry>
1666
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1667
</simpara></listitem></varlistentry>
1668
</variablelist></refsect2>
1933
1669
<refsect2 id="gnutls-certificate-set-openpgp-keyring-mem" role="function">
1934
1670
<title>gnutls_certificate_set_openpgp_keyring_mem ()</title>
1935
<indexterm zone="gnutls-certificate-set-openpgp-keyring-mem"><primary sortas="gnutls_certificate_set_openpgp_keyring_mem">gnutls_certificate_set_openpgp_keyring_mem</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_keyring_mem
1936
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> c,
1937
unsigned <link linkend="char">char</link> *data,
1938
<link linkend="size-t">size_t</link> dlen,
1939
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1941
The function is used to set keyrings that will be used internally
1942
by various OpenPGP functions. For example to find a key when it
1943
is needed for an operations. The keyring will also be used at the
1944
verification functions.</para>
1671
<indexterm zone="gnutls-certificate-set-openpgp-keyring-mem"><primary>gnutls_certificate_set_openpgp_keyring_mem</primary></indexterm>
1672
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_keyring_mem
1673
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> c</parameter>,
1674
<parameter>unsigned <link linkend="char"><type>char</type></link> *data</parameter>,
1675
<parameter><link linkend="size-t"><type>size_t</type></link> dlen</parameter>,
1676
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1946
1678
</para><variablelist role="params">
1947
1679
<varlistentry><term><parameter>c</parameter> :</term>
1948
<listitem><simpara> A certificate credentials structure
1949
1681
</simpara></listitem></varlistentry>
1950
1682
<varlistentry><term><parameter>data</parameter> :</term>
1951
<listitem><simpara> buffer with keyring data.
1952
1684
</simpara></listitem></varlistentry>
1953
1685
<varlistentry><term><parameter>dlen</parameter> :</term>
1954
<listitem><simpara> length of data buffer.
1955
1687
</simpara></listitem></varlistentry>
1956
1688
<varlistentry><term><parameter>format</parameter> :</term>
1957
<listitem><simpara> the format of the keyring
1958
1690
</simpara></listitem></varlistentry>
1959
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1960
negative error value.
1691
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1961
1692
</simpara></listitem></varlistentry>
1962
1693
</variablelist></refsect2>
1963
1694
<refsect2 id="gnutls-certificate-set-openpgp-keyring-file" role="function">
1964
1695
<title>gnutls_certificate_set_openpgp_keyring_file ()</title>
1965
<indexterm zone="gnutls-certificate-set-openpgp-keyring-file"><primary sortas="gnutls_certificate_set_openpgp_keyring_file">gnutls_certificate_set_openpgp_keyring_file</primary></indexterm><programlisting><link linkend="int">int</link> gnutls_certificate_set_openpgp_keyring_file
1966
(<link linkend="gnutls-certificate-credentials-t">gnutls_certificate_credentials_t</link> c,
1967
const <link linkend="char">char</link> *file,
1968
<link linkend="gnutls-openpgp-crt-fmt-t">gnutls_openpgp_crt_fmt_t</link> format);</programlisting>
1970
The function is used to set keyrings that will be used internally
1971
by various OpenPGP functions. For example to find a key when it
1972
is needed for an operations. The keyring will also be used at the
1973
verification functions.</para>
1696
<indexterm zone="gnutls-certificate-set-openpgp-keyring-file"><primary>gnutls_certificate_set_openpgp_keyring_file</primary></indexterm>
1697
<programlisting><link linkend="int"><returnvalue>int</returnvalue></link> gnutls_certificate_set_openpgp_keyring_file
1698
(<parameter><link linkend="gnutls-certificate-credentials-t"><type>gnutls_certificate_credentials_t</type></link> c</parameter>,
1699
<parameter>const <link linkend="char"><type>char</type></link> *file</parameter>,
1700
<parameter><link linkend="gnutls-openpgp-crt-fmt-t"><type>gnutls_openpgp_crt_fmt_t</type></link> format</parameter>);</programlisting>
1975
1702
</para><variablelist role="params">
1976
1703
<varlistentry><term><parameter>c</parameter> :</term>
1977
<listitem><simpara> A certificate credentials structure
1978
1705
</simpara></listitem></varlistentry>
1979
1706
<varlistentry><term><parameter>file</parameter> :</term>
1980
<listitem><simpara> filename of the keyring.
1981
1708
</simpara></listitem></varlistentry>
1982
1709
<varlistentry><term><parameter>format</parameter> :</term>
1983
<listitem><simpara> format of keyring.
1984
1711
</simpara></listitem></varlistentry>
1985
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> On success, <link linkend="GNUTLS-E-SUCCESS--CAPS"><literal>GNUTLS_E_SUCCESS</literal></link> is returned, otherwise a
1986
negative error value.
1712
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
1987
1713
</simpara></listitem></varlistentry>
1988
1714
</variablelist></refsect2>