ASN.1

例) 30 82 XX XX YY YY YY ...
30 (0011 0000) : Identifier octets
00 Class: Universal
1 P/C: Constructed
10000 Tag Number: Sequence & Sequence-of
82 (1000 0010) XX XX : Length octets
1 Length長不定
0000010 Length長: 2バイト
XX XX Length (Contentsのバイト数)
YY YY YY ... : Contents octets

ITU X690
8.1.1
 
Identifier Length Contents
 
Identifier 0x80 Contents 0x00
8.1.2
Identifier octets
8〜7bit6bit5〜1bit
ClassP/CTag Number ( ITU X680 8, 37, 42, 43 )
002 Universal
(Tag Numberを見る)

012 Application
102 Context-specific
112 Private
02 Primitive
12 Constructed
000012 (1) Boolean
000102 (2) Integer
000112 (3) Bitstring
001002 (4) Octetstring
001012 (5) Null
001102 (6) Object identifier
001112 (7) Object descriptor
010002 (8) External & Instance-of
010012 (9) Real
010102 (10) Enumerated
010112 (11) Embedded-pdv
011002 (12) UTF8string
100002 (16) Sequence & Sequence-of
100012 (17) Set & Set-of
100102 (18) NumericString
100112 (19) PrintableString
101002 (20) TeletexString (T61String)
101012 (21) VideotexString
101102 (22) IA5String
101112 (23) UTCTime
110002 (24) GeneralizedTime
110012 (25) GraphicString
110102 (26) VisibleString (ISO646String)
110112 (27) GeneralString
110102 (28) UniversalString
111102 (30) BMPString
8.1.3
Length octets
8bit7〜1bit
02
definite form
Length
(Contentsのバイト数)
12
indefinite form
Length長Length
(Contentsのバイト数)
8.19
Object identifier
000000002 (0.0) itu-t recommendation
000000012 (0.1) itu-t question
000000102 (0.2) itu-t administration
000000112 (0.3) itu-t network-operator
000001002 (0.4) itu-t identified-organization
001010002 (1.0) iso standard
001010102 (1.2) iso member-body
001010112 (1.3) iso identified-organization
010100002〜 (2.*) joint-iso-itu-t
OID例
1.2.840.113549.1.7.2 pkcs7 signedData
1.2.840.113549.1.12.1 pkcs12
(0)

(127)
02 00000002

11111112
(128)

(16383)
12 00000012

11111112
02 00000002

11111112
(16384)

(2097151)
12 00000012

11111112
12 00000002

11111112
02 00000002

11111112