blob: 5873a1080679b3df4433fdab40a7521676a22a06 [file] [log] [blame]
Yingdi Yufba8a632015-06-08 22:25:54 -07001NDN Certificate Format Version 2.0
2==================================
3
4.. contents::
5
6Since signature verification is a common operation in NDN applications, it is
7important to define a common certificate format to standardize the public key
8authentication procedure. As every NDN data packet is signed, a data packet
9that carries a public key as content is conceptually a certificate. However,
10the specification of a data packet is not sufficient to be the specification of
11a common certificate format, as it requires additional components. For example,
12a certificate may follow a specific naming convention and may need to include
13validity period, revocation information, etc. This specification defines
14naming and components of the NDN certificates and is complementary to NDN packet
15specification.
16
17::
18
19 Overview of NDN certificate format
20 +--------------------------+
21 | Name |
22 +--------------------------+
23 | MetaInfo |
24 |+------------------------+|
25 || ContentType: KEY(2) ||
26 |+------------------------+|
27 +--------------------------+
28 | Content |
29 |+------------------------+|
30 || Public Key ||
31 |+------------------------+|
32 +--------------------------+
33 | SignatureInfo |
34 |+------------------------+|
35 || SignatureType: ... ||
36 || KeyLocator: ... ||
37 || ValidityPeriod: ... ||
38 || ... ||
39 |+------------------------+|
40 +--------------------------+
41 | SignatureValue |
42 +--------------------------+
43
44
45Name
46----
47
Yingdi Yu7f8e8fe2015-11-04 12:24:11 -080048The name of a certificate consists of five parts as shown below:
Yingdi Yufba8a632015-06-08 22:25:54 -070049
50::
51
Yingdi Yu7f8e8fe2015-11-04 12:24:11 -080052 /<SubjectName>/[KeyId]/KEY/[IssuerId]/[Version]
Yingdi Yufba8a632015-06-08 22:25:54 -070053
Yingdi Yu7f8e8fe2015-11-04 12:24:11 -080054A certificate name starts with the subject to which a public key is bound. The
Yingdi Yufba8a632015-06-08 22:25:54 -070055second part is a single name component, called KeyId, which should uniquely
Yingdi Yu7f8e8fe2015-11-04 12:24:11 -080056identify the key under the subject namespace. The value of KeyId is up to
57the owner of the subject namespace (e.g., 8-byte random number, SHA-256 digest
58of the public key, timestamp, or numerical identifier). A special name
59component ``KEY`` is appended after KeyId, which indicates that the data is a
60certificate. After ``KEY``, there is an IssuerId name component that
61distinguishes different issuers for the same key. How to specify the IssuerId
62is up to the issuer and key owner. The last component is version number.
63For example,
Yingdi Yufba8a632015-06-08 22:25:54 -070064
65::
66
Yingdi Yu7f8e8fe2015-11-04 12:24:11 -080067 /edu/ucla/cs/yingdi/%03%CD...%F1/KEY/%9F%D3...%B7/%FD%d2...%8E
68 \_________________/\___________/ \___________/\___________/
69 Subject Name Key ID Issuer Id Version
Yingdi Yufba8a632015-06-08 22:25:54 -070070
71
72MetaInfo
73--------
74
75The ``ContentType`` of certificate is set to ``KEY`` (2).
76
77The ``FreshnessPeriod`` of certificate must be explicitly specified. The
78recommended value is 1 hour (3,600,000 milliseconds).
79
80Content
81-------
82
83By default, the content of a certificate is the public key encoded in
84`X509PublicKey <https://tools.ietf.org/html/rfc5280#section-4.1.2.7>`__ format.
85
86SignatureInfo
87-------------
88
89Besides, ``SignatureType`` and ``KeyLocator``, the ``SignatureInfo`` field of a
90certificate include more optional fields.
91
92::
93
94 SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH
95 SignatureType
96 KeyLocator
97 ValidityPeriod?
98 ... (SignatureInfo Extension TLVs)
99
100One optional field is ``ValidityPeriod``, which contains two sub TLV fields:
101``NotBefore`` and ``NotAfter``, which are two UTC timestamps in ISO 8601 compact
102format (``yyyymmddTHHMMSS``, e.g., "20020131T235959"). NotBefore indicates
103when the certificate takes effect while NotAfter indicates when the certificate
104expires.
105
106.. note::
107 Using ISO style string is the convention of specifying validity period of
108 certificate, which has been adopted by many certificate systems, such as
109 X.509, PGP, and DNSSEC.
110
111::
112
113 ValidityPeriod ::= VALIDITY-PERIOD-TYPE TLV-LENGTH
114 NotBefore
115 NotAfter
116
117 NotBefore ::= NOT-BEFORE-TYPE TLV-LENGTH
118 BYTE{15}
119
120 NotAfter ::= NOT-AFTER-TYPE TLV-LENGTH
121 BYTE{15}
122
123For each TLV, the TLV-TYPE codes are assigned as below:
124
125+---------------------------------------------+-------------------+----------------+
126| TLV-TYPE | Assigned code | Assigned code |
127| | (decimal) | (hexadecimal) |
128+=============================================+===================+================+
129| ValidityPeriod | 253 | 0xFD |
130+---------------------------------------------+-------------------+----------------+
131| NotBefore | 254 | 0xFE |
132+---------------------------------------------+-------------------+----------------+
133| NotAfter | 255 | 0xFF |
134+---------------------------------------------+-------------------+----------------+
135
136.. note::
137 TLV-TYPE code that falls into [253, 65536) is encoded in
138 `3-byte <http://named-data.net/doc/ndn-tlv/tlv.html#variable-size-encoding-for-type-t-and-length-l>`__
139
140Extensions
141~~~~~~~~~~
142
143A certificate may optionally carry some extensions in SignatureInfo. An extension
144could be either critical or non-critical depends on the TLV-TYPE code convention. An
145critical extension implies that if a validator cannot recognize or cannot parse the
146extension, the validator must reject the certificate. An non-critical extension
147implies that if a validator cannot recognize or cannot parse the extension, the
148validator may ignore the extension.
149
150The TLV-TYPE code range [256, 512) is reserved for extensions. The last bit of a
151TLV-TYPE code indicates whether the extension is critical or not: ``1`` for critical
152while ``0`` for non-critical. If an extension could be either critical or
153non-critical, the extension should be allocated with two TLV-TYPE codes which only
154differ at the last bit. For example, TLV-TYPE codes 256 and 257 are allocated to the
155``StatusChecking`` extension, 256 for critical StatusChecking while 257 for
156non-critical StatusChecking.
157
158
159Proposed Extensions
160-------------------
161
162We list the proposed extensions here:
163
164+---------------------------------------------+-------------------+----------------+
165| TLV-TYPE | Assigned code | Assigned code |
166| | (decimal) | (hexadecimal) |
167+=============================================+===================+================+
168| StatusChecking (Non-critical) | 256 | 0x0100 |
169+---------------------------------------------+-------------------+----------------+
170| StatusChecking (Critical) | 257 | 0x0101 |
171+---------------------------------------------+-------------------+----------------+
172| AdditionalDescription (Non-critical) | 258 | 0x0102 |
173+---------------------------------------------+-------------------+----------------+
174| MultipleSignature (Critical) | 259 | 0x0103 |
175+---------------------------------------------+-------------------+----------------+
176
177.. note::
178 TLV-TYPE code that falls into [253, 65536) is encoded in
179 `3-byte <http://named-data.net/doc/ndn-tlv/tlv.html#variable-size-encoding-for-type-t-and-length-l>`__
180
181Status Checking
182~~~~~~~~~~~~~~~
183
184TBD
185
186Multiple Signature
187~~~~~~~~~~~~~~~~~~
188
189TBD
190
191AdditionalDescription
192~~~~~~~~~~~~~~~~~~~~~
193
194``AdditionalDescription`` is a non-critical extension that provides additional
195information about the certificate. The information is expressed as a set of
196key-value pairs. Both key and value are UTF-8 strings, e.g.,
197``("Organization", "UCLA")``. The issuer of a certificate can specify arbitrary
198key-value pair to provide additional description about the certificate.
199
200::
201
202 AdditionalDescription ::= ADDITIONAL-DESCRIPTION-TYPE TLV-LENGTH
203 DescriptionEntry+
204
205 DescriptionEntry ::= DESCRIPTION-ENTRY-TYPE TLV-LENGTH
206 DescriptionKey
207 DescriptionValue
208
209 DescriptionKey ::= DESCRIPTION-KEY-TYPE TLV-LENGTH
210 BYTE+
211
212 DescriptionValue ::= DESCRIPTION-VALUE-TYPE TLV-LENGTH
213 BYTE+
214
215+---------------------------------------------+-------------------+----------------+
216| TLV-TYPE | Assigned code | Assigned code |
217| | (decimal) | (hexadecimal) |
218+=============================================+===================+================+
219| DescriptionEntry | 512 | 0x0200 |
220+---------------------------------------------+-------------------+----------------+
221| DescriptionKey | 513 | 0x0201 |
222+---------------------------------------------+-------------------+----------------+
223| DescriptionValue | 514 | 0x0202 |
224+---------------------------------------------+-------------------+----------------+