4 * @brief Definition of asn1_rule_t and other ASN1 stuff.
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28 typedef enum asn1_type_t asn1_type_t
;
31 * @brief Real and some special ASN1 types.
37 * End of a sequence, set, choice
42 ASN1_BITSTRING
= 0x03,
43 ASN1_OCTETSTRING
= 0x04,
46 ASN1_ENUMERATED
= 0x0A,
47 ASN1_UTF8STRING
= 0x0C,
48 ASN1_NUMERICSTRING
= 0x12,
49 ASN1_PRINTABLESTRING
= 0x13,
50 ASN1_T61STRING
= 0x14,
51 ASN1_VIDEOTEXSTRING
= 0x15,
52 ASN1_IA5STRING
= 0x16,
54 ASN1_GENERALIZEDTIME
= 0x18,
55 ASN1_GRAPHICSTRING
= 0x19,
56 ASN1_VISIBLESTRING
= 0x1A,
57 ASN1_GENERALSTRING
= 0x1B,
58 ASN1_UNIVERSALSTRING
= 0x1C,
59 ASN1_BMPSTRING
= 0x1E,
60 ASN1_CONSTRUCTED
= 0x20,
96 * String mappings for asn1_type_t
98 extern mapping_t asn1_type_m
[];
101 typedef enum asn1_flag_t asn1_flag_t
;
104 * @brief Flags used to build ASN1 rules.
112 ASN1_OPTIONAL
= 0x01,
114 * Field has a default value and is therefore optional
118 * Convert this INTEGER to an mpz_t
126 * Parse this Sequence in a RAW chunk too.
127 * Used for crypto calculations...
133 * String mappings for asn1_flag_t
135 extern mapping_t asn1_flag_m
[];
138 typedef struct asn1_rule_t asn1_rule_t
;
141 * @brief Single rule of a complet ruleset.
143 * This rule containing a type, flags and additional
144 * data allow modellation of complex ASN1 structures and
145 * allow their en- and decoding...
155 * implicit or explicit tag, if any
159 * offset of data in structure
163 * offset to a boolean, which says if optional
164 * data is available at data_offset. Used if
165 * flags & ASN1_OPTIONAL.
166 * default value, used if flags & ASN1_DEFAULT