Debian Codegraph @

lib/hx509/hx509.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2004 - 2007 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34 /* $Id$ */
35
36 #ifndef HEIMDAL_HX509_H
37 #define HEIMDAL_HX509_Hcxx . . $ `lib/hx509/hx509.h:37:9`! 1
38
39 #include <rfc2459_asn1.h>cxx . . $ `<file>/include/rfc2459_asn1.h`/
40 #include <stdarg.h>
41 #include <stdio.h>
42 #include <heimbase.h>cxx . . $ `<file>/include/heimbase.h`/
43
44 typedef struct hx509_cert_attribute_datacxx . . $ hx509_cert_attribute_data# *hx509_cert_attributecxx . . $ hx509_cert_attribute#;
45 typedef struct hx509_cert_datacxx . . $ hx509_cert_data# *hx509_certcxx . . $ hx509_cert#;
46 typedef struct hx509_certs_datacxx . . $ hx509_certs_data# *hx509_certscxx . . $ hx509_certs#;
47 typedef struct hx509_context_datacxx . . $ hx509_context_data# *hx509_contextcxx . . $ hx509_context#;
48 typedef struct hx509_crypto_datacxx . . $ hx509_crypto_data# *hx509_cryptocxx . . $ hx509_crypto#;
49 typedef struct hx509_lock_datacxx . . $ hx509_lock_data# *hx509_lockcxx . . $ hx509_lock#;
50 typedef struct hx509_name_datacxx . . $ hx509_name_data# *hx509_namecxx . . $ hx509_name#;
51 typedef struct hx509_private_keycxx . . $ hx509_private_key# *hx509_private_keycxx . . $ hx509_private_key#;
52 typedef struct hx509_private_key_opscxx . . $ hx509_private_key_ops# hx509_private_key_opscxx . . $ hx509_private_key_ops#;
53 typedef struct hx509_validate_ctx_datacxx . . $ hx509_validate_ctx_data# *hx509_validate_ctxcxx . . $ hx509_validate_ctx#;
54 typedef struct hx509_verify_ctx_datacxx . . $ hx509_verify_ctx_data# *hx509_verify_ctxcxx . . $ hx509_verify_ctx#;
55 typedef struct hx509_revoke_ctx_datacxx . . $ hx509_revoke_ctx_data# *hx509_revoke_ctxcxx . . $ hx509_revoke_ctx#;
56 typedef struct hx509_query_datacxx . . $ hx509_query_data# hx509_querycxx . . $ hx509_query#;
57 typedef void * hx509_cursorcxx . . $ hx509_cursor#;
58 typedef struct hx509_request_datacxx . . $ hx509_request_data# *hx509_requestcxx . . $ hx509_request#;
59 typedef struct hx509_error_datacxx . . $ hx509_error_data# *hx509_errorcxx . . $ hx509_error#;
60 typedef struct hx509_peer_infocxx . . $ hx509_peer_info# *hx509_peer_infocxx . . $ hx509_peer_info#;
61 typedef struct hx509_ca_tbscxx . . $ hx509_ca_tbs# *hx509_ca_tbscxx . . $ hx509_ca_tbs#;
62 typedef struct hx509_env_datacxx . . $ hx509_env_data# *hx509_envcxx . . $ hx509_env#;
63 typedef struct hx509_crlcxx . . $ hx509_crl# *hx509_crlcxx . . $ hx509_crl#;
64
65 typedef void (*hx509_vprint_funccxx . . $ hx509_vprint_func#)(void *, const char *, va_listcxx . . $ va_list#);
66
67 enumcxx . . $ $anonymous_type_5bddeb814002d2f3_0# {
68 HX509_VHN_F_ALLOW_NO_MATCHcxx . . $ HX509_VHN_F_ALLOW_NO_MATCH. = 1
69 };
70
71 enumcxx . . $ $anonymous_type_5bddeb814002d2f3_1# {
72 HX509_VALIDATE_F_VALIDATEcxx . . $ HX509_VALIDATE_F_VALIDATE. = 1,
73 HX509_VALIDATE_F_VERBOSEcxx . . $ HX509_VALIDATE_F_VERBOSE. = 2
74 };
75
76 enumcxx . . $ $anonymous_type_5bddeb814002d2f3_2# {
77 HX509_CRYPTO_PADDING_PKCS7cxx . . $ HX509_CRYPTO_PADDING_PKCS7. = 0,
78 HX509_CRYPTO_PADDING_NONEcxx . . $ HX509_CRYPTO_PADDING_NONE. = 1
79 };
80
81 enumcxx . . $ $anonymous_type_5bddeb814002d2f3_3# {
82 HX509_KEY_FORMAT_GUESScxx . . $ HX509_KEY_FORMAT_GUESS. = 0,
83 HX509_KEY_FORMAT_DERcxx . . $ HX509_KEY_FORMAT_DER. = 1,
84 HX509_KEY_FORMAT_WIN_BACKUPKEYcxx . . $ HX509_KEY_FORMAT_WIN_BACKUPKEY. = 2
85 };
86 typedef uint32_tcxx . . $ uint32_t# hx509_key_format_tcxx . . $ hx509_key_format_t#;
87
88 struct hx509_cert_attribute_datacxx . . $ hx509_cert_attribute_data# {
89 heim_oidcxx . . $ heim_oid# oidcxx . . $ hx509_cert_attribute_data#oid.;
90 heim_octet_stringcxx . . $ heim_octet_string# datacxx . . $ hx509_cert_attribute_data#data.;
91 };
92
93 typedef enumcxx . . $ $anonymous_type_5bddeb814002d2f3_4# {
94 HX509_PROMPT_TYPE_PASSWORDcxx . . $ HX509_PROMPT_TYPE_PASSWORD. = 0x1, /* password, hidden */
95 HX509_PROMPT_TYPE_QUESTIONcxx . . $ HX509_PROMPT_TYPE_QUESTION. = 0x2, /* question, not hidden */
96 HX509_PROMPT_TYPE_INFOcxx . . $ HX509_PROMPT_TYPE_INFO. = 0x4 /* infomation, reply doesn't matter */
97 } hx509_prompt_typecxx . . $ hx509_prompt_type#;
98
99 typedef struct hx509_promptcxx . . $ hx509_prompt# {
100 const char *promptcxx . . $ hx509_prompt#prompt.;
101 hx509_prompt_typecxx . . $ hx509_prompt_type# typecxx . . $ hx509_prompt#type.;
102 heim_octet_stringcxx . . $ heim_octet_string# replycxx . . $ hx509_prompt#reply.;
103 } hx509_promptcxx . . $ hx509_prompt#;
104
105 typedef int (*hx509_prompter_fctcxx . . $ hx509_prompter_fct#)(void *, const hx509_promptcxx . . $ hx509_prompt# *);
106
107 typedef struct hx509_octet_string_listcxx . . $ hx509_octet_string_list# {
108 size_t lencxx . . $ hx509_octet_string_list#len.;
109 heim_octet_stringcxx . . $ heim_octet_string# *valcxx . . $ hx509_octet_string_list#val.;
110 } hx509_octet_string_listcxx . . $ hx509_octet_string_list#;
111
112 typedef struct hx509_pem_headercxx . . $ hx509_pem_header# {
113 struct hx509_pem_headercxx . . $ hx509_pem_header# *nextcxx . . $ hx509_pem_header#next.;
114 char *headercxx . . $ hx509_pem_header#header.;
115 char *valuecxx . . $ hx509_pem_header#value.;
116 } hx509_pem_headercxx . . $ hx509_pem_header#;
117
118 typedef int
119 (*hx509_pem_read_funccxx . . $ hx509_pem_read_func#)(hx509_contextcxx . . $ hx509_context#, const char *, const hx509_pem_headercxx . . $ hx509_pem_header# *,
120 const void *, size_t, void *ctx);
121
122 /*
123 * Options passed to hx509_query_match_option.
124 */
125 typedef enumcxx . . $ $anonymous_type_5bddeb814002d2f3_5# {
126 HX509_QUERY_OPTION_PRIVATE_KEYcxx . . $ HX509_QUERY_OPTION_PRIVATE_KEY. = 1,
127 HX509_QUERY_OPTION_KU_ENCIPHERMENTcxx . . $ HX509_QUERY_OPTION_KU_ENCIPHERMENT. = 2,
128 HX509_QUERY_OPTION_KU_DIGITALSIGNATUREcxx . . $ HX509_QUERY_OPTION_KU_DIGITALSIGNATURE. = 3,
129 HX509_QUERY_OPTION_KU_KEYCERTSIGNcxx . . $ HX509_QUERY_OPTION_KU_KEYCERTSIGN. = 4,
130 HX509_QUERY_OPTION_ENDcxx . . $ HX509_QUERY_OPTION_END. = 0xffff
131 } hx509_query_optioncxx . . $ hx509_query_option#;
132
133 /* flags to hx509_certs_init */
134 #define HX509_CERTS_CREATEcxx . . $ `lib/hx509/hx509.h:134:9`! 0x01
135 #define HX509_CERTS_UNPROTECT_ALLcxx . . $ `lib/hx509/hx509.h:135:9`! 0x02
136
137 /* flags to hx509_set_error_string */
138 #define HX509_ERROR_APPENDcxx . . $ `lib/hx509/hx509.h:138:9`! 0x01
139
140 /* flags to hx509_cms_unenvelope */
141 #define HX509_CMS_UE_DONT_REQUIRE_KU_ENCIPHERMENTcxx . . $ `lib/hx509/hx509.h:141:9`! 0x01
142 #define HX509_CMS_UE_ALLOW_WEAKcxx . . $ `lib/hx509/hx509.h:142:9`! 0x02
143
144 /* flags to hx509_cms_envelope_1 */
145 #define HX509_CMS_EV_NO_KU_CHECKcxx . . $ `lib/hx509/hx509.h:145:9`! 0x01
146 #define HX509_CMS_EV_ALLOW_WEAKcxx . . $ `lib/hx509/hx509.h:146:9`! 0x02
147 #define HX509_CMS_EV_ID_NAMEcxx . . $ `lib/hx509/hx509.h:147:9`! 0x04
148
149 /* flags to hx509_cms_verify_signed */
150 #define HX509_CMS_VS_ALLOW_DATA_OID_MISMATCHcxx . . $ `lib/hx509/hx509.h:150:9`! 0x01
151 #define HX509_CMS_VS_NO_KU_CHECKcxx . . $ `lib/hx509/hx509.h:151:9`! 0x02
152 #define HX509_CMS_VS_ALLOW_ZERO_SIGNERcxx . . $ `lib/hx509/hx509.h:152:9`! 0x04
153 #define HX509_CMS_VS_NO_VALIDATEcxx . . $ `lib/hx509/hx509.h:153:9`! 0x08
154
155 /* selectors passed to hx509_crypto_select and hx509_crypto_available */
156 #define HX509_SELECT_ALLcxx . . $ `lib/hx509/hx509.h:156:9`! 0
157 #define HX509_SELECT_DIGESTcxx . . $ `lib/hx509/hx509.h:157:9`! 1
158 #define HX509_SELECT_PUBLIC_SIGcxx . . $ `lib/hx509/hx509.h:158:9`! 2
159 #define HX509_SELECT_PUBLIC_ENCcxx . . $ `lib/hx509/hx509.h:159:9`! 3
160 #define HX509_SELECT_SECRET_ENCcxx . . $ `lib/hx509/hx509.h:160:9`! 4
161
162 /* flags to hx509_ca_tbs_set_template */
163 #define HX509_CA_TEMPLATE_SUBJECTcxx . . $ `lib/hx509/hx509.h:163:9`! 1
164 #define HX509_CA_TEMPLATE_SERIALcxx . . $ `lib/hx509/hx509.h:164:9`! 2
165 #define HX509_CA_TEMPLATE_NOTBEFOREcxx . . $ `lib/hx509/hx509.h:165:9`! 4
166 #define HX509_CA_TEMPLATE_NOTAFTERcxx . . $ `lib/hx509/hx509.h:166:9`! 8
167 #define HX509_CA_TEMPLATE_SPKIcxx . . $ `lib/hx509/hx509.h:167:9`! 16
168 #define HX509_CA_TEMPLATE_KUcxx . . $ `lib/hx509/hx509.h:168:9`! 32
169 #define HX509_CA_TEMPLATE_EKUcxx . . $ `lib/hx509/hx509.h:169:9`! 64
170
171 /* flags hx509_cms_create_signed* */
172 #define HX509_CMS_SIGNATURE_DETACHEDcxx . . $ `lib/hx509/hx509.h:172:9`! 0x01
173 #define HX509_CMS_SIGNATURE_ID_NAMEcxx . . $ `lib/hx509/hx509.h:173:9`! 0x02
174 #define HX509_CMS_SIGNATURE_NO_SIGNERcxx . . $ `lib/hx509/hx509.h:174:9`! 0x04
175 #define HX509_CMS_SIGNATURE_LEAF_ONLYcxx . . $ `lib/hx509/hx509.h:175:9`! 0x08
176 #define HX509_CMS_SIGNATURE_NO_CERTScxx . . $ `lib/hx509/hx509.h:176:9`! 0x10
177
178 /* hx509_verify_hostname nametype */
179 typedef enumcxx . . $ $anonymous_type_5bddeb814002d2f3_6# {
180 HX509_HN_HOSTNAMEcxx . . $ HX509_HN_HOSTNAME. = 0,
181 HX509_HN_DNSSRVcxx . . $ HX509_HN_DNSSRV.
182 } hx509_hostname_typecxx . . $ hx509_hostname_type#;
183
184 #include <hx509-protos.h>cxx . . $ `<file>/lib/hx509/hx509-protos.h`/
185 #include <hx509_err.h>cxx . . $ `<file>/lib/hx509/hx509_err.h`/
186
187 #endif /* HEIMDAL_HX509_H */