Yingdi Yu | fba8a63 | 2015-06-08 22:25:54 -0700 | [diff] [blame] | 1 | NDN Certificate Format Version 2.0 |
| 2 | ================================== |
| 3 | |
| 4 | .. contents:: |
| 5 | |
| 6 | Since signature verification is a common operation in NDN applications, it is |
| 7 | important to define a common certificate format to standardize the public key |
| 8 | authentication procedure. As every NDN data packet is signed, a data packet |
| 9 | that carries a public key as content is conceptually a certificate. However, |
| 10 | the specification of a data packet is not sufficient to be the specification of |
| 11 | a common certificate format, as it requires additional components. For example, |
| 12 | a certificate may follow a specific naming convention and may need to include |
| 13 | validity period, revocation information, etc. This specification defines |
| 14 | naming and components of the NDN certificates and is complementary to NDN packet |
| 15 | specification. |
| 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 | |
| 45 | Name |
| 46 | ---- |
| 47 | |
Yingdi Yu | 7f8e8fe | 2015-11-04 12:24:11 -0800 | [diff] [blame^] | 48 | The name of a certificate consists of five parts as shown below: |
Yingdi Yu | fba8a63 | 2015-06-08 22:25:54 -0700 | [diff] [blame] | 49 | |
| 50 | :: |
| 51 | |
Yingdi Yu | 7f8e8fe | 2015-11-04 12:24:11 -0800 | [diff] [blame^] | 52 | /<SubjectName>/[KeyId]/KEY/[IssuerId]/[Version] |
Yingdi Yu | fba8a63 | 2015-06-08 22:25:54 -0700 | [diff] [blame] | 53 | |
Yingdi Yu | 7f8e8fe | 2015-11-04 12:24:11 -0800 | [diff] [blame^] | 54 | A certificate name starts with the subject to which a public key is bound. The |
Yingdi Yu | fba8a63 | 2015-06-08 22:25:54 -0700 | [diff] [blame] | 55 | second part is a single name component, called KeyId, which should uniquely |
Yingdi Yu | 7f8e8fe | 2015-11-04 12:24:11 -0800 | [diff] [blame^] | 56 | identify the key under the subject namespace. The value of KeyId is up to |
| 57 | the owner of the subject namespace (e.g., 8-byte random number, SHA-256 digest |
| 58 | of the public key, timestamp, or numerical identifier). A special name |
| 59 | component ``KEY`` is appended after KeyId, which indicates that the data is a |
| 60 | certificate. After ``KEY``, there is an IssuerId name component that |
| 61 | distinguishes different issuers for the same key. How to specify the IssuerId |
| 62 | is up to the issuer and key owner. The last component is version number. |
| 63 | For example, |
Yingdi Yu | fba8a63 | 2015-06-08 22:25:54 -0700 | [diff] [blame] | 64 | |
| 65 | :: |
| 66 | |
Yingdi Yu | 7f8e8fe | 2015-11-04 12:24:11 -0800 | [diff] [blame^] | 67 | /edu/ucla/cs/yingdi/%03%CD...%F1/KEY/%9F%D3...%B7/%FD%d2...%8E |
| 68 | \_________________/\___________/ \___________/\___________/ |
| 69 | Subject Name Key ID Issuer Id Version |
Yingdi Yu | fba8a63 | 2015-06-08 22:25:54 -0700 | [diff] [blame] | 70 | |
| 71 | |
| 72 | MetaInfo |
| 73 | -------- |
| 74 | |
| 75 | The ``ContentType`` of certificate is set to ``KEY`` (2). |
| 76 | |
| 77 | The ``FreshnessPeriod`` of certificate must be explicitly specified. The |
| 78 | recommended value is 1 hour (3,600,000 milliseconds). |
| 79 | |
| 80 | Content |
| 81 | ------- |
| 82 | |
| 83 | By 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 | |
| 86 | SignatureInfo |
| 87 | ------------- |
| 88 | |
| 89 | Besides, ``SignatureType`` and ``KeyLocator``, the ``SignatureInfo`` field of a |
| 90 | certificate 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 | |
| 100 | One optional field is ``ValidityPeriod``, which contains two sub TLV fields: |
| 101 | ``NotBefore`` and ``NotAfter``, which are two UTC timestamps in ISO 8601 compact |
| 102 | format (``yyyymmddTHHMMSS``, e.g., "20020131T235959"). NotBefore indicates |
| 103 | when the certificate takes effect while NotAfter indicates when the certificate |
| 104 | expires. |
| 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 | |
| 123 | For 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 | |
| 140 | Extensions |
| 141 | ~~~~~~~~~~ |
| 142 | |
| 143 | A certificate may optionally carry some extensions in SignatureInfo. An extension |
| 144 | could be either critical or non-critical depends on the TLV-TYPE code convention. An |
| 145 | critical extension implies that if a validator cannot recognize or cannot parse the |
| 146 | extension, the validator must reject the certificate. An non-critical extension |
| 147 | implies that if a validator cannot recognize or cannot parse the extension, the |
| 148 | validator may ignore the extension. |
| 149 | |
| 150 | The TLV-TYPE code range [256, 512) is reserved for extensions. The last bit of a |
| 151 | TLV-TYPE code indicates whether the extension is critical or not: ``1`` for critical |
| 152 | while ``0`` for non-critical. If an extension could be either critical or |
| 153 | non-critical, the extension should be allocated with two TLV-TYPE codes which only |
| 154 | differ 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 |
| 156 | non-critical StatusChecking. |
| 157 | |
| 158 | |
| 159 | Proposed Extensions |
| 160 | ------------------- |
| 161 | |
| 162 | We 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 | |
| 181 | Status Checking |
| 182 | ~~~~~~~~~~~~~~~ |
| 183 | |
| 184 | TBD |
| 185 | |
| 186 | Multiple Signature |
| 187 | ~~~~~~~~~~~~~~~~~~ |
| 188 | |
| 189 | TBD |
| 190 | |
| 191 | AdditionalDescription |
| 192 | ~~~~~~~~~~~~~~~~~~~~~ |
| 193 | |
| 194 | ``AdditionalDescription`` is a non-critical extension that provides additional |
| 195 | information about the certificate. The information is expressed as a set of |
| 196 | key-value pairs. Both key and value are UTF-8 strings, e.g., |
| 197 | ``("Organization", "UCLA")``. The issuer of a certificate can specify arbitrary |
| 198 | key-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 | +---------------------------------------------+-------------------+----------------+ |