idnits 2.17.1 draft-mattsson-cose-cbor-cert-compress-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 6 instances of too long lines in the document, the longest one being 474 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 01, 2020) is 1242 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: '-24' is mentioned on line 748, but not defined -- Looks like a reference, but probably isn't: '23' on line 748 == Missing Reference: '-256' is mentioned on line 557, but not defined -- Looks like a reference, but probably isn't: '255' on line 557 == Missing Reference: '-65536' is mentioned on line 558, but not defined -- Looks like a reference, but probably isn't: '65535' on line 558 -- Looks like a reference, but probably isn't: '1' on line 620 -- Looks like a reference, but probably isn't: '0' on line 1217 -- Looks like a reference, but probably isn't: '3' on line 1224 == Unused Reference: 'I-D.ietf-uta-tls13-iot-profile' is defined on line 897, but no explicit reference was found in the text == Outdated reference: A later version (-08) exists of draft-ietf-cbor-tags-oid-03 == Outdated reference: A later version (-09) exists of draft-ietf-cose-x509-07 ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) -- Possible downref: Non-RFC (?) normative reference: ref. 'SECG' == Outdated reference: A later version (-23) exists of draft-ietf-lake-edhoc-02 == Outdated reference: A later version (-10) exists of draft-ietf-tls-ctls-01 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-39 == Outdated reference: A later version (-09) exists of draft-ietf-uta-tls13-iot-profile-00 Summary: 3 errors (**), 0 flaws (~~), 11 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group S. Raza 3 Internet-Draft J. Hoeglund 4 Intended status: Standards Track RISE AB 5 Expires: June 4, 2021 G. Selander 6 J. Mattsson 7 Ericsson AB 8 M. Furuhed 9 Nexus Group 10 December 01, 2020 12 CBOR Encoding of X.509 Certificates (CBOR Certificates) 13 draft-mattsson-cose-cbor-cert-compress-05 15 Abstract 17 This document specifies a CBOR encoding of X.509 certificates. The 18 resulting certificates are called CBOR Certificates. The CBOR 19 encoding supports a large subset of RFC 5280, while at the same time 20 significantly reduces the size of certificates compatible with RFC 21 7925 and IEEE 802.1AR (DevIDs). When used to re-encode DER encoded 22 X.509 certificates, the CBOR encoding can in many cases reduce the 23 size of RFC 7925 profiled certificates with over 50%. The CBOR 24 encoding can also be used encode "natively signed" CBOR certificates, 25 which does not require re-encoding for the signature to be verified. 26 The document also specifies COSE headers as well as a TLS certificate 27 type for CBOR certificates. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on June 4, 2021. 46 Copyright Notice 48 Copyright (c) 2020 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 4 65 3. CBOR Encoding . . . . . . . . . . . . . . . . . . . . . . . . 4 66 3.1. Message Fields . . . . . . . . . . . . . . . . . . . . . 5 67 3.2. Encoding of Extensions . . . . . . . . . . . . . . . . . 8 68 4. Compliance Requirements for Constrained IoT . . . . . . . . . 10 69 5. Legacy Considerations . . . . . . . . . . . . . . . . . . . . 11 70 6. Expected Certificate Sizes . . . . . . . . . . . . . . . . . 11 71 7. Natively Signed CBOR Certificates . . . . . . . . . . . . . . 12 72 8. Security Considerations . . . . . . . . . . . . . . . . . . . 12 73 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 74 9.1. CBOR Certificate Types Registry . . . . . . . . . . . . . 13 75 9.2. CBOR Attribute Type Registry . . . . . . . . . . . . . . 14 76 9.3. CBOR Extension Type Registry . . . . . . . . . . . . . . 14 77 9.4. CBOR Extended Key Usage Registry . . . . . . . . . . . . 15 78 9.5. CBOR General Name Registry . . . . . . . . . . . . . . . 16 79 9.6. CBOR Certificate Signature Algorithms Registry . . . . . 16 80 9.7. CBOR Certificate Public Key Algorithms Registry . . . . . 17 81 9.8. COSE Header Parameters Registry . . . . . . . . . . . . . 18 82 9.9. TLS Certificate Types Registry . . . . . . . . . . . . . 19 83 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 84 10.1. Normative References . . . . . . . . . . . . . . . . . . 19 85 10.2. Informative References . . . . . . . . . . . . . . . . . 20 86 Appendix A. Example CBOR Certificates . . . . . . . . . . . . . 21 87 A.1. Example RFC 7925 profiled X.509 Certificate . . . . . . . 21 88 A.2. Example HTPPS X.509 Certificate . . . . . . . . . . . . . 25 89 Appendix B. X.509 Certificate Profile, ASN.1 . . . . . . . . . . 27 90 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 29 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 93 1. Introduction 95 One of the challenges with deploying a Public Key Infrastructure 96 (PKI) for the Internet of Things (IoT) is the size and parsing of 97 X.509 public key certificates [RFC5280], since those are not 98 optimized for constrained environments [RFC7228]. More compact 99 certificate representations are desirable. Due to the current PKI 100 usage of DER encoded X.509 certificates, keeping compatibility with 101 DER encoded X.509 is necessary at least for a transition period. 102 However, the use of a more compact encoding with the Concise Binary 103 Object Representation (CBOR) [RFC7049] reduces the certificate size 104 significantly which has known performance benefits in terms of 105 decreased communication overhead, power consumption, latency, 106 storage, etc. 108 CBOR is a data format designed for small code size and small message 109 size. CBOR builds on the JSON data model but extends it by e.g. 110 encoding binary data directly without base64 conversion. In addition 111 to the binary CBOR encoding, CBOR also has a diagnostic notation that 112 is readable and editable by humans. The Concise Data Definition 113 Language (CDDL) [RFC8610] provides a way to express structures for 114 protocol messages and APIs that use CBOR. [RFC8610] also extends the 115 diagnostic notation. 117 CBOR data items are encoded to or decoded from byte strings using a 118 type-length-value encoding scheme, where the three highest order bits 119 of the initial byte contain information about the major type. CBOR 120 supports several different types of data items, in addition to 121 integers (int, uint), simple values (e.g. null), byte strings (bstr), 122 and text strings (tstr), CBOR also supports arrays [] of data items, 123 maps {} of pairs of data items, and sequences of data items. For a 124 complete specification and examples, see [RFC7049], [RFC8610], and 125 [RFC8742]. 127 RFC 7925 [RFC7925] and IEEE 802.1AR [IEEE-802.1AR] specify 128 certificate profiles for Internet of Things deployments which can be 129 applied to lightweight certificate based authentication with, e.g., 130 TLS [RFC8446], DTLS [I-D.ietf-tls-dtls13], COSE [RFC8152], EDHOC 131 [I-D.ietf-lake-edhoc] or Compact TLS 1.3 [I-D.ietf-tls-ctls]. This 132 document specifies a CBOR encoding based on [X.509-IoT], which can 133 support large parts of [RFC5280]. The encoding support all [RFC7925] 134 and IEEE 802.1AR [IEEE-802.1AR] profiled X.509 certificates. Two 135 variants are defined using the same CBOR encoding and differing only 136 in what is being signed: 138 o An invertible CBOR re-encoding of DER encoded X.509 certificates 139 [RFC5280], which can be reversed to obtain the original DER 140 encoded X.509 certificate. 142 o Natively signed CBOR certificates, which further optimizes the 143 performance in constrained environments but is not backwards 144 compatible with [RFC5280], see Section 7. 146 This document specifies COSE headers for use of the CBOR certificates 147 with COSE, see Section 9.8. The document also specifies a TLS 148 certificate type for use of the CBOR certificates with TLS (with or 149 without additional TLS certificate compression), see Section 9.9. 151 2. Notational Conventions 153 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 154 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 155 "OPTIONAL" in this document are to be interpreted as described in BCP 156 14 [RFC2119] [RFC8174] when, and only when, they appear in all 157 capitals, as shown here. 159 This specification makes use of the terminology in [RFC5280], 160 [RFC7049], [RFC7228], and [RFC8610]. 162 3. CBOR Encoding 164 This section specifies the content and encoding for CBOR 165 certificates, with the overall objective to produce a very compact 166 representation supporting large parts of [RFC5280], and everything in 167 [RFC7925] and [IEEE-802.1AR]. In the CBOR encoding, static fields 168 are elided, elliptic curve points and time values are compressed, OID 169 are replaced with short integers, and redundant encoding is removed. 170 Combining these different components reduces the certificate size 171 significantly, which is not possible with general purpose 172 compressions algorithms, see Figure 2. 174 The CBOR certificate can be either a CBOR re-encoding of a DER 175 encoded X.509 certificate, in which case the signature is calculated 176 on the DER encoded ASN.1 data in the X.509 certificate, or a natively 177 signed CBOR certificate, in which case the signature is calculated 178 directly on the CBOR encoded data (see Section 7). In both cases the 179 certificate content is adhering to the restrictions given by 180 [RFC5280]. The re-encoding is known to work with DER encoded 181 certificates but might work with other canonical encodings. The re- 182 encoding does not work for BER encoded certificates. 184 In the encoding described below, the order of elements in arrays are 185 always encoded in the same order as the elements or the corresponding 186 SEQUENCE or SET in the DER encoding. 188 3.1. Message Fields 190 The X.509 fields and their CBOR encodings are listed below, and used 191 in the definition of CBOR Certificates, see Figure 1. 193 CBOR certificates are defined in terms of DER encoded [RFC5280] X.509 194 certificates: 196 o version. The 'version' field is encoded in the 197 'cborCertificateType' CBOR int. The field 'cborCertificateType' 198 also indicates the type of the CBOR certificate. Currently, the 199 type can be a natively signed CBOR certificate following X.509 v3 200 (cborCertificateType = 0) or a CBOR re-encoded X.509 v3 DER 201 certificate (cborCertificateType = 1), see Section 9.1. 203 o serialNumber. The 'serialNumber' INTEGER value field is encoded 204 as the unwrapped CBOR positive bignum (~biguint) 205 'certificateSerialNumber'. Any leading 0x00 byte (to indicate 206 that the number is not negative) is therefore omitted. 208 o signature. The 'signature' field is always the same as the 209 'signatureAlgorithm' field and therefore omitted from the CBOR 210 encoding. 212 o issuer. In the general case, the sequence of 213 'RelativeDistinguishedName' is encoded as a CBOR array of CBOR 214 arrays of Attributes, where each Attribute type and value is 215 encoded as a (CBOR int, CBOR text string) pair. Each 216 AttributeType is encoded as a CBOR int (see Figure 4). The 217 AttributeType id-emailAddress is always an IA5String. For the 218 other AttributeTypes, the sign is used to represent the character 219 string type; positive for utf8String, negative for 220 printableString. In natively signed CBOR certificates all strings 221 are utf8String and the sign has no meaning. The string types 222 teletexString, universalString, and bmpString are not supported. 223 If Name contains a single Attribute containing an utf8String 224 encoded 'common name' it is encoded as a CBOR text string. If the 225 text string contains an EUI-64 of the form "HH-HH-HH-HH-HH-HH-HH- 226 HH" where 'H' is one of the symbol '0'-'9' or 'A'-'F' it is 227 encoded as a CBOR byte string of length 8 instead. EUI-64 mapped 228 from a 48-bit MAC address (i.e. of the form "HH-HH-HH-FF-FE-HH-HH- 229 HH) is encoded as a CBOR byte string of length 6. 231 o validity. The 'notBefore' and 'notAfter' fields are encoded as 232 unwrapped CBOR epoch-based date/time (~time) where the tag content 233 is an unsigned integer. In POSIX time, leap seconds are ignored, 234 with a leap second having the same POSIX time as the second before 235 it. Compression of X.509 certificates with the time 23:59:60 UTC 236 is therefore not supported. Note that RFC 5280 mandates encoding 237 of dates through the year 2049 as UTCTime, and later dates as 238 GeneralizedTime. The value "99991231235959Z" (no expiration date) 239 is encoded as CBOR null. 241 o subject. The 'subject' is encoded exactly like issuer. 243 o subjectPublicKeyInfo. The 'algorithm' field is encoded as the 244 CBOR int 'subjectPublicKeyAlgorithm' (see Section 9.7) or a CBOR 245 OID tag [I-D.ietf-cbor-tags-oid] . Algorithms with parameters are 246 not supported except id-ecPublicKey with named curves and the RSA 247 algorithms that use parameters = NULL. For id-ecPublicKey the 248 namedCurve parameter is encoded in the CBOR int. The 249 'subjectPublicKey' BIT STRING value field is encoded as a CBOR 250 byte string. This specification assumes the BIT STRING has zero 251 unused bits and the unused bits byte is omitted. Uncompressed 252 public keys of type id-ecPublicKey are point compressed as defined 253 in Section 2.3.3 of [SECG]. If a DER encoded certificate with a 254 point compressed public key of type id-ecPublicKey is CBOR 255 encoded, the octets 0xfe and 0xfd are used instead of 0x02 and 256 0x03 in the CBOR encoding to represent even and odd y-coordinate, 257 respectively. 259 o issuerUniqueID. Not supported. 261 o subjectUniqueID. Not supported. 263 o extensions. The 'extensions' field is encoded as a CBOR array 264 where each extension is encoded as either a CBOR int (see 265 Section 9.3) followed by an optional CBOR item of any type or a 266 CBOR OID tag [I-D.ietf-cbor-tags-oid] followed by a CBOR bool 267 encoding 'critical' and the DER encoded value of the 'extnValue' 268 encoded as a CBOR byte string. If the array contains exactly two 269 ints and the absolute value of the first int is 2, the array is 270 omitted and the extensions is encoded as a single CBOR int with 271 the absolute value of the second int and the sign of the first 272 int. Extensions are encoded as specified in Section 3.2. The 273 extensions mandated to be supported by [RFC7925] and 274 [IEEE-802.1AR] are given special treatment. An omitted 275 'extensions' field is encoded as an empty CBOR array. 277 o signatureAlgorithm. The 'signatureAlgorithm' field is encoded as 278 a CBOR int (see Section 9.6) or a CBOR OID tag 279 [I-D.ietf-cbor-tags-oid]. Algorithms with parameters are not 280 supported except RSA algorithms that use parameters = NULL. 282 o signatureValue. The 'signatureValue' BIT STRING value field is 283 encoded as the CBOR byte string issuerSignatureValue. This 284 specification assumes the BIT STRING has zero unused bits and the 285 unused bits byte is omitted. ECDSA signatures are given special 286 treatment. For ECDSA signatures the SEQUENCE and INTEGER type and 287 length fields are omitted and the two INTEGER value fields are 288 padded to the fixed length L = ceil( log2(n) / 8 ), where n is the 289 size of the largest prime-order subgroup. For secp256r1, 290 secp384r1, and secp521r1, L is 32, 48, and 66 respectively. For 291 natively signed CBOR certificates the signatureValue is calculated 292 over the CBOR sequence TBSCertificate. 294 The following Concise Data Definition Language (CDDL) defines 295 CBORCertificate and TBSCertificate, which are encoded as CBOR 296 Sequences [RFC8742]. The member names therefore only have 297 documentary value. 299 ; The elements of the following array are to be used in a CBOR Sequence: 300 CBORCertificate = [ 301 TBSCertificate, 302 issuerSignatureValue : bytes, 303 ] 305 TBSCertificate = ( 306 cborCertificateType : int, 307 certificateSerialNumber : CertificateSerialNumber, 308 issuer : Name, 309 validityNotBefore : Time, 310 validityNotAfter : Time / null, 311 subject : Name, 312 subjectPublicKeyAlgorithm : Algorithm, 313 subjectPublicKey : bytes, 314 extensions : Extensions, 315 issuerSignatureAlgorithm : Algorithm, 316 ) 318 CertificateSerialNumber = ~biguint 320 Name = [ * [ + Attribute ] ] / text / bytes 322 Attribute = ( attributeType : int, attributeValue : text ) 324 Time = ~time 326 Algorithm = int / oid 328 Extensions = [ * Extension ] / int 330 Extension = ( 331 extensionID : int / oid, 332 ? critical : bool, ; present if and only if extensionID is an oid 333 extensionValue : any, ; type known from extensionID 334 ) 336 Figure 1: CDDL for CBORCertificate. 338 3.2. Encoding of Extensions 340 EDITOR'S NOTE: The current specification encodes many common 341 extensions with a DER encoded byte string. It should be discussed if 342 more or all commonly active extensions should be natively encoded 343 with CBOR. Would a specific CBOR encoding have to be specified for 344 each extension or can a general CBOR encoding that apply to all 345 remaining extensions be specified? 346 This section details the encoding of the 'extensions' field. The 347 'extensions' field is encoded as a CBOR array where each extensionID 348 is encoded as either a CBOR int or a CBOR OID tag. If 'extensionID' 349 is encoded an int (see Section 9.3),the sign is used to encode if the 350 extension is critical and the 'critical' field is omitted. Critical 351 extensions are encoded with a positive sign and non-critical 352 extensions are encoded with a negative sign. 354 The 'extnValue' OCTET STREAM value field is encoded as the CBOR byte 355 string 'extensionValue' except for the extensions specified below. 356 The 'extensionValue' for the extensions mandated to be supported by 357 [RFC7925] and [IEEE-802.1AR] are encoded as follows: 359 o basicConstraints. If 'cA' = false then extensionValue = -2, if 360 'cA' = true and 'pathLenConstraint' is not present then 361 extensionValue = -1, and if 'cA' = true and 'pathLenConstraint' is 362 present then extensionValue = pathLenConstraint. 364 o keyUsage. The 'KeyUsage' BIT STRING is interpreted as an unsigned 365 integer n in network byte order and encoded as a CBOR int. 367 o extKeyUsage. extensionValue is encoded as an array of CBOR ints 368 (see Section 9.4) or CBOR OID tags [I-D.ietf-cbor-tags-oid] where 369 each int or OID tag encodes a key usage purpose. If the array 370 contains a single int, the array is omitted. 372 ExtValueEKU = [ + int / oid ] / int 374 o subjectAltName. extensionValue is encoded as an array of (int, 375 any) pairs where each pair encodes a general name (see 376 Section 9.5). If subjectAltName contains exactly one dNSName, the 377 array and the int are omitted and extensionValue is the dNSName 378 encoded as a CBOR text string. In addition to the general names 379 defined in [RFC5280], the hardwareModuleName type of otherName has 380 been given its own int due to its mandatory use in IEEE 802.1AR. 381 When 'otherName + hardwareModuleName' is used, then [ oid, bytes ] 382 is used to identify the pair ( hwType, hwSerialEntries ) directly 383 as specified in [RFC4108]. 385 GeneralNames = [ + GeneralName ] / text 386 GeneralName = ( GeneralNameType : int, GeneralNameValue : any ) 388 o authorityKeyIdentifier. extensionValue is encoded as an array 389 where the value of the 'keyIdentifier' is encoded as a CBOR byte 390 string, 'GeneralNames' is encoded like in subjectAltName, and 391 'AuthorityCertSerialNumber' is encoded as ~biguint exactly like 392 certificateSerialNumber. 394 KeyIdentifier = bytes 396 o subjectKeyIdentifier. extensionValue is the value of the 397 'keyIdentifier' field encoded as a CBOR byte string. 399 o cRLDistributionPoints. If the cRLDistributionPoints is a sequence 400 of DistributionPointName, it is encoded like subjectAltName, with 401 the difference that if cRLDistributionPoints contains exactly one 402 uniformResourceIdentifier, the the array and the int are omitted 403 and extensionValue is the uniformResourceIdentifier encoded as a 404 CBOR text string. 406 o authorityInfoAccess. If authorityInfoAccess consist of only 407 uniformResourceIdentifiers it is encoded as an array of uris. 409 ExtValueAIA = [ + ( ocsp : 1 // caIssuers : 2 , uri : text ) ] 411 3.2.1. Example Encoding of Extensions 413 The examples below use values from Section 9.3, Section 9.4, and 414 Section 9.5: 416 o A critical basicConstraints ('cA' = true) without 417 pathLenConstraint is encoded as the two CBOR ints -1, -1. 419 o A non-critical keyUsage with digitalSignature and keyAgreement 420 asserted is encoded as the two CBOR ints 2, 17 (2^0 + 2^4 = 17). 422 o A non-critical extKeyUsage containing id-kp-codeSigning and id-kp- 423 OCSPSigning is encoded as the CBOR int 3 followed by the CBOR 424 array [ 3, 6 ]. 426 o A non-critical subjectAltName containing only the dNSName 427 example.com is encoded as the CBOR int 4 followed by the CBOR text 428 string "example.com". 430 Thus, the extension field of a certificate containing all of the 431 above extensions in the given order would be encoded as the CBOR 432 array [ -1, -1, 2, 17, 3, [ 3, 6 ], 4, "example.com" ]. 434 4. Compliance Requirements for Constrained IoT 436 For general purpose applications, the normative requirements of 437 [RFC5280] applies. This section describes the mandatory to implement 438 algorithms and OIDs for constrained IoT application; the values of 439 the OIDs including certificate fields and extensions, time format, 440 attributes in distinguished names, etc. 442 TODO: Write this section 444 5. Legacy Considerations 446 CBOR certificates can be deployed with legacy X.509 certificates and 447 CA infrastructure. In order to verify the signature, the CBOR 448 certificate is used to recreate the original X.509 data structure to 449 be able to verify the signature. 451 For protocols like TLS/DTLS 1.2, where the handshake is sent 452 unencrypted, the actual encoding and compression can be done at 453 different locations depending on the deployment setting. For 454 example, the mapping between CBOR certificate and standard X.509 455 certificate can take place in a 6LoWPAN border gateway which allows 456 the server side to stay unmodified. This case gives the advantage of 457 the low overhead of a CBOR certificate over a constrained wireless 458 links. The conversion to X.509 within an IoT device will incur a 459 computational overhead, however, measured in energy this is likely to 460 be negligible compared to the reduced communication overhead. 462 For the setting with constrained server and server-only 463 authentication, the server only needs to be provisioned with the CBOR 464 certificate and does not perform the conversion to X.509. This 465 option is viable when client authentication can be asserted by other 466 means. 468 For protocols like IKEv2, TLS/DTLS 1.3, and EDHOC, where certificates 469 are encrypted, the proposed encoding needs to be done fully end-to- 470 end, through adding the encoding/decoding functionality to the 471 server. 473 6. Expected Certificate Sizes 475 The CBOR encoding of the sample certificate given in Appendix A 476 results in the numbers shown in Figure 2. After [RFC7925] profiling, 477 most duplicated information has been removed, and the remaining text 478 strings are minimal in size. Therefore, the further size reduction 479 reached with general compression mechanisms will be small, mainly 480 corresponding to making the ASN.1 encoding more compact. The zlib 481 number was calculated with zlib-flate. 483 zlib-flate -compress < cert.der > cert.compressed 484 +------------------+--------------+------------+--------------------+ 485 | | RFC 7925 | zlib | CBOR Certificate | 486 +------------------+---------------------------+--------------------+ 487 | Certificate Size | 314 | 295 | 138 | 488 +------------------+--------------+------------+--------------------+ 490 Figure 2: Comparing Sizes of Certificates (bytes) 492 7. Natively Signed CBOR Certificates 494 The difference between CBOR encoded X.509 certificate and natively 495 signed CBOR certificate is that the signature is calculated over the 496 CBOR encoding of the CBOR sequence TBSCertficate rather than the DER 497 encoded ASN.1 data. This removes entirely the need for ASN.1 DER and 498 base64 encodings which reduces the processing in the authenticating 499 devices, and avoids known complexities and security issues with these 500 encodings. 502 Natively signed CBOR certificates can be applied in devices that are 503 only required to authenticate to natively signed CBOR certificate 504 compatible servers. This is not a major restriction for many IoT 505 deployments, where the parties issuing and verifying certificates can 506 be a restricted ecosystem which not necessarily involves public CAs. 508 CBOR encoded X.509 certificates provides an intermediate step between 509 [RFC7925] or [IEEE-802.1AR] profiled X.509 certificates and natively 510 signed CBOR certificates: An implementation of CBOR encoded X.509 511 certificates contains both the CBOR encoding of the X.509 certificate 512 and the signature operations sufficient for natively signed CBOR 513 certificates. 515 The natively signed approach based on DER encoded X.509 certificates 516 described in this document has also other benefits. For example, a 517 CA can use existing ASN.1 machinery to create a DER encoded 518 certificate, the DER encoded certificate can then be transformed to 519 CBOR before signing. 521 8. Security Considerations 523 The CBOR profiling of X.509 certificates does not change the security 524 assumptions needed when deploying standard X.509 certificates but 525 decreases the number of fields transmitted, which reduces the risk 526 for implementation errors. 528 The use of natively signed CBOR certificates removes the need for 529 ASN.1 encoding, which is a rich source of security vulnerabilities. 531 Conversion between the certificate formats can be made in constant 532 time to reduce risk of information leakage through side channels. 534 The mechanism in this draft does not reveal any additional 535 information compared to X.509. Because of difference in size, it 536 will be possible to detect that this profile is used. The gateway 537 solution described in Section 5 requires unencrypted certificates and 538 is not recommended. 540 9. IANA Considerations 542 This document creates several new registries under the new heading 543 "CBOR Certificate". For all items, the 'Reference' field points to 544 this document. 546 The expert reviewers for the registries defined in this document are 547 expected to ensure that the usage solves a valid use case that could 548 not be solved better in a different way, that it is not going to 549 duplicate one that is already registered, and that the registered 550 point is likely to be used in deployments. They are furthermore 551 expected to check the clarity of purpose and use of the requested 552 code points. Experts should take into account the expected usage of 553 entries when approving point assignment, and the length of the 554 encoded value should be weighed against the number of code points 555 left that encode to that size and the size of device it will be used 556 on. Values in the interval [-24, 23] have a 1 byte encodings, other 557 values in the interval [-256, 255] have a 2 byte encodings, and the 558 remaning values in the interval [-65536, 65535] have 3 byte 559 encodings. 561 9.1. CBOR Certificate Types Registry 563 IANA has created a new registry titled "CBOR Certificate Types" under 564 the new heading "CBOR Certificate". For values in the interval [-24, 565 23] the registration procedure is "IETF Review" and "Expert Review". 566 For all other values the registration procedure is "Expert Review". 567 The columns of the registry are Value, Description, and Reference, 568 where Value is an integer, and the other columns are text strings. 569 The initial contents of the registry are: 571 +-------+-----------------------------------------------------+ 572 | Value | Description | 573 +=======+=====================================================+ 574 | 0 | Natively Signed CBOR Certificate following X.509 v3 | 575 | 1 | CBOR re-encoding of X.509 v3 Certificate | 576 +-------+-----------------------------------------------------+ 578 Figure 3: CBOR Certificate Types 580 9.2. CBOR Attribute Type Registry 582 IANA has created a new registry titled "CBOR Attribute Type Registry" 583 under the new heading "CBOR Certificate". The columns of the 584 registry are Value, X.509 Attribute Type, and Reference, where Value 585 is an integer, and the other columns are text strings. Only non- 586 negative values can be registered. For values in the interval [0, 587 23] the registration procedure is "IETF Review" and "Expert Review". 588 For all other values the registration procedure is "Expert Review". 589 The initial contents of the registry are: 591 +-------+---------------------------------------+ 592 | Value | X.509 Attribute Type | 593 +=======+=======================================+ 594 | 0 | id-emailAddress | 595 | 1 | id-at-commonName | 596 | 2 | id-at-surname | 597 | 3 | id-at-serialNumber | 598 | 4 | id-at-countryName | 599 | 5 | id-at-localityName | 600 | 6 | id-at-stateOrProvinceName | 601 | 7 | id-at-organizationName | 602 | 8 | id-at-organizationalUnitName | 603 | 9 | id-at-title | 604 | 10 | id-at-givenName | 605 | 11 | id-at-initials | 606 | 12 | id-at-generationQualifier | 607 | 13 | id-at-dnQualifier | 608 | 14 | id-at-pseudonym | 609 | 15 | id-at-organizationIdentifier | 610 +-------+---------------------------------------+ 612 Figure 4: CBOR Attribute Type Registry 614 9.3. CBOR Extension Type Registry 616 IANA has created a new registry titled "CBOR Extension Type Registry" 617 under the new heading "CBOR Certificate". The columns of the 618 registry are Value, X.509 Extension Type, and Reference, where Value 619 is an integer, and the other columns are text strings. Only positive 620 values can be registered. For values in the interval [1, 23] the 621 registration procedure is "IETF Review" and "Expert Review". For all 622 other values the registration procedure is "Expert Review". The 623 initial contents of the registry are: 625 +-------+-------------------------------------+------------------+ 626 | Value | X.509 Extension Type | extensionValue | 627 +=======+=====================================+==================+ 628 | 1 | id-ce-basicConstraints | int | 629 | 2 | id-ce-keyUsage | int | 630 | 3 | id-ce-extKeyUsage | ExtValueEKU | 631 | 4 | id-ce-subjectAltName | GeneralNames | 632 | 5 | id-ce-authorityKeyIdentifier | ExtValueAKI | 633 | 6 | id-ce-subjectKeyIdentifier | KeyIdentifier | 634 | 7 | id-ce-certificatePolicies | bytes | 635 | 8 | id-ce-cRLDistributionPoints | GeneralNames | 636 | 9 | id-pe-authorityInfoAccess | ExtValueAIA | 637 | 10 | SCT List (1.3.6.1.4.1.11129.2.4.2) | bytes | 638 | 248 | id-ce-nameConstraints | bytes | 639 | 249 | id-ce-policyConstraints | bytes | 640 | 250 | id-ce-inhibitAnyPolicy | bytes | 641 | 251 | id-ce-policyMappings | bytes | 642 | 252 | id-ce-issuerAltName | GeneralNames | 643 | 253 | id-ce-subjectDirectoryAttributes | bytes | 644 | 254 | id-ce-freshestCRL | bytes | 645 | 255 | id-pe-subjectInfoAccess | bytes | 646 +-------+-------------------------------------+------------------+ 648 Figure 5: CBOR Extension Type Registry 650 9.4. CBOR Extended Key Usage Registry 652 IANA has created a new registry titled "CBOR Extended Key Usage 653 Registry" under the new heading "CBOR Certificate". The columns of 654 the registry are Value, Extended Key Usage Purpose, and Reference, 655 where Value is an integer, and the other columns are text strings. 656 For values in the interval [-24, 23] the registration procedure is 657 "IETF Review" and "Expert Review". For all other values the 658 registration procedure is "Expert Review". The initial contents of 659 the registry are: 661 +-------+---------------------------------------+ 662 | Value | Extended Key Usage | 663 +=======+=======================================+ 664 | 0 | anyExtendedKeyUsage | 665 | 1 | id-kp-serverAuth | 666 | 2 | id-kp-clientAuth | 667 | 3 | id-kp-codeSigning | 668 | 4 | id-kp-emailProtection | 669 | 5 | id-kp-timeStamping | 670 | 6 | id-kp-OCSPSigning | 671 +-------+---------------------------------------+ 673 Figure 6: CBOR Extended Key Usage Registry 675 9.5. CBOR General Name Registry 677 IANA has created a new registry titled "CBOR General Name Registry" 678 under the new heading "CBOR Certificate". The columns of the 679 registry are Value, General Name, and Reference, where Value is an 680 integer, and the other columns are text strings. For values in the 681 interval [-24, 23] the registration procedure is "IETF Review" and 682 "Expert Review". For all other values the registration procedure is 683 "Expert Review". The initial contents of the registry are: 685 +-------+-----------------------------------+------------------+ 686 | Value | General Name Type | Value | 687 +=======+===================================+==================+ 688 | -1 | otherName + hardwareModuleName | [ oid, bytes ] | 689 | 0 | otherName | [ oid, bytes ] | 690 | 1 | rfc822Name | text | 691 | 2 | dNSName | text | 692 | 4 | directoryName | Name | 693 | 6 | uniformResourceIdentifier | text | 694 | 7 | iPAddress | bytes | 695 | 8 | registeredID | oid | 696 +-------+-----------------------------------+------------------+ 698 Figure 7: CBOR General Name Registry 700 9.6. CBOR Certificate Signature Algorithms Registry 702 IANA has created a new registry titled "CBOR Certificate Signature 703 Algorithms" under the new heading "CBOR Certificate". For values in 704 the interval [-24, 23] the registration procedure is "IETF Review" 705 and "Expert Review". For all other values the registration procedure 706 is "Expert Review". The columns of the registry are Value, X.509 707 Algorithm, and Reference, where Value is an integer, and the other 708 columns are text strings. The initial contents of the registry are: 710 +-------+---------------------------------------+ 711 | Value | X.509 Signature Algorithm | 712 +=======+=======================================+ 713 | -256 | sha1WithRSAEncryption | 714 | -255 | ecdsa-with-SHA1 | 715 | 1 | sha256WithRSAEncryption | 716 | 2 | sha384WithRSAEncryption | 717 | 3 | sha512WithRSAEncryption | 718 | 4 | id-RSASSA-PSS-SHAKE128 | 719 | 5 | id-RSASSA-PSS-SHAKE256 | 720 | 6 | ecdsa-with-SHA256 | 721 | 7 | ecdsa-with-SHA384 | 722 | 8 | ecdsa-with-SHA512 | 723 | 9 | id-ecdsa-with-shake128 | 724 | 10 | id-ecdsa-with-shake256 | 725 | 11 | id-Ed25519 | 726 | 12 | id-Ed448 | 727 | 13 | id-alg-hss-lms-hashsig | 728 | 14 | id-alg-xmss | 729 | 15 | id-alg-xmssmt | 730 | 245 | sha224WithRSAEncryption | 731 | 246 | id-rsassa-pkcs1-v1_5-with-sha3-224 | 732 | 247 | id-rsassa-pkcs1-v1_5-with-sha3-256 | 733 | 248 | id-rsassa-pkcs1-v1_5-with-sha3-384 | 734 | 249 | id-rsassa-pkcs1-v1_5-with-sha3-512 | 735 | 251 | ecdsa-with-SHA224 | 736 | 252 | id-ecdsa-with-sha3-224 | 737 | 253 | id-ecdsa-with-sha3-256 | 738 | 254 | id-ecdsa-with-sha3-384 | 739 | 255 | id-ecdsa-with-sha3-512 | 740 +-------+---------------------------------------+ 742 Figure 8: CBOR Certificate Signature Algorithms 744 9.7. CBOR Certificate Public Key Algorithms Registry 746 IANA has created a new registry titled "CBOR Certificate Public Key 747 Algorithms" under the new heading "CBOR Certificate". For values in 748 the interval [-24, 23] the registration procedure is "IETF Review" 749 and "Expert Review". For all other values the registration procedure 750 is "Expert Review". The columns of the registry are Value, X.509 751 Algorithm, and Reference, where Value is an integer, and the other 752 columns are text strings. The initial contents of the registry are: 754 +-------+---------------------------------------+ 755 | Value | X.509 Public Key Algorithm | 756 +=======+=======================================+ 757 | 0 | rsaEncryption | 758 | 1 | id-ecPublicKey + secp256r1 | 759 | 2 | id-ecPublicKey + secp384r1 | 760 | 3 | id-ecPublicKey + secp521r1 | 761 | 4 | id-X25519 | 762 | 5 | id-X448 | 763 | 6 | id-Ed25519 | 764 | 7 | id-Ed448 | 765 | 8 | id-alg-hss-lms-hashsig | 766 | 9 | id-alg-xmss | 767 | 10 | id-alg-xmssmt | 768 +-------+---------------------------------------+ 770 Figure 9: CBOR Certificate Public Key Algorithms 772 9.8. COSE Header Parameters Registry 774 This document registers the following entries in the "COSE Header 775 Parameters" registry under the "CBOR Object Signing and Encryption 776 (COSE)" heading. The formatting and processing are the same as the 777 corresponding x5bag, x5chain, x5t, and x5u defined in 778 [I-D.ietf-cose-x509] except that the certificates are CBOR encoded 779 instead of DER encoded. Note that certificates can also be 780 identified with a 'kid' header parameter by storing 'kid' and the 781 associated bag or chain in a dictionary. 783 +-----------+-------+----------------+---------------------+ 784 | Name | Label | Value Type | Description | 785 +===========+=======+================+=====================+ 786 | c5bag | TBD1 | COSE_X509 | An unordered bag of | 787 | | | | CBOR certificates | 788 +-----------+-------+----------------+---------------------+ 789 | c5chain | TBD2 | COSE_X509 | An ordered chain of | 790 | | | | CBOR certificates | 791 +-----------+-------+----------------+---------------------+ 792 | c5t | TBD3 | COSE_CertHash | Hash of an | 793 | | | | CBOR certificate | 794 +-----------+-------+----------------+---------------------+ 795 | c5u | TBD4 | uri | URI pointing to a | 796 | | | | CBOR certificate | 797 +-----------+-------+----------------+---------------------+ 799 9.9. TLS Certificate Types Registry 801 This document registers the following entry in the "TLS Certificate 802 Types" registry under the "Transport Layer Security (TLS) Extensions" 803 heading. The new certificate type can be used with addtional TLS 804 certificate compression [I-D.ietf-tls-certificate-compression]. 806 EDITOR'S NOTE: The TLS registrations should be discussed and approved 807 by the TLS WG at a later stage. When COSE WG has adopted work on 808 CBOR certificates, it could perhaps be presented in the TLS WG. The 809 TLS WG might e.g. want a separate draft in the TLS WG. 811 +-------+------------------+-------------+---------+ 812 | Value | Name | Recommended | Comment | 813 +=======+==================+=============+=========+ 814 | TBD5 | CBOR Certificate | Y | | 815 +-------+------------------+-------------+---------+ 817 10. References 819 10.1. Normative References 821 [I-D.ietf-cbor-tags-oid] 822 Bormann, C. and S. Leonard, "Concise Binary Object 823 Representation (CBOR) Tags for Object Identifiers", draft- 824 ietf-cbor-tags-oid-03 (work in progress), November 2020. 826 [I-D.ietf-cose-x509] 827 Schaad, J., "CBOR Object Signing and Encryption (COSE): 828 Header parameters for carrying and referencing X.509 829 certificates", draft-ietf-cose-x509-07 (work in progress), 830 September 2020. 832 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 833 Requirement Levels", BCP 14, RFC 2119, 834 DOI 10.17487/RFC2119, March 1997, 835 . 837 [RFC4108] Housley, R., "Using Cryptographic Message Syntax (CMS) to 838 Protect Firmware Packages", RFC 4108, 839 DOI 10.17487/RFC4108, August 2005, 840 . 842 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 843 Housley, R., and W. Polk, "Internet X.509 Public Key 844 Infrastructure Certificate and Certificate Revocation List 845 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 846 . 848 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 849 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 850 October 2013, . 852 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 853 RFC 8152, DOI 10.17487/RFC8152, July 2017, 854 . 856 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 857 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 858 May 2017, . 860 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 861 Definition Language (CDDL): A Notational Convention to 862 Express Concise Binary Object Representation (CBOR) and 863 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 864 June 2019, . 866 [RFC8742] Bormann, C., "Concise Binary Object Representation (CBOR) 867 Sequences", RFC 8742, DOI 10.17487/RFC8742, February 2020, 868 . 870 [SECG] "Elliptic Curve Cryptography, Standards for Efficient 871 Cryptography Group, ver. 2", 2009, 872 . 874 10.2. Informative References 876 [I-D.ietf-lake-edhoc] 877 Selander, G., Mattsson, J., and F. Palombini, "Ephemeral 878 Diffie-Hellman Over COSE (EDHOC)", draft-ietf-lake- 879 edhoc-02 (work in progress), November 2020. 881 [I-D.ietf-tls-certificate-compression] 882 Ghedini, A. and V. Vasiliev, "TLS Certificate 883 Compression", draft-ietf-tls-certificate-compression-10 884 (work in progress), January 2020. 886 [I-D.ietf-tls-ctls] 887 Rescorla, E., Barnes, R., and H. Tschofenig, "Compact TLS 888 1.3", draft-ietf-tls-ctls-01 (work in progress), November 889 2020. 891 [I-D.ietf-tls-dtls13] 892 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 893 Datagram Transport Layer Security (DTLS) Protocol Version 894 1.3", draft-ietf-tls-dtls13-39 (work in progress), 895 November 2020. 897 [I-D.ietf-uta-tls13-iot-profile] 898 Tschofenig, H. and T. Fossati, "TLS/DTLS 1.3 Profiles for 899 the Internet of Things", draft-ietf-uta-tls13-iot- 900 profile-00 (work in progress), June 2020. 902 [IEEE-802.1AR] 903 Institute of Electrical and Electronics Engineers, ., 904 "IEEE Standard for Local and metropolitan area networks- 905 Secure Device Identity", IEEE Standard 802.1AR-2018 , 906 August 2018, 907 . 909 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 910 Constrained-Node Networks", RFC 7228, 911 DOI 10.17487/RFC7228, May 2014, 912 . 914 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 915 Security (TLS) / Datagram Transport Layer Security (DTLS) 916 Profiles for the Internet of Things", RFC 7925, 917 DOI 10.17487/RFC7925, July 2016, 918 . 920 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 921 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 922 . 924 [X.509-IoT] 925 Forsby, F., Furuhed, M., Papadimitratos, P., and S. Raza, 926 "Lightweight X.509 Digital Certificates for the Internet 927 of Things.", Springer, Cham. Lecture Notes of the 928 Institute for Computer Sciences, Social Informatics and 929 Telecommunications Engineering, vol 242., July 2018, 930 . 932 Appendix A. Example CBOR Certificates 934 A.1. Example RFC 7925 profiled X.509 Certificate 936 Example of [RFC7925] profiled X.509 certificate parsed with OpenSSL. 938 Certificate: 939 Data: 940 Version: 3 (0x2) 941 Serial Number: 128269 (0x1f50d) 942 Signature Algorithm: ecdsa-with-SHA256 943 Issuer: CN=RFC test CA 944 Validity 945 Not Before: Jan 1 00:00:00 2020 GMT 946 Not After : Feb 2 00:00:00 2021 GMT 947 Subject: CN=01-23-45-FF-FE-67-89-AB 948 Subject Public Key Info: 949 Public Key Algorithm: id-ecPublicKey 950 Public-Key: (256 bit) 951 pub: 952 04:b1:21:6a:b9:6e:5b:3b:33:40:f5:bd:f0:2e:69: 953 3f:16:21:3a:04:52:5e:d4:44:50:b1:01:9c:2d:fd: 954 38:38:ab:ac:4e:14:d8:6c:09:83:ed:5e:9e:ef:24: 955 48:c6:86:1c:c4:06:54:71:77:e6:02:60:30:d0:51: 956 f7:79:2a:c2:06 957 ASN1 OID: prime256v1 958 NIST CURVE: P-256 959 X509v3 extensions: 960 X509v3 Key Usage: 961 Digital Signature 962 Signature Algorithm: ecdsa-with-SHA256 963 30:44:02:20:44:5d:79:8c:90:e7:f5:00:dc:74:7a:65:4c:ec: 964 6c:fa:6f:03:72:76:e1:4e:52:ed:07:fc:16:29:4c:84:66:0d: 965 02:20:5a:33:98:5d:fb:d4:bf:dd:6d:4a:cf:38:04:c3:d4:6e: 966 bf:3b:7f:a6:26:40:67:4f:c0:35:4f:a0:56:db:ae:a6 968 The DER encoding of the above certificate is 314 bytes. 970 30 82 01 36 30 81 DE A0 03 02 01 02 02 03 01 F5 0D 30 0A 06 08 2A 86 971 48 CE 3D 04 03 02 30 16 31 14 30 12 06 03 55 04 03 0C 0B 52 46 43 20 972 74 65 73 74 20 43 41 30 1E 17 0D 32 30 30 31 30 31 30 30 30 30 30 30 973 5A 17 0D 32 31 30 32 30 32 30 30 30 30 30 30 5A 30 22 31 20 30 1E 06 974 03 55 04 03 0C 17 30 31 2D 32 33 2D 34 35 2D 46 46 2D 46 45 2D 36 37 975 2D 38 39 2D 41 42 30 59 30 13 06 07 2A 86 48 CE 3D 02 01 06 08 2A 86 976 48 CE 3D 03 01 07 03 42 00 04 B1 21 6A B9 6E 5B 3B 33 40 F5 BD F0 2E 977 69 3F 16 21 3A 04 52 5E D4 44 50 B1 01 9C 2D FD 38 38 AB AC 4E 14 D8 978 6C 09 83 ED 5E 9E EF 24 48 C6 86 1C C4 06 54 71 77 E6 02 60 30 D0 51 979 F7 79 2A C2 06 A3 0F 30 0D 30 0B 06 03 55 1D 0F 04 04 03 02 07 80 30 980 0A 06 08 2A 86 48 CE 3D 04 03 02 03 47 00 30 44 02 20 44 5D 79 8C 90 981 E7 F5 00 DC 74 7A 65 4C EC 6C FA 6F 03 72 76 E1 4E 52 ED 07 FC 16 29 982 4C 84 66 0D 02 20 5A 33 98 5D FB D4 BF DD 6D 4A CF 38 04 C3 D4 6E BF 983 3B 7F A6 26 40 67 4F C0 35 4F A0 56 DB AE A6 985 A.1.1. Example CBOR Certificate Encoding 987 The CBOR encoding of the same X.509 certificate is shown below in 988 CBOR diagnostic format. 990 /This defines a CBOR Sequence (RFC 8742):/ 992 1, 993 h'01f50d', 994 "RFC test CA", 995 1577836800, 996 1612224000, 997 h'0123456789AB', 998 1, 999 h'02B1216AB96E5B3B3340F5BDF02E693F16213A04525ED44450 1000 B1019C2DFD3838AB', 1001 1, 1002 6, 1003 h'445D798C90E7F500DC747A654CEC6CFA6F037276E14E52ED07 1004 FC16294C84660D5A33985DFBD4BFDD6D4ACF3804C3D46EBF3B 1005 7FA62640674FC0354FA056DBAEA6 1007 The size of the CBOR encoding (CBOR sequence) is 138 bytes. 1009 01 1010 43 01 F5 0D 1011 6B 52 46 43 20 74 65 73 74 20 43 41 1012 1A 5E 0B E1 00 1013 1A 60 18 96 00 1014 46 01 23 45 67 89 AB 1015 01 1016 58 21 02 B1 21 6A B9 6E 5B 3B 33 40 F5 BD F0 2E 69 3F 16 21 3A 04 52 1017 5E D4 44 50 B1 01 9C 2D FD 38 38 AB 1018 01 1019 06 1020 58 40 44 5D 79 8C 90 E7 F5 00 DC 74 7A 65 4C EC 6C FA 6F 03 72 76 E1 1021 4E 52 ED 07 FC 16 29 4C 84 66 0D 5A 33 98 5D FB D4 BF DD 6D 4A CF 38 1022 04 C3 D4 6E BF 3B 7F A6 26 40 67 4F C0 35 4F A0 56 DB AE A6 1024 A.1.2. Example: Natively Signed CBOR Certificate 1026 The corresponding natively signed CBOR certificate in CBOR diagnostic 1027 format is identical, except for cborCertificateType and 1028 signatureValue. 1030 /This defines a CBOR Sequence (RFC 8742):/ 1032 0, 1033 h'01f50d', 1034 "RFC test CA", 1035 1577836800, 1036 1612224000, 1037 h'0123456789AB', 1038 1, 1039 h'02B1216AB96E5B3B3340F5BDF02E693F16213A04525ED44450 1040 B1019C2DFD3838AB', 1041 1, 1042 6, 1043 h'B27A0B781455F71B68290F6C2EC9A897F18FDE9B6C59575953 1044 BC67268AB0E4DDE99D273E04E4715383AB2257C6AAA35284E5 1045 ED18BDB91247E9F2C433136480B9' 1047 The size of the CBOR encoding (CBOR sequence) is 138 bytes. 1049 00 1050 43 01 F5 0D 1051 6B 52 46 43 20 74 65 73 74 20 43 41 1052 1A 5E 0B E1 00 1053 1A 60 18 96 00 1054 46 01 23 45 67 89 AB 1055 01 1056 58 21 02 B1 21 6A B9 6E 5B 3B 33 40 F5 BD F0 2E 69 3F 16 21 3A 04 52 1057 5E D4 44 50 B1 01 9C 2D FD 38 38 AB 1058 01 1059 06 1060 58 40 B2 7A 0B 78 14 55 F7 1B 68 29 0F 6C 2E C9 A8 97 F1 8F DE 9B 6C 1061 59 57 59 53 BC 67 26 8A B0 E4 DD E9 9D 27 3E 04 E4 71 53 83 AB 22 57 1062 C6 AA A3 52 84 E5 ED 18 BD B9 12 47 E9 F2 C4 33 13 64 80 B9 1064 A.1.3. Example: Key Pair 1066 All of the the above example certificate were signed and can be 1067 verified with the following key pair where the private key is encoded 1068 as in COSE [RFC8152]. 1070 issuerPublicKeyAlgorithm : 1071 1 (id-ecPublicKey + secp256r1) 1073 issuerPublicKey : 1074 h'02AE4CDB01F614DEFC7121285FDC7F5C6D1D42C95647F061BA0080DF678867845E' 1076 issuerPrivateKey : 1077 h'DC66B3415456D649429B53223DF7532B942D6B0E0842C30BCA4C0ACF91547BB2' 1079 A.2. Example HTPPS X.509 Certificate 1081 The DER encoding of the tools.ietf.org certificate is 1647 bytes. 1083 30 82 06 6b 30 82 05 53 a0 03 02 01 02 02 09 00 a6 a5 5c 87 0e 39 b4 1084 0e 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 81 c6 31 0b 30 09 1085 06 03 55 04 06 13 02 55 53 31 10 30 0e 06 03 55 04 08 13 07 41 72 69 1086 7a 6f 6e 61 31 13 30 11 06 03 55 04 07 13 0a 53 63 6f 74 74 73 64 61 1087 6c 65 31 25 30 23 06 03 55 04 0a 13 1c 53 74 61 72 66 69 65 6c 64 20 1088 54 65 63 68 6e 6f 6c 6f 67 69 65 73 2c 20 49 6e 63 2e 31 33 30 31 06 1089 03 55 04 0b 13 2a 68 74 74 70 3a 2f 2f 63 65 72 74 73 2e 73 74 61 72 1090 66 69 65 6c 64 74 65 63 68 2e 63 6f 6d 2f 72 65 70 6f 73 69 74 6f 72 1091 79 2f 31 34 30 32 06 03 55 04 03 13 2b 53 74 61 72 66 69 65 6c 64 20 1092 53 65 63 75 72 65 20 43 65 72 74 69 66 69 63 61 74 65 20 41 75 74 68 1093 6f 72 69 74 79 20 2d 20 47 32 30 1e 17 0d 32 30 31 30 30 31 31 39 33 1094 38 33 36 5a 17 0d 32 31 31 31 30 32 31 39 33 38 33 36 5a 30 3e 31 21 1095 30 1f 06 03 55 04 0b 13 18 44 6f 6d 61 69 6e 20 43 6f 6e 74 72 6f 6c 1096 20 56 61 6c 69 64 61 74 65 64 31 19 30 17 06 03 55 04 03 0c 10 2a 2e 1097 74 6f 6f 6c 73 2e 69 65 74 66 2e 6f 72 67 30 82 01 22 30 0d 06 09 2a 1098 86 48 86 f7 0d 01 01 01 05 00 03 82 01 0f 00 30 82 01 0a 02 82 01 01 1099 00 b1 e1 37 e8 eb 82 d6 89 fa db f5 c2 4b 77 f0 2c 4a de 72 6e 3e 13 1100 60 d1 a8 66 1e c4 ad 3d 32 60 e5 f0 99 b5 f4 7a 7a 48 55 21 ee 0e 39 1101 12 f9 ce 0d ca f5 69 61 c7 04 ed 6e 0f 1d 3b 1e 50 88 79 3a 0e 31 41 1102 16 f1 b1 02 64 68 a5 cd f5 4a 0a ca 99 96 35 08 c3 7e 27 5d d0 a9 cf 1103 f3 e7 28 af 37 d8 b6 7b dd f3 7e ae 6e 97 7f f7 ca 69 4e cc d0 06 df 1104 5d 27 9b 3b 12 e7 e6 fe 08 6b 52 7b 82 11 7c 72 b3 46 eb c1 e8 78 b8 1105 0f cb e1 eb bd 06 44 58 dc 83 50 b2 a0 62 5b dc 81 b8 36 e3 9e 7c 79 1106 b2 a9 53 8a e0 0b c9 4a 2a 13 39 31 13 bd 2c cf a8 70 cf 8c 8d 3d 01 1107 a3 88 ae 12 00 36 1d 1e 24 2b dd 79 d8 53 01 26 ed 28 4f c9 86 94 83 1108 4e c8 e1 14 2e 85 b3 af d4 6e dd 69 46 af 41 25 0e 7a ad 8b f2 92 ca 1109 79 d9 7b 32 4f f7 77 e8 f9 b4 4f 23 5c d4 5c 03 ae d8 ab 3a ca 13 5f 1110 5d 5d 5d a1 02 03 01 00 01 a3 82 02 e1 30 82 02 dd 30 0c 06 03 55 1d 1111 13 01 01 ff 04 02 30 00 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 1112 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 30 0e 06 03 55 1d 0f 1113 01 01 ff 04 04 03 02 05 a0 30 3d 06 03 55 1d 1f 04 36 30 34 30 32 a0 1114 30 a0 2e 86 2c 68 74 74 70 3a 2f 2f 63 72 6c 2e 73 74 61 72 66 69 65 1115 6c 64 74 65 63 68 2e 63 6f 6d 2f 73 66 69 67 32 73 31 2d 32 34 32 2e 1116 63 72 6c 30 63 06 03 55 1d 20 04 5c 30 5a 30 4e 06 0b 60 86 48 01 86 1117 fd 6e 01 07 17 01 30 3f 30 3d 06 08 2b 06 01 05 05 07 02 01 16 31 68 1118 74 74 70 3a 2f 2f 63 65 72 74 69 66 69 63 61 74 65 73 2e 73 74 61 72 1119 66 69 65 6c 64 74 65 63 68 2e 63 6f 6d 2f 72 65 70 6f 73 69 74 6f 72 1120 79 2f 30 08 06 06 67 81 0c 01 02 01 30 81 82 06 08 2b 06 01 05 05 07 1121 01 01 04 76 30 74 30 2a 06 08 2b 06 01 05 05 07 30 01 86 1e 68 74 74 1122 70 3a 2f 2f 6f 63 73 70 2e 73 74 61 72 66 69 65 6c 64 74 65 63 68 2e 1123 63 6f 6d 2f 30 46 06 08 2b 06 01 05 05 07 30 02 86 3a 68 74 74 70 3a 1124 2f 2f 63 65 72 74 69 66 69 63 61 74 65 73 2e 73 74 61 72 66 69 65 6c 1125 64 74 65 63 68 2e 63 6f 6d 2f 72 65 70 6f 73 69 74 6f 72 79 2f 73 66 1126 69 67 32 2e 63 72 74 30 1f 06 03 55 1d 23 04 18 30 16 80 14 25 45 81 1127 68 50 26 38 3d 3b 2d 2c be cd 6a d9 b6 3d b3 66 63 30 2b 06 03 55 1d 1128 11 04 24 30 22 82 10 2a 2e 74 6f 6f 6c 73 2e 69 65 74 66 2e 6f 72 67 1129 82 0e 74 6f 6f 6c 73 2e 69 65 74 66 2e 6f 72 67 30 1d 06 03 55 1d 0e 1130 04 16 04 14 ad 8a b4 1c 07 51 d7 92 89 07 b0 b7 84 62 2f 36 55 7a 5f 1131 4d 30 82 01 06 06 0a 2b 06 01 04 01 d6 79 02 04 02 04 81 f7 04 81 f4 1132 00 f2 00 77 00 f6 5c 94 2f d1 77 30 22 14 54 18 08 30 94 56 8e e3 4d 1133 13 19 33 bf df 0c 2f 20 0b cc 4e f1 64 e3 00 00 01 74 e5 ac 71 13 00 1134 00 04 03 00 48 30 46 02 21 00 8c f5 48 52 ce 56 35 43 39 11 cf 10 cd 1135 b9 1f 52 b3 36 39 22 3a d1 38 a4 1d ec a6 fe de 1f e9 0f 02 21 00 bc 1136 a2 25 43 66 c1 9a 26 91 c4 7a 00 b5 b6 53 ab bd 44 c2 f8 ba ae f4 d2 1137 da f2 52 7c e6 45 49 95 00 77 00 5c dc 43 92 fe e6 ab 45 44 b1 5e 9a 1138 d4 56 e6 10 37 fb d5 fa 47 dc a1 73 94 b2 5e e6 f6 c7 0e ca 00 00 01 1139 74 e5 ac 72 3c 00 00 04 03 00 48 30 46 02 21 00 a5 e0 90 6e 63 e9 1d 1140 4f dd ef ff 03 52 b9 1e 50 89 60 07 56 4b 44 8a 38 28 f5 96 dc 6b 28 1141 72 6d 02 21 00 fc 91 ea ed 02 16 88 66 05 4e e1 8a 2e 53 46 c4 cc 51 1142 fe b3 fa 10 a9 1d 2e db f9 91 25 f8 6c e6 30 0d 06 09 2a 86 48 86 f7 1143 0d 01 01 0b 05 00 03 82 01 01 00 14 04 3f a0 be d2 ee 3f a8 6e 3a 1f 1144 78 8e a0 4c 35 53 0f 11 06 1f ff 60 a1 6d 0b 83 e9 d9 2a db b3 3f 9d 1145 b3 d7 e0 59 4c 19 a8 e4 19 a5 0c a7 70 72 77 63 d5 fe 64 51 0a d2 7a 1146 d6 50 a5 8a 92 38 ec cb 2f 0f 5a c0 64 58 4d 5c 06 b9 73 63 68 27 8b 1147 89 34 dc 79 c7 1d 3a fd 34 5f 83 14 41 58 49 80 68 29 80 39 8a 86 72 1148 69 cc 79 37 ce e3 97 f7 dc f3 95 88 ed 81 03 29 00 d2 a2 c7 ba ab d6 1149 3a 8e ca 09 0b d9 fb 39 26 4b ff 03 d8 8e 2d 3f 6b 21 ca 8a 7d d8 5f 1150 fb 94 ba 83 de 9c fc 15 8d 61 fa 67 2d b0 c7 db 3d 25 0a 41 4a 85 d3 1151 7f 49 46 37 3c f4 b1 75 d0 52 f3 dd c7 66 f1 4b fd aa 00 ed bf e4 7e 1152 ed 01 ec 7b e4 f6 46 fc 31 fd 72 fe 03 d2 f2 65 af 4d 7e e2 81 9b 7a 1153 fd 30 3c f5 52 f4 05 34 a0 8a 3e 19 41 58 c8 a8 e0 51 71 84 09 15 ae 1154 ec a5 77 75 fa 18 f7 d5 77 d5 31 cc c7 2d 1156 A.2.1. Example CBOR Certificate Encoding 1158 The CBOR encoding of the X.509 certificate is shown below in CBOR 1159 diagnostic format. 1161 /This defines a CBOR Sequence (RFC 8742):/ 1163 1, 1164 h'A6A55C870E39B40E', 1165 [ 1166 [-4, "US"], 1167 [-6, "Arizona"], 1168 [-5, "Scottsdale"], 1169 [-7, "Starfield Technologies, Inc."], 1170 [-8, "http://certs.starfieldtech.com/repository/"], 1171 [-1, "Starfield Secure Certificate Authority - G2"] 1172 ], 1173 1601581116, 1174 1635881916, 1175 [ 1176 [-8, "Domain Control Validated"], 1177 [1, "*.tools.ietf.org"] 1178 ], 1179 0, 1180 h'3082010A0282010100B1E137E8EB82D689FADBF5C24B77F02C4ADE726E3E1360D1A8661EC4AD3D3260E5F099B5F47A7A485521EE0E3912F9CE0DCAF56961C704ED6E0F1D3B1E5088793A0E314116F1B1026468A5CDF54A0ACA99963508C37E275DD0A9CFF3E728AF37D8B67BDDF37EAE6E977FF7CA694ECCD006DF5D279B3B12E7E6FE086B527B82117C72B346EBC1E878B80FCBE1EBBD064458DC8350B2A0625BDC81B836E39E7C79B2A9538AE00BC94A2A13393113BD2CCFA870CF8C8D3D01A388AE1200361D1E242BDD79D8530126ED284FC98694834EC8E1142E85B3AFD46EDD6946AF41250E7AAD8BF292CA79D97B324FF777E8F9B44F235CD45C03AED8AB3ACA135F5D5D5DA10203010001', 1181 [ 1182 -1, -2, 1183 3, [ 1, 2 ], 1184 -2, 5, 1185 8, "http://crl.starfieldtech.com/sfig2s1-242.crl", 1186 7, h'305A304E060B6086480186FD6E01071701303F303D06082B060105050702011631687474703A2F2F6365727469666963617465732E737461726669656C64746563682E636F6D2F7265706F7369746F72792F3008060667810C010201', 1187 9, [ 1, "http://ocsp.starfieldtech.com/", 2, "http://certificates.starfieldtech.com/repository/sfig2.crt" ], 1188 5, h'254581685026383D3B2D2CBECD6AD9B63DB36663', 1189 4, [ 2, "*.tools.ietf.org", 2, "tools.ietf.org" ], 1190 6, h'AD8AB41C0751D7928907B0B784622F36557A5F4D', 1191 10, h'0481F400F2007700F65C942FD1773022145418083094568EE34D131933BFDF0C2F200BCC4EF164E300000174E5AC711300000403004830460221008CF54852CE5635433911CF10CDB91F52B33639223AD138A41DECA6FEDE1FE90F022100BCA2254366C19A2691C47A00B5B653ABBD44C2F8BAAEF4D2DAF2527CE64549950077005CDC4392FEE6AB4544B15E9AD456E61037FBD5FA47DCA17394B25EE6F6C70ECA00000174E5AC723C0000040300483046022100A5E0906E63E91D4FDDEFFF0352B91E50896007564B448A3828F596DC6B28726D022100FC91EAED02168866054EE18A2E5346C4CC51FEB3FA10A91D2EDBF99125F86CE6' 1192 ], 1193 1, 1194 h'14043FA0BED2EE3FA86E3A1F788EA04C35530F11061FFF60A16D0B83E9D92ADBB33F9DB3D7E0594C19A8E419A50CA770727763D5FE64510AD27AD650A58A9238ECCB2F0F5AC064584D5C06B9736368278B8934DC79C71D3AFD345F831441584980682980398A867269CC7937CEE397F7DCF39588ED81032900D2A2C7BAABD63A8ECA090BD9FB39264BFF03D88E2D3F6B21CA8A7DD85FFB94BA83DE9CFC158D61FA672DB0C7DB3D250A414A85D37F4946373CF4B175D052F3DDC766F14BFDAA00EDBFE47EED01EC7BE4F646FC31FD72FE03D2F265AF4D7EE2819B7AFD303CF552F40534A08A3E194158C8A8E05171840915AEECA57775FA18F7D577D531CCC72D' 1196 The size of the CBOR encoding (CBOR sequence) is 1332 bytes. 1198 Appendix B. X.509 Certificate Profile, ASN.1 1200 EDITOR'S NOTE: The ASN.1 below is not up to date with the rest of the 1201 specification. The below ASN.1 for RFC 7925 profile should be in 1202 draft-ietf-uta-tls13-iot-profile instead. If CBOR Certificates 1203 support a large subset of RFC 5280, we should probably not duplicate 1204 all the ASN.1 in that document. Should be discussed what kind and 1205 how much (if any) ASN.1 this document needs. If possible, one option 1206 would be to have ASN.1 for the restrictions compared to RFC 5280. 1208 IOTCertificate DEFINITIONS EXPLICIT TAGS ::= BEGIN 1210 Certificate ::= SEQUENCE { 1211 tbsCertificate TBSCertificate, 1212 signatureAlgorithm AlgorithmIdentifier, 1213 signatureValue BIT STRING 1214 } 1216 TBSCertificate ::= SEQUENCE { 1217 version [0] INTEGER {v3(2)}, 1218 serialNumber INTEGER (1..MAX), 1219 signature AlgorithmIdentifier, 1220 issuer Name, 1221 validity Validity, 1222 subject Name, 1223 subjectPublicKeyInfo SubjectPublicKeyInfo, 1224 extensions [3] Extensions OPTIONAL 1225 } 1227 Name ::= SEQUENCE SIZE (1) OF DistinguishedName 1229 DistinguishedName ::= SET SIZE (1) OF CommonName 1231 CommonName ::= SEQUENCE { 1232 type OBJECT IDENTIFIER (id-at-commonName), 1233 value UTF8String 1234 } 1236 Validity ::= SEQUENCE { 1237 notBefore UTCTime, 1238 notAfter UTCTime 1239 } 1241 SubjectPublicKeyInfo ::= SEQUENCE { 1242 algorithm AlgorithmIdentifier, 1243 subjectPublicKey BIT STRING 1244 } 1246 AlgorithmIdentifier ::= SEQUENCE { 1247 algorithm OBJECT IDENTIFIER, 1248 parameters ANY DEFINED BY algorithm OPTIONAL } 1249 } 1251 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension 1253 Extension ::= SEQUENCE { 1254 extnId OBJECT IDENTIFIER, 1255 critical BOOLEAN DEFAULT FALSE, 1256 extnValue OCTET STRING 1257 } 1259 id-at-commonName OBJECT IDENTIFIER ::= 1260 {joint-iso-itu-t(2) ds(5) attributeType(4) 3} 1262 END 1264 Acknowledgments 1266 The authors want to thank Henk Birkholz, Carsten Bormann, Russ 1267 Housley, Olle Johansson, Benjamin Kaduk, Ilari Liusvaara, Laurence 1268 Lundblade, Thomas Peterson, Michael Richardson, Stefan Santesson, Jim 1269 Schaad, Fraser Tweedale, and Rene Struik for reviewing and commenting 1270 on intermediate versions of the draft. 1272 Authors' Addresses 1274 Shahid Raza 1275 RISE AB 1277 Email: shahid.raza@ri.se 1279 Joel Hoeglund 1280 RISE AB 1282 Email: joel.hoglund@ri.se 1284 Goeran Selander 1285 Ericsson AB 1287 Email: goran.selander@ericsson.com 1289 John Preuss Mattsson 1290 Ericsson AB 1292 Email: john.mattsson@ericsson.com 1294 Martin Furuhed 1295 Nexus Group 1297 Email: martin.furuhed@nexusgroup.com