Debian Codegraph @

build_helpers/heimdal/include/pkcs8_asn1.h

raw
1 /* Generated from ./pkcs8.asn1 */
2 /* Do not edit */
3
4 #ifndef __pkcs8_asn1_h__
5 #define __pkcs8_asn1_h__
6
7 #include <stddef.h>
8 #include <time.h>
9
10 #ifndef __asn1_common_definitions__
11 #define __asn1_common_definitions__
12
13 #ifndef __HEIM_BASE_DATA__
14 #define __HEIM_BASE_DATA__ 1
15 struct heim_base_data {
16 size_t length;
17 void *data;
18 };
19 typedef struct heim_base_data heim_octet_string;
20 #endif
21
22 typedef struct heim_integer {
23 size_t length;
24 void *data;
25 int negative;
26 } heim_integer;
27
28 typedef char *heim_general_string;
29
30 typedef char *heim_utf8_string;
31
32 typedef struct heim_base_data heim_printable_string;
33
34 typedef struct heim_base_data heim_ia5_string;
35
36 typedef struct heim_bmp_string {
37 size_t length;
38 uint16_t *data;
39 } heim_bmp_string;
40
41 typedef struct heim_universal_string {
42 size_t length;
43 uint32_t *data;
44 } heim_universal_string;
45
46 typedef char *heim_visible_string;
47
48 typedef struct heim_oid {
49 size_t length;
50 unsigned *components;
51 } heim_oid;
52
53 typedef struct heim_bit_string {
54 size_t length;
55 void *data;
56 } heim_bit_string;
57
58 typedef struct heim_base_data heim_any;
59 typedef struct heim_base_data heim_any_set;
60
61 #define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \
62 do { \
63 (BL) = length_##T((S)); \
64 (B) = malloc((BL)); \
65 if((B) == NULL) { \
66 (R) = ENOMEM; \
67 } else { \
68 (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \
69 (S), (L)); \
70 if((R) != 0) { \
71 free((B)); \
72 (B) = NULL; \
73 } \
74 } \
75 } while (0)
76
77 #ifdef _WIN32
78 #ifndef ASN1_LIB
79 #define ASN1EXP __declspec(dllimport)
80 #else
81 #define ASN1EXP
82 #endif
83 #define ASN1CALL __stdcall
84 #else
85 #define ASN1EXP
86 #define ASN1CALL
87 #endif
88 struct units;
89
90 #endif
91
92 #include <rfc2459_asn1.h>
93 #include <heim_asn1.h>
94 /*
95 PKCS8PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
96 */
97
98 typedef AlgorithmIdentifier PKCS8PrivateKeyAlgorithmIdentifier;
99
100 ASN1EXP int ASN1CALL decode_PKCS8PrivateKeyAlgorithmIdentifier(const unsigned char *, size_t, PKCS8PrivateKeyAlgorithmIdentifier *, size_t *);
101 ASN1EXP int ASN1CALL encode_PKCS8PrivateKeyAlgorithmIdentifier(unsigned char *, size_t, const PKCS8PrivateKeyAlgorithmIdentifier *, size_t *);
102 ASN1EXP size_t ASN1CALL length_PKCS8PrivateKeyAlgorithmIdentifier(const PKCS8PrivateKeyAlgorithmIdentifier *);
103 ASN1EXP int ASN1CALL copy_PKCS8PrivateKeyAlgorithmIdentifier (const PKCS8PrivateKeyAlgorithmIdentifier *, PKCS8PrivateKeyAlgorithmIdentifier *);
104 ASN1EXP void ASN1CALL free_PKCS8PrivateKeyAlgorithmIdentifier (PKCS8PrivateKeyAlgorithmIdentifier *);
105
106
107 /*
108 PKCS8PrivateKey ::= OCTET STRING
109 */
110
111 typedef heim_octet_string PKCS8PrivateKey;
112
113 ASN1EXP int ASN1CALL decode_PKCS8PrivateKey(const unsigned char *, size_t, PKCS8PrivateKey *, size_t *);
114 ASN1EXP int ASN1CALL encode_PKCS8PrivateKey(unsigned char *, size_t, const PKCS8PrivateKey *, size_t *);
115 ASN1EXP size_t ASN1CALL length_PKCS8PrivateKey(const PKCS8PrivateKey *);
116 ASN1EXP int ASN1CALL copy_PKCS8PrivateKey (const PKCS8PrivateKey *, PKCS8PrivateKey *);
117 ASN1EXP void ASN1CALL free_PKCS8PrivateKey (PKCS8PrivateKey *);
118
119
120 /*
121 PKCS8Attributes ::= SET OF Attribute
122 */
123
124 typedef struct PKCS8Attributes {
125 unsigned int len;
126 Attribute *val;
127 } PKCS8Attributes;
128
129 ASN1EXP int ASN1CALL decode_PKCS8Attributes(const unsigned char *, size_t, PKCS8Attributes *, size_t *);
130 ASN1EXP int ASN1CALL encode_PKCS8Attributes(unsigned char *, size_t, const PKCS8Attributes *, size_t *);
131 ASN1EXP size_t ASN1CALL length_PKCS8Attributes(const PKCS8Attributes *);
132 ASN1EXP int ASN1CALL copy_PKCS8Attributes (const PKCS8Attributes *, PKCS8Attributes *);
133 ASN1EXP void ASN1CALL free_PKCS8Attributes (PKCS8Attributes *);
134
135
136 /*
137 PKCS8PrivateKeyInfo ::= SEQUENCE {
138 version INTEGER,
139 privateKeyAlgorithm PKCS8PrivateKeyAlgorithmIdentifier,
140 privateKey PKCS8PrivateKey,
141 attributes [0] IMPLICIT SET OF Attribute OPTIONAL,
142 }
143 */
144
145 typedef struct PKCS8PrivateKeyInfo {
146 heim_integer version;
147 PKCS8PrivateKeyAlgorithmIdentifier privateKeyAlgorithm;
148 PKCS8PrivateKey privateKey;
149 struct PKCS8PrivateKeyInfo_attributes {
150 unsigned int len;
151 Attribute *val;
152 } *attributes;
153 } PKCS8PrivateKeyInfo;
154
155 ASN1EXP int ASN1CALL decode_PKCS8PrivateKeyInfo(const unsigned char *, size_t, PKCS8PrivateKeyInfo *, size_t *);
156 ASN1EXP int ASN1CALL encode_PKCS8PrivateKeyInfo(unsigned char *, size_t, const PKCS8PrivateKeyInfo *, size_t *);
157 ASN1EXP size_t ASN1CALL length_PKCS8PrivateKeyInfo(const PKCS8PrivateKeyInfo *);
158 ASN1EXP int ASN1CALL copy_PKCS8PrivateKeyInfo (const PKCS8PrivateKeyInfo *, PKCS8PrivateKeyInfo *);
159 ASN1EXP void ASN1CALL free_PKCS8PrivateKeyInfo (PKCS8PrivateKeyInfo *);
160
161
162 /*
163 PKCS8EncryptedData ::= OCTET STRING
164 */
165
166 typedef heim_octet_string PKCS8EncryptedData;
167
168 ASN1EXP int ASN1CALL decode_PKCS8EncryptedData(const unsigned char *, size_t, PKCS8EncryptedData *, size_t *);
169 ASN1EXP int ASN1CALL encode_PKCS8EncryptedData(unsigned char *, size_t, const PKCS8EncryptedData *, size_t *);
170 ASN1EXP size_t ASN1CALL length_PKCS8EncryptedData(const PKCS8EncryptedData *);
171 ASN1EXP int ASN1CALL copy_PKCS8EncryptedData (const PKCS8EncryptedData *, PKCS8EncryptedData *);
172 ASN1EXP void ASN1CALL free_PKCS8EncryptedData (PKCS8EncryptedData *);
173
174
175 /*
176 PKCS8EncryptedPrivateKeyInfo ::= SEQUENCE {
177 encryptionAlgorithm AlgorithmIdentifier,
178 encryptedData PKCS8EncryptedData,
179 }
180 */
181
182 typedef struct PKCS8EncryptedPrivateKeyInfo {
183 AlgorithmIdentifier encryptionAlgorithm;
184 PKCS8EncryptedData encryptedData;
185 } PKCS8EncryptedPrivateKeyInfo;
186
187 ASN1EXP int ASN1CALL decode_PKCS8EncryptedPrivateKeyInfo(const unsigned char *, size_t, PKCS8EncryptedPrivateKeyInfo *, size_t *);
188 ASN1EXP int ASN1CALL encode_PKCS8EncryptedPrivateKeyInfo(unsigned char *, size_t, const PKCS8EncryptedPrivateKeyInfo *, size_t *);
189 ASN1EXP size_t ASN1CALL length_PKCS8EncryptedPrivateKeyInfo(const PKCS8EncryptedPrivateKeyInfo *);
190 ASN1EXP int ASN1CALL copy_PKCS8EncryptedPrivateKeyInfo (const PKCS8EncryptedPrivateKeyInfo *, PKCS8EncryptedPrivateKeyInfo *);
191 ASN1EXP void ASN1CALL free_PKCS8EncryptedPrivateKeyInfo (PKCS8EncryptedPrivateKeyInfo *);
192
193
194 #endif /* __pkcs8_asn1_h__ */