## libtasn1

libtasn1 — GNU ASN.1 library

## Types and Values

#define | ASN1_API
#define | ASN1_VERSION
#define | ASN1_VERSION_MAJOR
#define | ASN1_VERSION_MINOR
#define | ASN1_VERSION_PATCH
#define | ASN1_VERSION_NUMBER
#define | ASN1_SUCCESS
#define | ASN1_FILE_NOT_FOUND
#define | ASN1_ELEMENT_NOT_FOUND
#define | ASN1_IDENTIFIER_NOT_FOUND
#define | ASN1_DER_ERROR
#define | ASN1_VALUE_NOT_FOUND
#define | ASN1_GENERIC_ERROR
#define | ASN1_VALUE_NOT_VALID
#define | ASN1_TAG_ERROR
#define | ASN1_TAG_IMPLICIT
#define | ASN1_ERROR_TYPE_ANY
#define | ASN1_SYNTAX_ERROR
#define | ASN1_MEM_ERROR
#define | ASN1_MEM_ALLOC_ERROR
#define | ASN1_DER_OVERFLOW
#define | ASN1_NAME_TOO_LONG
#define | ASN1_ARRAY_ERROR
#define | ASN1_ELEMENT_NOT_EMPTY
#define | ASN1_TIME_ENCODING_ERROR
#define | ASN1_RECURSION
#define | ASN1_PRINT_NAME
#define | ASN1_PRINT_NAME_TYPE
#define | ASN1_PRINT_NAME_TYPE_VALUE
#define | ASN1_PRINT_ALL
#define | ASN1_CLASS_UNIVERSAL
#define | ASN1_CLASS_APPLICATION
#define | ASN1_CLASS_CONTEXT_SPECIFIC
#define | ASN1_CLASS_PRIVATE
#define | ASN1_CLASS_STRUCTURED
#define | ASN1_TAG_BOOLEAN
#define | ASN1_TAG_INTEGER
#define | ASN1_TAG_SEQUENCE
#define | ASN1_TAG_SET
#define | ASN1_TAG_OCTET_STRING
#define | ASN1_TAG_BIT_STRING
#define | ASN1_TAG_UTCTime
#define | ASN1_TAG_GENERALIZEDTime
#define | ASN1_TAG_OBJECT_ID
#define | ASN1_TAG_ENUMERATED
#define | ASN1_TAG_NULL
#define | ASN1_TAG_GENERALSTRING
#define | ASN1_TAG_NUMERIC_STRING
#define | ASN1_TAG_IA5_STRING
#define | ASN1_TAG_TELETEX_STRING
#define | ASN1_TAG_PRINTABLE_STRING
#define | ASN1_TAG_UNIVERSAL_STRING
#define | ASN1_TAG_BMP_STRING
#define | ASN1_TAG_UTF8_STRING
#define | ASN1_TAG_VISIBLE_STRING
typedef | asn1_node_st
typedef | asn1_node
typedef | asn1_node_const
#define | ASN1_MAX_NAME_SIZE
#define | ASN1_ETYPE_INVALID
#define | ASN1_ETYPE_CONSTANT
#define | ASN1_ETYPE_IDENTIFIER
#define | ASN1_ETYPE_INTEGER
#define | ASN1_ETYPE_BOOLEAN
#define | ASN1_ETYPE_SEQUENCE
#define | ASN1_ETYPE_BIT_STRING
#define | ASN1_ETYPE_OCTET_STRING
#define | ASN1_ETYPE_TAG
#define | ASN1_ETYPE_DEFAULT
#define | ASN1_ETYPE_SIZE
#define | ASN1_ETYPE_SEQUENCE_OF
#define | ASN1_ETYPE_OBJECT_ID
#define | ASN1_ETYPE_ANY
#define | ASN1_ETYPE_SET
#define | ASN1_ETYPE_SET_OF
#define | ASN1_ETYPE_DEFINITIONS
#define | ASN1_ETYPE_CHOICE
#define | ASN1_ETYPE_IMPORTS
#define | ASN1_ETYPE_NULL
#define | ASN1_ETYPE_ENUMERATED
#define | ASN1_ETYPE_GENERALSTRING
#define | ASN1_ETYPE_NUMERIC_STRING
#define | ASN1_ETYPE_IA5_STRING
#define | ASN1_ETYPE_TELETEX_STRING
#define | ASN1_ETYPE_PRINTABLE_STRING
#define | ASN1_ETYPE_UNIVERSAL_STRING
#define | ASN1_ETYPE_BMP_STRING
#define | ASN1_ETYPE_UTF8_STRING
#define | ASN1_ETYPE_VISIBLE_STRING
#define | ASN1_ETYPE_UTC_TIME
#define | ASN1_ETYPE_GENERALIZED_TIME
#define | ASN1_DELETE_FLAG_ZEROIZE
#define | ASN1_DECODE_FLAG_ALLOW_PADDING
#define | ASN1_DECODE_FLAG_STRICT_DER
#define | ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME

## Description

The Libtasn1 library provides Abstract Syntax Notation One (ASN.1, as specified by the X.680 ITU-T recommendation) parsing and structures management, and Distinguished Encoding Rules (DER, as per X.690) encoding and decoding functions.

## Functions

## Types and Values

### ASN1_API

    #   define ASN1_API __attribute__((__visibility__("default")))

### ASN1_VERSION

    # define ASN1_VERSION "4.18.0"

Version of the library as a string.

### ASN1_VERSION_MAJOR

    # define ASN1_VERSION_MAJOR 4

Major version number of the library.

### ASN1_VERSION_MINOR

    # define ASN1_VERSION_MINOR 18

Minor version number of the library.

### ASN1_VERSION_PATCH

    # define ASN1_VERSION_PATCH 0

Patch version number of the library.

### ASN1_VERSION_NUMBER

    # define ASN1_VERSION_NUMBER 0x041200

Version number of the library as a number.

### ASN1_SUCCESS

    # define ASN1_SUCCESS			0

### ASN1_FILE_NOT_FOUND

    # define ASN1_FILE_NOT_FOUND		1

### ASN1_ELEMENT_NOT_FOUND

    # define ASN1_ELEMENT_NOT_FOUND		2

### ASN1_IDENTIFIER_NOT_FOUND

    # define ASN1_IDENTIFIER_NOT_FOUND 3

### ASN1_DER_ERROR

    # define ASN1_DER_ERROR			4

### ASN1_VALUE_NOT_FOUND

    # define ASN1_VALUE_NOT_FOUND		5

### ASN1_GENERIC_ERROR

    # define ASN1_GENERIC_ERROR		6

### ASN1_VALUE_NOT_VALID

    # define ASN1_VALUE_NOT_VALID		7

### ASN1_TAG_ERROR

    # define ASN1_TAG_ERROR			8

### ASN1_TAG_IMPLICIT

    # define ASN1_TAG_IMPLICIT		9

### ASN1_ERROR_TYPE_ANY

    # define ASN1_ERROR_TYPE_ANY		10

### ASN1_SYNTAX_ERROR

    # define ASN1_SYNTAX_ERROR		11

### ASN1_MEM_ERROR

    # define ASN1_MEM_ERROR			12

### ASN1_MEM_ALLOC_ERROR

    # define ASN1_MEM_ALLOC_ERROR		13

### ASN1_DER_OVERFLOW

    # define ASN1_DER_OVERFLOW		14

### ASN1_NAME_TOO_LONG

    # define ASN1_NAME_TOO_LONG		15

### ASN1_ARRAY_ERROR

    # define ASN1_ARRAY_ERROR		16

### ASN1_ELEMENT_NOT_EMPTY

    # define ASN1_ELEMENT_NOT_EMPTY		17

### ASN1_TIME_ENCODING_ERROR

    # define ASN1_TIME_ENCODING_ERROR 18

### ASN1_RECURSION

    # define ASN1_RECURSION			19

### ASN1_PRINT_NAME

    # define ASN1_PRINT_NAME			1

### ASN1_PRINT_NAME_TYPE

    # define ASN1_PRINT_NAME_TYPE		2

### ASN1_PRINT_NAME_TYPE_VALUE

    # define ASN1_PRINT_NAME_TYPE_VALUE 3

### ASN1_PRINT_ALL

    # define ASN1_PRINT_ALL			4

### ASN1_CLASS_UNIVERSAL

    # define ASN1_CLASS_UNIVERSAL		0x00 /* old: 1 */

### ASN1_CLASS_APPLICATION

    # define ASN1_CLASS_APPLICATION		0x40 /* old: 2 */

### ASN1_CLASS_CONTEXT_SPECIFIC

    # define ASN1_CLASS_CONTEXT_SPECIFIC 0x80 /* old: 3 */

### ASN1_CLASS_PRIVATE

    # define ASN1_CLASS_PRIVATE		0xC0 /* old: 4 */

### ASN1_CLASS_STRUCTURED

    # define ASN1_CLASS_STRUCTURED		0x20

### ASN1_TAG_BOOLEAN

    # define ASN1_TAG_BOOLEAN		0x01

### ASN1_TAG_INTEGER

    # define ASN1_TAG_INTEGER		0x02

### ASN1_TAG_SEQUENCE

    # define ASN1_TAG_SEQUENCE		0x10

### ASN1_TAG_SET

    # define ASN1_TAG_SET			0x11

### ASN1_TAG_OCTET_STRING

    # define ASN1_TAG_OCTET_STRING		0x04

### ASN1_TAG_BIT_STRING

    # define ASN1_TAG_BIT_STRING		0x03

### ASN1_TAG_UTCTime

    # define ASN1_TAG_UTCTime		0x17

### ASN1_TAG_GENERALIZEDTime

    # define ASN1_TAG_GENERALIZEDTime 0x18

### ASN1_TAG_OBJECT_ID

    # define ASN1_TAG_OBJECT_ID		0x06

### ASN1_TAG_ENUMERATED

    # define ASN1_TAG_ENUMERATED		0x0A

### ASN1_TAG_NULL

    # define ASN1_TAG_NULL			0x05

### ASN1_TAG_GENERALSTRING

    # define ASN1_TAG_GENERALSTRING		0x1B

### ASN1_TAG_NUMERIC_STRING

    # define ASN1_TAG_NUMERIC_STRING		0x12

### ASN1_TAG_IA5_STRING

    # define ASN1_TAG_IA5_STRING		0x16

### ASN1_TAG_TELETEX_STRING

    # define ASN1_TAG_TELETEX_STRING		0x14

### ASN1_TAG_PRINTABLE_STRING

    # define ASN1_TAG_PRINTABLE_STRING 0x13

### ASN1_TAG_UNIVERSAL_STRING

    # define ASN1_TAG_UNIVERSAL_STRING 0x1C

### ASN1_TAG_BMP_STRING

    # define ASN1_TAG_BMP_STRING		0x1E

### ASN1_TAG_UTF8_STRING

    # define ASN1_TAG_UTF8_STRING		0x0C

### ASN1_TAG_VISIBLE_STRING

    # define ASN1_TAG_VISIBLE_STRING		0x1A

### asn1_node_st

      typedef struct asn1_node_st asn1_node_st;

### asn1_node

      typedef asn1_node_st *asn1_node;

Structure definition used for the node of the tree that represents an ASN.1 DEFINITION.

### asn1_node_const

      typedef const asn1_node_st *asn1_node_const;

### ASN1_MAX_NAME_SIZE

    # define ASN1_MAX_NAME_SIZE 64

Maximum number of characters of a name inside a file with ASN1 definitions.

### ASN1_ETYPE_INVALID

    # define ASN1_ETYPE_INVALID        0

### ASN1_ETYPE_CONSTANT

    # define ASN1_ETYPE_CONSTANT       1

### ASN1_ETYPE_IDENTIFIER

    # define ASN1_ETYPE_IDENTIFIER     2

### ASN1_ETYPE_INTEGER

    # define ASN1_ETYPE_INTEGER        3

### ASN1_ETYPE_BOOLEAN

    # define ASN1_ETYPE_BOOLEAN        4

### ASN1_ETYPE_SEQUENCE

    # define ASN1_ETYPE_SEQUENCE       5

### ASN1_ETYPE_BIT_STRING

    # define ASN1_ETYPE_BIT_STRING     6

### ASN1_ETYPE_OCTET_STRING

    # define ASN1_ETYPE_OCTET_STRING   7

### ASN1_ETYPE_TAG

    # define ASN1_ETYPE_TAG            8

### ASN1_ETYPE_DEFAULT

    # define ASN1_ETYPE_DEFAULT        9

### ASN1_ETYPE_SIZE

    # define ASN1_ETYPE_SIZE          10

### ASN1_ETYPE_SEQUENCE_OF

    # define ASN1_ETYPE_SEQUENCE_OF   11

### ASN1_ETYPE_OBJECT_ID

    # define ASN1_ETYPE_OBJECT_ID     12

### ASN1_ETYPE_ANY

    # define ASN1_ETYPE_ANY           13

### ASN1_ETYPE_SET

    # define ASN1_ETYPE_SET           14

### ASN1_ETYPE_SET_OF

    # define ASN1_ETYPE_SET_OF        15

### ASN1_ETYPE_DEFINITIONS

    # define ASN1_ETYPE_DEFINITIONS   16

### ASN1_ETYPE_CHOICE

    # define ASN1_ETYPE_CHOICE        18

### ASN1_ETYPE_IMPORTS

    # define ASN1_ETYPE_IMPORTS       19

### ASN1_ETYPE_NULL

    # define ASN1_ETYPE_NULL          20

### ASN1_ETYPE_ENUMERATED

    # define ASN1_ETYPE_ENUMERATED    21

### ASN1_ETYPE_GENERALSTRING

    # define ASN1_ETYPE_GENERALSTRING 27

### ASN1_ETYPE_NUMERIC_STRING

    # define ASN1_ETYPE_NUMERIC_STRING 28

### ASN1_ETYPE_IA5_STRING

    # define ASN1_ETYPE_IA5_STRING     29

### ASN1_ETYPE_TELETEX_STRING

    # define ASN1_ETYPE_TELETEX_STRING 30

### ASN1_ETYPE_PRINTABLE_STRING

    # define ASN1_ETYPE_PRINTABLE_STRING 31

### ASN1_ETYPE_UNIVERSAL_STRING

    # define ASN1_ETYPE_UNIVERSAL_STRING 32

### ASN1_ETYPE_BMP_STRING

    # define ASN1_ETYPE_BMP_STRING     33

### ASN1_ETYPE_UTF8_STRING

    # define ASN1_ETYPE_UTF8_STRING    34

### ASN1_ETYPE_VISIBLE_STRING

    # define ASN1_ETYPE_VISIBLE_STRING 35

### ASN1_ETYPE_UTC_TIME

    # define ASN1_ETYPE_UTC_TIME       36

### ASN1_ETYPE_GENERALIZED_TIME

    # define ASN1_ETYPE_GENERALIZED_TIME 37

### ASN1_DELETE_FLAG_ZEROIZE

    # define ASN1_DELETE_FLAG_ZEROIZE 1

Used by: `asn1_delete_structure2()`

Zeroize values prior to deinitialization.

### ASN1_DECODE_FLAG_ALLOW_PADDING

    # define ASN1_DECODE_FLAG_ALLOW_PADDING 1

Used by: `asn1_der_decoding2()`

This flag would allow arbitrary data past the DER data.

### ASN1_DECODE_FLAG_STRICT_DER

    # define ASN1_DECODE_FLAG_STRICT_DER (1<<1)

Used by: `asn1_der_decoding2()`

This flag would ensure that no BER decoding takes place.

### ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME

    # define ASN1_DECODE_FLAG_ALLOW_INCORRECT_TIME (1<<2)

Used by: `asn1_der_decoding2()`

This flag will tolerate Time encoding errors when in strict DER.