| 1 |
/* Generated from ./pkcs12.asn1 */ |
| 2 |
/* Do not edit */ |
| 3 |
|
| 4 |
#ifndef __pkcs12_asn1_h__ |
| 5 |
#define __pkcs12_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 <cms_asn1.h> |
| 93 |
#include <rfc2459_asn1.h> |
| 94 |
#include <heim_asn1.h> |
| 95 |
/* OBJECT IDENTIFIER id-pkcs-12 ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) } */ |
| 96 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs_12; |
| 97 |
#define ASN1_OID_ID_PKCS_12 (&asn1_oid_id_pkcs_12) |
| 98 |
|
| 99 |
/* OBJECT IDENTIFIER id-pkcs-12PbeIds ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) } */ |
| 100 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs_12PbeIds; |
| 101 |
#define ASN1_OID_ID_PKCS_12PBEIDS (&asn1_oid_id_pkcs_12PbeIds) |
| 102 |
|
| 103 |
/* OBJECT IDENTIFIER id-pbeWithSHAAnd128BitRC4 ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) label-less(1) } */ |
| 104 |
extern ASN1EXP const heim_oid asn1_oid_id_pbeWithSHAAnd128BitRC4; |
| 105 |
#define ASN1_OID_ID_PBEWITHSHAAND128BITRC4 (&asn1_oid_id_pbeWithSHAAnd128BitRC4) |
| 106 |
|
| 107 |
/* OBJECT IDENTIFIER id-pbeWithSHAAnd40BitRC4 ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) label-less(2) } */ |
| 108 |
extern ASN1EXP const heim_oid asn1_oid_id_pbeWithSHAAnd40BitRC4; |
| 109 |
#define ASN1_OID_ID_PBEWITHSHAAND40BITRC4 (&asn1_oid_id_pbeWithSHAAnd40BitRC4) |
| 110 |
|
| 111 |
/* OBJECT IDENTIFIER id-pbeWithSHAAnd3-KeyTripleDES-CBC ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) label-less(3) } */ |
| 112 |
extern ASN1EXP const heim_oid asn1_oid_id_pbeWithSHAAnd3_KeyTripleDES_CBC; |
| 113 |
#define ASN1_OID_ID_PBEWITHSHAAND3_KEYTRIPLEDES_CBC (&asn1_oid_id_pbeWithSHAAnd3_KeyTripleDES_CBC) |
| 114 |
|
| 115 |
/* OBJECT IDENTIFIER id-pbeWithSHAAnd2-KeyTripleDES-CBC ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) label-less(4) } */ |
| 116 |
extern ASN1EXP const heim_oid asn1_oid_id_pbeWithSHAAnd2_KeyTripleDES_CBC; |
| 117 |
#define ASN1_OID_ID_PBEWITHSHAAND2_KEYTRIPLEDES_CBC (&asn1_oid_id_pbeWithSHAAnd2_KeyTripleDES_CBC) |
| 118 |
|
| 119 |
/* OBJECT IDENTIFIER id-pbeWithSHAAnd128BitRC2-CBC ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) label-less(5) } */ |
| 120 |
extern ASN1EXP const heim_oid asn1_oid_id_pbeWithSHAAnd128BitRC2_CBC; |
| 121 |
#define ASN1_OID_ID_PBEWITHSHAAND128BITRC2_CBC (&asn1_oid_id_pbeWithSHAAnd128BitRC2_CBC) |
| 122 |
|
| 123 |
/* OBJECT IDENTIFIER id-pbewithSHAAnd40BitRC2-CBC ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(1) label-less(6) } */ |
| 124 |
extern ASN1EXP const heim_oid asn1_oid_id_pbewithSHAAnd40BitRC2_CBC; |
| 125 |
#define ASN1_OID_ID_PBEWITHSHAAND40BITRC2_CBC (&asn1_oid_id_pbewithSHAAnd40BitRC2_CBC) |
| 126 |
|
| 127 |
/* OBJECT IDENTIFIER id-pkcs12-bagtypes ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) } */ |
| 128 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_bagtypes; |
| 129 |
#define ASN1_OID_ID_PKCS12_BAGTYPES (&asn1_oid_id_pkcs12_bagtypes) |
| 130 |
|
| 131 |
/* OBJECT IDENTIFIER id-pkcs12-keyBag ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) label-less(1) } */ |
| 132 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_keyBag; |
| 133 |
#define ASN1_OID_ID_PKCS12_KEYBAG (&asn1_oid_id_pkcs12_keyBag) |
| 134 |
|
| 135 |
/* OBJECT IDENTIFIER id-pkcs12-pkcs8ShroudedKeyBag ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) label-less(2) } */ |
| 136 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_pkcs8ShroudedKeyBag; |
| 137 |
#define ASN1_OID_ID_PKCS12_PKCS8SHROUDEDKEYBAG (&asn1_oid_id_pkcs12_pkcs8ShroudedKeyBag) |
| 138 |
|
| 139 |
/* OBJECT IDENTIFIER id-pkcs12-certBag ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) label-less(3) } */ |
| 140 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_certBag; |
| 141 |
#define ASN1_OID_ID_PKCS12_CERTBAG (&asn1_oid_id_pkcs12_certBag) |
| 142 |
|
| 143 |
/* OBJECT IDENTIFIER id-pkcs12-crlBag ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) label-less(4) } */ |
| 144 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_crlBag; |
| 145 |
#define ASN1_OID_ID_PKCS12_CRLBAG (&asn1_oid_id_pkcs12_crlBag) |
| 146 |
|
| 147 |
/* OBJECT IDENTIFIER id-pkcs12-secretBag ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) label-less(5) } */ |
| 148 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_secretBag; |
| 149 |
#define ASN1_OID_ID_PKCS12_SECRETBAG (&asn1_oid_id_pkcs12_secretBag) |
| 150 |
|
| 151 |
/* OBJECT IDENTIFIER id-pkcs12-safeContentsBag ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-12(12) label-less(10) label-less(1) label-less(6) } */ |
| 152 |
extern ASN1EXP const heim_oid asn1_oid_id_pkcs12_safeContentsBag; |
| 153 |
#define ASN1_OID_ID_PKCS12_SAFECONTENTSBAG (&asn1_oid_id_pkcs12_safeContentsBag) |
| 154 |
|
| 155 |
/* |
| 156 |
PKCS12-MacData ::= SEQUENCE { |
| 157 |
mac DigestInfo, |
| 158 |
macSalt OCTET STRING, |
| 159 |
iterations INTEGER OPTIONAL, |
| 160 |
} |
| 161 |
*/ |
| 162 |
|
| 163 |
typedef struct PKCS12_MacData { |
| 164 |
DigestInfo mac; |
| 165 |
heim_octet_string macSalt; |
| 166 |
heim_integer *iterations; |
| 167 |
} PKCS12_MacData; |
| 168 |
|
| 169 |
ASN1EXP int ASN1CALL decode_PKCS12_MacData(const unsigned char *, size_t, PKCS12_MacData *, size_t *); |
| 170 |
ASN1EXP int ASN1CALL encode_PKCS12_MacData(unsigned char *, size_t, const PKCS12_MacData *, size_t *); |
| 171 |
ASN1EXP size_t ASN1CALL length_PKCS12_MacData(const PKCS12_MacData *); |
| 172 |
ASN1EXP int ASN1CALL copy_PKCS12_MacData (const PKCS12_MacData *, PKCS12_MacData *); |
| 173 |
ASN1EXP void ASN1CALL free_PKCS12_MacData (PKCS12_MacData *); |
| 174 |
|
| 175 |
|
| 176 |
/* |
| 177 |
PKCS12-PFX ::= SEQUENCE { |
| 178 |
version INTEGER, |
| 179 |
authSafe ContentInfo, |
| 180 |
macData PKCS12-MacData OPTIONAL, |
| 181 |
} |
| 182 |
*/ |
| 183 |
|
| 184 |
typedef struct PKCS12_PFX { |
| 185 |
heim_integer version; |
| 186 |
ContentInfo authSafe; |
| 187 |
PKCS12_MacData *macData; |
| 188 |
} PKCS12_PFX; |
| 189 |
|
| 190 |
ASN1EXP int ASN1CALL decode_PKCS12_PFX(const unsigned char *, size_t, PKCS12_PFX *, size_t *); |
| 191 |
ASN1EXP int ASN1CALL encode_PKCS12_PFX(unsigned char *, size_t, const PKCS12_PFX *, size_t *); |
| 192 |
ASN1EXP size_t ASN1CALL length_PKCS12_PFX(const PKCS12_PFX *); |
| 193 |
ASN1EXP int ASN1CALL copy_PKCS12_PFX (const PKCS12_PFX *, PKCS12_PFX *); |
| 194 |
ASN1EXP void ASN1CALL free_PKCS12_PFX (PKCS12_PFX *); |
| 195 |
|
| 196 |
|
| 197 |
/* |
| 198 |
PKCS12-AuthenticatedSafe ::= SEQUENCE OF ContentInfo |
| 199 |
*/ |
| 200 |
|
| 201 |
typedef struct PKCS12_AuthenticatedSafe { |
| 202 |
unsigned int len; |
| 203 |
ContentInfo *val; |
| 204 |
} PKCS12_AuthenticatedSafe; |
| 205 |
|
| 206 |
ASN1EXP int ASN1CALL decode_PKCS12_AuthenticatedSafe(const unsigned char *, size_t, PKCS12_AuthenticatedSafe *, size_t *); |
| 207 |
ASN1EXP int ASN1CALL encode_PKCS12_AuthenticatedSafe(unsigned char *, size_t, const PKCS12_AuthenticatedSafe *, size_t *); |
| 208 |
ASN1EXP size_t ASN1CALL length_PKCS12_AuthenticatedSafe(const PKCS12_AuthenticatedSafe *); |
| 209 |
ASN1EXP int ASN1CALL copy_PKCS12_AuthenticatedSafe (const PKCS12_AuthenticatedSafe *, PKCS12_AuthenticatedSafe *); |
| 210 |
ASN1EXP void ASN1CALL free_PKCS12_AuthenticatedSafe (PKCS12_AuthenticatedSafe *); |
| 211 |
|
| 212 |
|
| 213 |
/* |
| 214 |
PKCS12-Attribute ::= SEQUENCE { |
| 215 |
attrId OBJECT IDENTIFIER, |
| 216 |
attrValues heim_any_set, |
| 217 |
} |
| 218 |
*/ |
| 219 |
|
| 220 |
typedef struct PKCS12_Attribute { |
| 221 |
heim_oid attrId; |
| 222 |
heim_any_set attrValues; |
| 223 |
} PKCS12_Attribute; |
| 224 |
|
| 225 |
ASN1EXP int ASN1CALL decode_PKCS12_Attribute(const unsigned char *, size_t, PKCS12_Attribute *, size_t *); |
| 226 |
ASN1EXP int ASN1CALL encode_PKCS12_Attribute(unsigned char *, size_t, const PKCS12_Attribute *, size_t *); |
| 227 |
ASN1EXP size_t ASN1CALL length_PKCS12_Attribute(const PKCS12_Attribute *); |
| 228 |
ASN1EXP int ASN1CALL copy_PKCS12_Attribute (const PKCS12_Attribute *, PKCS12_Attribute *); |
| 229 |
ASN1EXP void ASN1CALL free_PKCS12_Attribute (PKCS12_Attribute *); |
| 230 |
|
| 231 |
|
| 232 |
/* |
| 233 |
PKCS12-Attributes ::= SET OF PKCS12-Attribute |
| 234 |
*/ |
| 235 |
|
| 236 |
typedef struct PKCS12_Attributes { |
| 237 |
unsigned int len; |
| 238 |
PKCS12_Attribute *val; |
| 239 |
} PKCS12_Attributes; |
| 240 |
|
| 241 |
ASN1EXP int ASN1CALL decode_PKCS12_Attributes(const unsigned char *, size_t, PKCS12_Attributes *, size_t *); |
| 242 |
ASN1EXP int ASN1CALL encode_PKCS12_Attributes(unsigned char *, size_t, const PKCS12_Attributes *, size_t *); |
| 243 |
ASN1EXP size_t ASN1CALL length_PKCS12_Attributes(const PKCS12_Attributes *); |
| 244 |
ASN1EXP int ASN1CALL copy_PKCS12_Attributes (const PKCS12_Attributes *, PKCS12_Attributes *); |
| 245 |
ASN1EXP void ASN1CALL free_PKCS12_Attributes (PKCS12_Attributes *); |
| 246 |
|
| 247 |
|
| 248 |
/* |
| 249 |
PKCS12-SafeBag ::= SEQUENCE { |
| 250 |
bagId OBJECT IDENTIFIER, |
| 251 |
bagValue [0] heim_any, |
| 252 |
bagAttributes PKCS12-Attributes OPTIONAL, |
| 253 |
} |
| 254 |
*/ |
| 255 |
|
| 256 |
typedef struct PKCS12_SafeBag { |
| 257 |
heim_oid bagId; |
| 258 |
heim_any bagValue; |
| 259 |
PKCS12_Attributes *bagAttributes; |
| 260 |
} PKCS12_SafeBag; |
| 261 |
|
| 262 |
ASN1EXP int ASN1CALL decode_PKCS12_SafeBag(const unsigned char *, size_t, PKCS12_SafeBag *, size_t *); |
| 263 |
ASN1EXP int ASN1CALL encode_PKCS12_SafeBag(unsigned char *, size_t, const PKCS12_SafeBag *, size_t *); |
| 264 |
ASN1EXP size_t ASN1CALL length_PKCS12_SafeBag(const PKCS12_SafeBag *); |
| 265 |
ASN1EXP int ASN1CALL copy_PKCS12_SafeBag (const PKCS12_SafeBag *, PKCS12_SafeBag *); |
| 266 |
ASN1EXP void ASN1CALL free_PKCS12_SafeBag (PKCS12_SafeBag *); |
| 267 |
|
| 268 |
|
| 269 |
/* |
| 270 |
PKCS12-SafeContents ::= SEQUENCE OF PKCS12-SafeBag |
| 271 |
*/ |
| 272 |
|
| 273 |
typedef struct PKCS12_SafeContents { |
| 274 |
unsigned int len; |
| 275 |
PKCS12_SafeBag *val; |
| 276 |
} PKCS12_SafeContents; |
| 277 |
|
| 278 |
ASN1EXP int ASN1CALL decode_PKCS12_SafeContents(const unsigned char *, size_t, PKCS12_SafeContents *, size_t *); |
| 279 |
ASN1EXP int ASN1CALL encode_PKCS12_SafeContents(unsigned char *, size_t, const PKCS12_SafeContents *, size_t *); |
| 280 |
ASN1EXP size_t ASN1CALL length_PKCS12_SafeContents(const PKCS12_SafeContents *); |
| 281 |
ASN1EXP int ASN1CALL copy_PKCS12_SafeContents (const PKCS12_SafeContents *, PKCS12_SafeContents *); |
| 282 |
ASN1EXP void ASN1CALL free_PKCS12_SafeContents (PKCS12_SafeContents *); |
| 283 |
|
| 284 |
|
| 285 |
/* |
| 286 |
PKCS12-CertBag ::= SEQUENCE { |
| 287 |
certType OBJECT IDENTIFIER, |
| 288 |
certValue [0] heim_any, |
| 289 |
} |
| 290 |
*/ |
| 291 |
|
| 292 |
typedef struct PKCS12_CertBag { |
| 293 |
heim_oid certType; |
| 294 |
heim_any certValue; |
| 295 |
} PKCS12_CertBag; |
| 296 |
|
| 297 |
ASN1EXP int ASN1CALL decode_PKCS12_CertBag(const unsigned char *, size_t, PKCS12_CertBag *, size_t *); |
| 298 |
ASN1EXP int ASN1CALL encode_PKCS12_CertBag(unsigned char *, size_t, const PKCS12_CertBag *, size_t *); |
| 299 |
ASN1EXP size_t ASN1CALL length_PKCS12_CertBag(const PKCS12_CertBag *); |
| 300 |
ASN1EXP int ASN1CALL copy_PKCS12_CertBag (const PKCS12_CertBag *, PKCS12_CertBag *); |
| 301 |
ASN1EXP void ASN1CALL free_PKCS12_CertBag (PKCS12_CertBag *); |
| 302 |
|
| 303 |
|
| 304 |
/* |
| 305 |
PKCS12-PBEParams ::= SEQUENCE { |
| 306 |
salt OCTET STRING, |
| 307 |
iterations INTEGER (0..4294967295) OPTIONAL, |
| 308 |
} |
| 309 |
*/ |
| 310 |
|
| 311 |
typedef struct PKCS12_PBEParams { |
| 312 |
heim_octet_string salt; |
| 313 |
unsigned int *iterations; |
| 314 |
} PKCS12_PBEParams; |
| 315 |
|
| 316 |
ASN1EXP int ASN1CALL decode_PKCS12_PBEParams(const unsigned char *, size_t, PKCS12_PBEParams *, size_t *); |
| 317 |
ASN1EXP int ASN1CALL encode_PKCS12_PBEParams(unsigned char *, size_t, const PKCS12_PBEParams *, size_t *); |
| 318 |
ASN1EXP size_t ASN1CALL length_PKCS12_PBEParams(const PKCS12_PBEParams *); |
| 319 |
ASN1EXP int ASN1CALL copy_PKCS12_PBEParams (const PKCS12_PBEParams *, PKCS12_PBEParams *); |
| 320 |
ASN1EXP void ASN1CALL free_PKCS12_PBEParams (PKCS12_PBEParams *); |
| 321 |
|
| 322 |
|
| 323 |
/* |
| 324 |
PKCS12-OctetString ::= OCTET STRING |
| 325 |
*/ |
| 326 |
|
| 327 |
typedef heim_octet_string PKCS12_OctetString; |
| 328 |
|
| 329 |
ASN1EXP int ASN1CALL decode_PKCS12_OctetString(const unsigned char *, size_t, PKCS12_OctetString *, size_t *); |
| 330 |
ASN1EXP int ASN1CALL encode_PKCS12_OctetString(unsigned char *, size_t, const PKCS12_OctetString *, size_t *); |
| 331 |
ASN1EXP size_t ASN1CALL length_PKCS12_OctetString(const PKCS12_OctetString *); |
| 332 |
ASN1EXP int ASN1CALL copy_PKCS12_OctetString (const PKCS12_OctetString *, PKCS12_OctetString *); |
| 333 |
ASN1EXP void ASN1CALL free_PKCS12_OctetString (PKCS12_OctetString *); |
| 334 |
|
| 335 |
|
| 336 |
#endif /* __pkcs12_asn1_h__ */ |