1/*	$NetBSD: hx509-private.h,v 1.2 2019/12/15 22:50:50 christos Exp $	*/
2
3/* This is a generated file */
4#ifndef __hx509_private_h__
5#define __hx509_private_h__
6
7#include <stdarg.h>
8
9#if !defined(__GNUC__) && !defined(__attribute__)
10#define __attribute__(x)
11#endif
12
13int
14_hx509_AlgorithmIdentifier_cmp (
15	const AlgorithmIdentifier */*p*/,
16	const AlgorithmIdentifier */*q*/);
17
18int
19_hx509_Certificate_cmp (
20	const Certificate */*p*/,
21	const Certificate */*q*/);
22
23int
24_hx509_Name_to_string (
25	const Name */*n*/,
26	char **/*str*/);
27
28time_t
29_hx509_Time2time_t (const Time */*t*/);
30
31void
32_hx509_abort (
33	const char */*fmt*/,
34	...)
35     __attribute__ ((__noreturn__, __format__ (__printf__, 1, 2)));
36
37int
38_hx509_calculate_path (
39	hx509_context /*context*/,
40	int /*flags*/,
41	time_t /*time_now*/,
42	hx509_certs /*anchors*/,
43	unsigned int /*max_depth*/,
44	hx509_cert /*cert*/,
45	hx509_certs /*pool*/,
46	hx509_path */*path*/);
47
48int
49_hx509_cert_assign_key (
50	hx509_cert /*cert*/,
51	hx509_private_key /*private_key*/);
52
53int
54_hx509_cert_get_eku (
55	hx509_context /*context*/,
56	hx509_cert /*cert*/,
57	ExtKeyUsage */*e*/);
58
59int
60_hx509_cert_get_keyusage (
61	hx509_context /*context*/,
62	hx509_cert /*c*/,
63	KeyUsage */*ku*/);
64
65int
66_hx509_cert_get_version (const Certificate */*t*/);
67
68int
69_hx509_cert_is_parent_cmp (
70	const Certificate */*subject*/,
71	const Certificate */*issuer*/,
72	int /*allow_self_signed*/);
73
74int
75_hx509_cert_private_decrypt (
76	hx509_context /*context*/,
77	const heim_octet_string */*ciphertext*/,
78	const heim_oid */*encryption_oid*/,
79	hx509_cert /*p*/,
80	heim_octet_string */*cleartext*/);
81
82hx509_private_key
83_hx509_cert_private_key (hx509_cert /*p*/);
84
85int
86_hx509_cert_private_key_exportable (hx509_cert /*p*/);
87
88void
89_hx509_cert_set_release (
90	hx509_cert /*cert*/,
91	_hx509_cert_release_func /*release*/,
92	void */*ctx*/);
93
94int
95_hx509_cert_to_env (
96	hx509_context /*context*/,
97	hx509_cert /*cert*/,
98	hx509_env */*env*/);
99
100int
101_hx509_certs_keys_add (
102	hx509_context /*context*/,
103	hx509_certs /*certs*/,
104	hx509_private_key /*key*/);
105
106void
107_hx509_certs_keys_free (
108	hx509_context /*context*/,
109	hx509_private_key */*keys*/);
110
111int
112_hx509_certs_keys_get (
113	hx509_context /*context*/,
114	hx509_certs /*certs*/,
115	hx509_private_key **/*keys*/);
116
117int
118_hx509_check_key_usage (
119	hx509_context /*context*/,
120	hx509_cert /*cert*/,
121	unsigned /*flags*/,
122	int /*req_present*/);
123
124int
125_hx509_collector_alloc (
126	hx509_context /*context*/,
127	hx509_lock /*lock*/,
128	struct hx509_collector **/*collector*/);
129
130int
131_hx509_collector_certs_add (
132	hx509_context /*context*/,
133	struct hx509_collector */*c*/,
134	hx509_cert /*cert*/);
135
136int
137_hx509_collector_collect_certs (
138	hx509_context /*context*/,
139	struct hx509_collector */*c*/,
140	hx509_certs */*ret_certs*/);
141
142int
143_hx509_collector_collect_private_keys (
144	hx509_context /*context*/,
145	struct hx509_collector */*c*/,
146	hx509_private_key **/*keys*/);
147
148void
149_hx509_collector_free (struct hx509_collector */*c*/);
150
151hx509_lock
152_hx509_collector_get_lock (struct hx509_collector */*c*/);
153
154int
155_hx509_collector_private_key_add (
156	hx509_context /*context*/,
157	struct hx509_collector */*c*/,
158	const AlgorithmIdentifier */*alg*/,
159	hx509_private_key /*private_key*/,
160	const heim_octet_string */*key_data*/,
161	const heim_octet_string */*localKeyId*/);
162
163int
164_hx509_create_signature (
165	hx509_context /*context*/,
166	const hx509_private_key /*signer*/,
167	const AlgorithmIdentifier */*alg*/,
168	const heim_octet_string */*data*/,
169	AlgorithmIdentifier */*signatureAlgorithm*/,
170	heim_octet_string */*sig*/);
171
172int
173_hx509_create_signature_bitstring (
174	hx509_context /*context*/,
175	const hx509_private_key /*signer*/,
176	const AlgorithmIdentifier */*alg*/,
177	const heim_octet_string */*data*/,
178	AlgorithmIdentifier */*signatureAlgorithm*/,
179	heim_bit_string */*sig*/);
180
181int
182_hx509_expr_eval (
183	hx509_context /*context*/,
184	hx509_env /*env*/,
185	struct hx_expr */*expr*/);
186
187void
188_hx509_expr_free (struct hx_expr */*expr*/);
189
190struct hx_expr *
191_hx509_expr_parse (const char */*buf*/);
192
193int
194_hx509_find_extension_subject_key_id (
195	const Certificate */*issuer*/,
196	SubjectKeyIdentifier */*si*/);
197
198const struct signature_alg *
199_hx509_find_sig_alg (const heim_oid */*oid*/);
200
201int
202_hx509_generate_private_key (
203	hx509_context /*context*/,
204	struct hx509_generate_private_context */*ctx*/,
205	hx509_private_key */*private_key*/);
206
207int
208_hx509_generate_private_key_bits (
209	hx509_context /*context*/,
210	struct hx509_generate_private_context */*ctx*/,
211	unsigned long /*bits*/);
212
213void
214_hx509_generate_private_key_free (struct hx509_generate_private_context **/*ctx*/);
215
216int
217_hx509_generate_private_key_init (
218	hx509_context /*context*/,
219	const heim_oid */*oid*/,
220	struct hx509_generate_private_context **/*ctx*/);
221
222int
223_hx509_generate_private_key_is_ca (
224	hx509_context /*context*/,
225	struct hx509_generate_private_context */*ctx*/);
226
227Certificate *
228_hx509_get_cert (hx509_cert /*cert*/);
229
230void
231_hx509_ks_dir_register (hx509_context /*context*/);
232
233void
234_hx509_ks_file_register (hx509_context /*context*/);
235
236void
237_hx509_ks_keychain_register (hx509_context /*context*/);
238
239void
240_hx509_ks_mem_register (hx509_context /*context*/);
241
242void
243_hx509_ks_null_register (hx509_context /*context*/);
244
245void
246_hx509_ks_pkcs11_register (hx509_context /*context*/);
247
248void
249_hx509_ks_pkcs12_register (hx509_context /*context*/);
250
251void
252_hx509_ks_register (
253	hx509_context /*context*/,
254	struct hx509_keyset_ops */*ops*/);
255
256int
257_hx509_lock_find_cert (
258	hx509_lock /*lock*/,
259	const hx509_query */*q*/,
260	hx509_cert */*c*/);
261
262const struct _hx509_password *
263_hx509_lock_get_passwords (hx509_lock /*lock*/);
264
265hx509_certs
266_hx509_lock_unlock_certs (hx509_lock /*lock*/);
267
268struct hx_expr *
269_hx509_make_expr (
270	enum hx_expr_op /*op*/,
271	void */*arg1*/,
272	void */*arg2*/);
273
274int
275_hx509_map_file_os (
276	const char */*fn*/,
277	heim_octet_string */*os*/);
278
279int
280_hx509_match_keys (
281	hx509_cert /*c*/,
282	hx509_private_key /*key*/);
283
284int
285_hx509_name_cmp (
286	const Name */*n1*/,
287	const Name */*n2*/,
288	int */*c*/);
289
290int
291_hx509_name_ds_cmp (
292	const DirectoryString */*ds1*/,
293	const DirectoryString */*ds2*/,
294	int */*diff*/);
295
296int
297_hx509_name_from_Name (
298	const Name */*n*/,
299	hx509_name */*name*/);
300
301int
302_hx509_name_modify (
303	hx509_context /*context*/,
304	Name */*name*/,
305	int /*append*/,
306	const heim_oid */*oid*/,
307	const char */*str*/);
308
309int
310_hx509_path_append (
311	hx509_context /*context*/,
312	hx509_path */*path*/,
313	hx509_cert /*cert*/);
314
315void
316_hx509_path_free (hx509_path */*path*/);
317
318int
319_hx509_pbe_decrypt (
320	hx509_context /*context*/,
321	hx509_lock /*lock*/,
322	const AlgorithmIdentifier */*ai*/,
323	const heim_octet_string */*econtent*/,
324	heim_octet_string */*content*/);
325
326int
327_hx509_pbe_encrypt (
328	hx509_context /*context*/,
329	hx509_lock /*lock*/,
330	const AlgorithmIdentifier */*ai*/,
331	const heim_octet_string */*content*/,
332	heim_octet_string */*econtent*/);
333
334void
335_hx509_pi_printf (
336	int (*/*func*/)(void *, const char *),
337	void */*ctx*/,
338	const char */*fmt*/,
339	...);
340
341void
342_hx509_private_eckey_free (void */*eckey*/);
343
344int
345_hx509_private_key_export (
346	hx509_context /*context*/,
347	const hx509_private_key /*key*/,
348	hx509_key_format_t /*format*/,
349	heim_octet_string */*data*/);
350
351int
352_hx509_private_key_exportable (hx509_private_key /*key*/);
353
354BIGNUM *
355_hx509_private_key_get_internal (
356	hx509_context /*context*/,
357	hx509_private_key /*key*/,
358	const char */*type*/);
359
360int
361_hx509_private_key_oid (
362	hx509_context /*context*/,
363	const hx509_private_key /*key*/,
364	heim_oid */*data*/);
365
366hx509_private_key
367_hx509_private_key_ref (hx509_private_key /*key*/);
368
369const char *
370_hx509_private_pem_name (hx509_private_key /*key*/);
371
372int
373_hx509_public_encrypt (
374	hx509_context /*context*/,
375	const heim_octet_string */*cleartext*/,
376	const Certificate */*cert*/,
377	heim_oid */*encryption_oid*/,
378	heim_octet_string */*ciphertext*/);
379
380void
381_hx509_query_clear (hx509_query */*q*/);
382
383int
384_hx509_query_match_cert (
385	hx509_context /*context*/,
386	const hx509_query */*q*/,
387	hx509_cert /*cert*/);
388
389void
390_hx509_query_statistic (
391	hx509_context /*context*/,
392	int /*type*/,
393	const hx509_query */*q*/);
394
395int
396_hx509_request_add_dns_name (
397	hx509_context /*context*/,
398	hx509_request /*req*/,
399	const char */*hostname*/);
400
401int
402_hx509_request_add_eku (
403	hx509_context /*context*/,
404	hx509_request /*req*/,
405	const heim_oid */*oid*/);
406
407int
408_hx509_request_add_email (
409	hx509_context /*context*/,
410	hx509_request /*req*/,
411	const char */*email*/);
412
413int
414_hx509_request_parse (
415	hx509_context /*context*/,
416	const char */*path*/,
417	hx509_request */*req*/);
418
419int
420_hx509_request_print (
421	hx509_context /*context*/,
422	hx509_request /*req*/,
423	FILE */*f*/);
424
425int
426_hx509_request_to_pkcs10 (
427	hx509_context /*context*/,
428	const hx509_request /*req*/,
429	const hx509_private_key /*signer*/,
430	heim_octet_string */*request*/);
431
432hx509_revoke_ctx
433_hx509_revoke_ref (hx509_revoke_ctx /*ctx*/);
434
435void
436_hx509_sel_yyerror (const char */*s*/);
437
438int
439_hx509_self_signed_valid (
440	hx509_context /*context*/,
441	const AlgorithmIdentifier */*alg*/);
442
443int
444_hx509_set_cert_attribute (
445	hx509_context /*context*/,
446	hx509_cert /*cert*/,
447	const heim_oid */*oid*/,
448	const heim_octet_string */*attr*/);
449
450int
451_hx509_set_digest_alg (
452	DigestAlgorithmIdentifier */*id*/,
453	const heim_oid */*oid*/,
454	const void */*param*/,
455	size_t /*length*/);
456
457int
458_hx509_signature_is_weak (
459	hx509_context /*context*/,
460	const AlgorithmIdentifier */*alg*/);
461
462void
463_hx509_unmap_file_os (heim_octet_string */*os*/);
464
465int
466_hx509_unparse_Name (
467	const Name */*aname*/,
468	char **/*str*/);
469
470time_t
471_hx509_verify_get_time (hx509_verify_ctx /*ctx*/);
472
473int
474_hx509_verify_signature (
475	hx509_context /*context*/,
476	const hx509_cert /*cert*/,
477	const AlgorithmIdentifier */*alg*/,
478	const heim_octet_string */*data*/,
479	const heim_octet_string */*sig*/);
480
481int
482_hx509_verify_signature_bitstring (
483	hx509_context /*context*/,
484	const hx509_cert /*signer*/,
485	const AlgorithmIdentifier */*alg*/,
486	const heim_octet_string */*data*/,
487	const heim_bit_string */*sig*/);
488
489int
490_hx509_write_file (
491	const char */*fn*/,
492	const void */*data*/,
493	size_t /*length*/);
494
495#endif /* __hx509_private_h__ */
496