4 Abstract Syntax Notation One (or ASN1) is a standard by ITU-T and ISO/IEC
5 and used as a description language for defining data structure in
7 Any data described in ASN1 notation can be serialized (or encoded) and
8 de-serialized (or decoded) with well-defined encoding rules.
10 A combination of ASN1 compiler and ASN1 decoder library function will
11 provide a function interface for parsing encoded binary into specific
13 1) define data structure in a text file (*.asn1)
14 2) define "action" routines for specific "tags" defined in (1)
15 3) generate bytecode as a C file (*.asn1.[ch]) from *.asn1 file
16 with ASN1 compiler (tools/asn1_compiler)
17 4) call a ASN1 decoder (asn1_ber_decoder()) with bytecode and data
19 Usage of ASN1 compiler
20 ----------------------
21 asn1_compiler [-v] [-d] <grammar-file> <c-file> <hdr-file>
23 <grammar-file>: ASN1 input file
24 <c-file>: generated C file
25 <hdr-file>: generated include file
29 int asn1_ber_decoder(const struct asn1_decoder *decoder, void *context,
30 const unsigned char *data, size_t datalen);
32 @decoder: bytecode binary
33 @context: context for decoder
34 @data: data to be parsed
35 @datalen: size of data
38 As of writing this, ASN1 compiler and decoder are used to implement
39 X509 certificate parser, pcks7 message parser and RSA public key parser