VirtualBox

source: vbox/trunk/include/iprt/formats/asn1.h

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1/** @file
2 * IPRT - Abstract Syntax Notation One (ASN.1) Definitions.
3 */
4
5/*
6 * Copyright (C) 2014-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef IPRT_INCLUDED_formats_asn1_h
37#define IPRT_INCLUDED_formats_asn1_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <iprt/cdefs.h>
43
44
45/** @defgroup grp_rt_formats_asn1 ASN.1 definitions
46 * @ingroup grp_rt_formats
47 *
48 * @{ */
49
50/** @name Tag classes.
51 * @{ */
52#define ASN1_TAGCLASS_UNIVERSAL UINT8_C(0x00)
53#define ASN1_TAGCLASS_APPLICATION UINT8_C(0x40)
54#define ASN1_TAGCLASS_CONTEXT UINT8_C(0x80)
55#define ASN1_TAGCLASS_PRIVATE UINT8_C(0xc0)
56#define ASN1_TAGCLASS_MASK UINT8_C(0xc0)
57/** @} */
58
59/** Primitive encoding. */
60#define ASN1_TAGFLAG_PRIMITIVE UINT8_C(0x00)
61/** Constructed encoding, as opposed to primitive. */
62#define ASN1_TAGFLAG_CONSTRUCTED UINT8_C(0x20)
63
64/** The tag value mask. */
65#define ASN1_TAG_MASK UINT8_C(0x1f)
66
67/** @name ASN.1 universal tags.
68 * @{ */
69#define ASN1_TAG_EOC UINT8_C(0x00)
70#define ASN1_TAG_BOOLEAN UINT8_C(0x01)
71#define ASN1_TAG_INTEGER UINT8_C(0x02)
72#define ASN1_TAG_BIT_STRING UINT8_C(0x03)
73#define ASN1_TAG_OCTET_STRING UINT8_C(0x04)
74#define ASN1_TAG_NULL UINT8_C(0x05)
75#define ASN1_TAG_OID UINT8_C(0x06)
76#define ASN1_TAG_OBJECT_DESCRIPTOR UINT8_C(0x07)
77#define ASN1_TAG_EXTERNAL UINT8_C(0x08)
78#define ASN1_TAG_REAL UINT8_C(0x09)
79#define ASN1_TAG_ENUMERATED UINT8_C(0x0a)
80#define ASN1_TAG_EMBEDDED_PDV UINT8_C(0x0b)
81#define ASN1_TAG_UTF8_STRING UINT8_C(0x0c)
82#define ASN1_TAG_RELATIVE_OID UINT8_C(0x0d)
83#define ASN1_TAG_RESERVED_14 UINT8_C(0x0e)
84#define ASN1_TAG_RESERVED_15 UINT8_C(0x0f)
85#define ASN1_TAG_SEQUENCE UINT8_C(0x10)
86#define ASN1_TAG_SET UINT8_C(0x11)
87#define ASN1_TAG_NUMERIC_STRING UINT8_C(0x12)
88#define ASN1_TAG_PRINTABLE_STRING UINT8_C(0x13)
89#define ASN1_TAG_T61_STRING UINT8_C(0x14)
90#define ASN1_TAG_VIDEOTEX_STRING UINT8_C(0x15)
91#define ASN1_TAG_IA5_STRING UINT8_C(0x16)
92#define ASN1_TAG_UTC_TIME UINT8_C(0x17) /**< Century seems to be 1900 if YY < 50, otherwise 2000. Baka ASN.1! */
93#define ASN1_TAG_GENERALIZED_TIME UINT8_C(0x18)
94#define ASN1_TAG_GRAPHIC_STRING UINT8_C(0x19)
95#define ASN1_TAG_VISIBLE_STRING UINT8_C(0x1a)
96#define ASN1_TAG_GENERAL_STRING UINT8_C(0x1b)
97#define ASN1_TAG_UNIVERSAL_STRING UINT8_C(0x1c)
98#define ASN1_TAG_CHARACTER_STRING UINT8_C(0x1d)
99#define ASN1_TAG_BMP_STRING UINT8_C(0x1e)
100#define ASN1_TAG_USE_LONG_FORM UINT8_C(0x1f)
101/** @} */
102
103
104/** @} */
105
106#endif /* !IPRT_INCLUDED_formats_asn1_h */
107
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use