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 | |
| 48 | The name of a certificate consists of four parts as shown below: |
| 49 | |
| 50 | :: |
| 51 | |
| 52 | /<PrincipalName>/[KeyId]/KEY/[Version] |
| 53 | |
| 54 | A certificate name starts with the name to which a public key is bound. The |
| 55 | second part is a single name component, called KeyId, which should uniquely |
| 56 | identify the key under the principal namespace. The value of KeyId is up to |
| 57 | the owner of the principal namespace (e.g., SHA-256 digest of the public key, |
| 58 | timestamp, or numerical identifier). A special name component ``KEY`` is |
| 59 | appended after KeyId, which indicates that the data is a certificate. The last |
| 60 | component is version number. For example, |
| 61 | |
| 62 | :: |
| 63 | |
| 64 | /edu/ucla/cs/yingdi/%03%CD...%F1/KEY/%FD%d2...%8E |
| 65 | \_________________/\___________/ \___________/ |
| 66 | Principal Name Key ID Version |
| 67 | |
| 68 | |
| 69 | MetaInfo |
| 70 | -------- |
| 71 | |
| 72 | The ``ContentType`` of certificate is set to ``KEY`` (2). |
| 73 | |
| 74 | The ``FreshnessPeriod`` of certificate must be explicitly specified. The |
| 75 | recommended value is 1 hour (3,600,000 milliseconds). |
| 76 | |
| 77 | Content |
| 78 | ------- |
| 79 | |
| 80 | By default, the content of a certificate is the public key encoded in |
| 81 | `X509PublicKey <https://tools.ietf.org/html/rfc5280#section-4.1.2.7>`__ format. |
| 82 | |
| 83 | SignatureInfo |
| 84 | ------------- |
| 85 | |
| 86 | Besides, ``SignatureType`` and ``KeyLocator``, the ``SignatureInfo`` field of a |
| 87 | certificate include more optional fields. |
| 88 | |
| 89 | :: |
| 90 | |
| 91 | SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH |
| 92 | SignatureType |
| 93 | KeyLocator |
| 94 | ValidityPeriod? |
| 95 | ... (SignatureInfo Extension TLVs) |
| 96 | |
| 97 | One optional field is ``ValidityPeriod``, which contains two sub TLV fields: |
| 98 | ``NotBefore`` and ``NotAfter``, which are two UTC timestamps in ISO 8601 compact |
| 99 | format (``yyyymmddTHHMMSS``, e.g., "20020131T235959"). NotBefore indicates |
| 100 | when the certificate takes effect while NotAfter indicates when the certificate |
| 101 | expires. |
| 102 | |
| 103 | .. note:: |
| 104 | Using ISO style string is the convention of specifying validity period of |
| 105 | certificate, which has been adopted by many certificate systems, such as |
| 106 | X.509, PGP, and DNSSEC. |
| 107 | |
| 108 | :: |
| 109 | |
| 110 | ValidityPeriod ::= VALIDITY-PERIOD-TYPE TLV-LENGTH |
| 111 | NotBefore |
| 112 | NotAfter |
| 113 | |
| 114 | NotBefore ::= NOT-BEFORE-TYPE TLV-LENGTH |
| 115 | BYTE{15} |
| 116 | |
| 117 | NotAfter ::= NOT-AFTER-TYPE TLV-LENGTH |
| 118 | BYTE{15} |
| 119 | |
| 120 | For each TLV, the TLV-TYPE codes are assigned as below: |
| 121 | |
| 122 | +---------------------------------------------+-------------------+----------------+ |
| 123 | | TLV-TYPE | Assigned code | Assigned code | |
| 124 | | | (decimal) | (hexadecimal) | |
| 125 | +=============================================+===================+================+ |
| 126 | | ValidityPeriod | 253 | 0xFD | |
| 127 | +---------------------------------------------+-------------------+----------------+ |
| 128 | | NotBefore | 254 | 0xFE | |
| 129 | +---------------------------------------------+-------------------+----------------+ |
| 130 | | NotAfter | 255 | 0xFF | |
| 131 | +---------------------------------------------+-------------------+----------------+ |
| 132 | |
| 133 | .. note:: |
| 134 | TLV-TYPE code that falls into [253, 65536) is encoded in |
| 135 | `3-byte <http://named-data.net/doc/ndn-tlv/tlv.html#variable-size-encoding-for-type-t-and-length-l>`__ |
| 136 | |
| 137 | Extensions |
| 138 | ~~~~~~~~~~ |
| 139 | |
| 140 | A certificate may optionally carry some extensions in SignatureInfo. An extension |
| 141 | could be either critical or non-critical depends on the TLV-TYPE code convention. An |
| 142 | critical extension implies that if a validator cannot recognize or cannot parse the |
| 143 | extension, the validator must reject the certificate. An non-critical extension |
| 144 | implies that if a validator cannot recognize or cannot parse the extension, the |
| 145 | validator may ignore the extension. |
| 146 | |
| 147 | The TLV-TYPE code range [256, 512) is reserved for extensions. The last bit of a |
| 148 | TLV-TYPE code indicates whether the extension is critical or not: ``1`` for critical |
| 149 | while ``0`` for non-critical. If an extension could be either critical or |
| 150 | non-critical, the extension should be allocated with two TLV-TYPE codes which only |
| 151 | differ at the last bit. For example, TLV-TYPE codes 256 and 257 are allocated to the |
| 152 | ``StatusChecking`` extension, 256 for critical StatusChecking while 257 for |
| 153 | non-critical StatusChecking. |
| 154 | |
| 155 | |
| 156 | Proposed Extensions |
| 157 | ------------------- |
| 158 | |
| 159 | We list the proposed extensions here: |
| 160 | |
| 161 | +---------------------------------------------+-------------------+----------------+ |
| 162 | | TLV-TYPE | Assigned code | Assigned code | |
| 163 | | | (decimal) | (hexadecimal) | |
| 164 | +=============================================+===================+================+ |
| 165 | | StatusChecking (Non-critical) | 256 | 0x0100 | |
| 166 | +---------------------------------------------+-------------------+----------------+ |
| 167 | | StatusChecking (Critical) | 257 | 0x0101 | |
| 168 | +---------------------------------------------+-------------------+----------------+ |
| 169 | | AdditionalDescription (Non-critical) | 258 | 0x0102 | |
| 170 | +---------------------------------------------+-------------------+----------------+ |
| 171 | | MultipleSignature (Critical) | 259 | 0x0103 | |
| 172 | +---------------------------------------------+-------------------+----------------+ |
| 173 | |
| 174 | .. note:: |
| 175 | TLV-TYPE code that falls into [253, 65536) is encoded in |
| 176 | `3-byte <http://named-data.net/doc/ndn-tlv/tlv.html#variable-size-encoding-for-type-t-and-length-l>`__ |
| 177 | |
| 178 | Status Checking |
| 179 | ~~~~~~~~~~~~~~~ |
| 180 | |
| 181 | TBD |
| 182 | |
| 183 | Multiple Signature |
| 184 | ~~~~~~~~~~~~~~~~~~ |
| 185 | |
| 186 | TBD |
| 187 | |
| 188 | AdditionalDescription |
| 189 | ~~~~~~~~~~~~~~~~~~~~~ |
| 190 | |
| 191 | ``AdditionalDescription`` is a non-critical extension that provides additional |
| 192 | information about the certificate. The information is expressed as a set of |
| 193 | key-value pairs. Both key and value are UTF-8 strings, e.g., |
| 194 | ``("Organization", "UCLA")``. The issuer of a certificate can specify arbitrary |
| 195 | key-value pair to provide additional description about the certificate. |
| 196 | |
| 197 | :: |
| 198 | |
| 199 | AdditionalDescription ::= ADDITIONAL-DESCRIPTION-TYPE TLV-LENGTH |
| 200 | DescriptionEntry+ |
| 201 | |
| 202 | DescriptionEntry ::= DESCRIPTION-ENTRY-TYPE TLV-LENGTH |
| 203 | DescriptionKey |
| 204 | DescriptionValue |
| 205 | |
| 206 | DescriptionKey ::= DESCRIPTION-KEY-TYPE TLV-LENGTH |
| 207 | BYTE+ |
| 208 | |
| 209 | DescriptionValue ::= DESCRIPTION-VALUE-TYPE TLV-LENGTH |
| 210 | BYTE+ |
| 211 | |
| 212 | +---------------------------------------------+-------------------+----------------+ |
| 213 | | TLV-TYPE | Assigned code | Assigned code | |
| 214 | | | (decimal) | (hexadecimal) | |
| 215 | +=============================================+===================+================+ |
| 216 | | DescriptionEntry | 512 | 0x0200 | |
| 217 | +---------------------------------------------+-------------------+----------------+ |
| 218 | | DescriptionKey | 513 | 0x0201 | |
| 219 | +---------------------------------------------+-------------------+----------------+ |
| 220 | | DescriptionValue | 514 | 0x0202 | |
| 221 | +---------------------------------------------+-------------------+----------------+ |