Debian Codegraph @

build_helpers/heimdal/include/pkcs10_asn1.h

raw
1 /* Generated from ./pkcs10.asn1 */
2 /* Do not edit */
3
4 #ifndef __pkcs10_asn1_h__
5 #define __pkcs10_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 /*
94 CertificationRequestInfo ::= SEQUENCE {
95 version INTEGER {
96 pkcs10_v1(0)
97 },
98 subject Name,
99 subjectPKInfo SubjectPublicKeyInfo,
100 attributes [0] IMPLICIT SET OF Attribute OPTIONAL,
101 }
102 */
103
104 typedef struct CertificationRequestInfo {
105 heim_octet_string _save;
106 enum {
107 pkcs10_v1 = 0
108 } version;
109 Name subject;
110 SubjectPublicKeyInfo subjectPKInfo;
111 struct CertificationRequestInfo_attributes {
112 unsigned int len;
113 Attribute *val;
114 } *attributes;
115 } CertificationRequestInfo;
116
117 ASN1EXP int ASN1CALL decode_CertificationRequestInfo(const unsigned char *, size_t, CertificationRequestInfo *, size_t *);
118 ASN1EXP int ASN1CALL encode_CertificationRequestInfo(unsigned char *, size_t, const CertificationRequestInfo *, size_t *);
119 ASN1EXP size_t ASN1CALL length_CertificationRequestInfo(const CertificationRequestInfo *);
120 ASN1EXP int ASN1CALL copy_CertificationRequestInfo (const CertificationRequestInfo *, CertificationRequestInfo *);
121 ASN1EXP void ASN1CALL free_CertificationRequestInfo (CertificationRequestInfo *);
122
123
124 /*
125 CertificationRequest ::= SEQUENCE {
126 certificationRequestInfo CertificationRequestInfo,
127 signatureAlgorithm AlgorithmIdentifier,
128 signature BIT STRING {
129 },
130 }
131 */
132
133 typedef struct CertificationRequest {
134 CertificationRequestInfo certificationRequestInfo;
135 AlgorithmIdentifier signatureAlgorithm;
136 heim_bit_string signature;
137 } CertificationRequest;
138
139 ASN1EXP int ASN1CALL decode_CertificationRequest(const unsigned char *, size_t, CertificationRequest *, size_t *);
140 ASN1EXP int ASN1CALL encode_CertificationRequest(unsigned char *, size_t, const CertificationRequest *, size_t *);
141 ASN1EXP size_t ASN1CALL length_CertificationRequest(const CertificationRequest *);
142 ASN1EXP int ASN1CALL copy_CertificationRequest (const CertificationRequest *, CertificationRequest *);
143 ASN1EXP void ASN1CALL free_CertificationRequest (CertificationRequest *);
144
145
146 #endif /* __pkcs10_asn1_h__ */