idnits 2.17.1 draft-mattsson-cose-cbor-cert-compress-04.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 8 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 (November 24, 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) -- Looks like a reference, but probably isn't: '1' on line 566 -- Looks like a reference, but probably isn't: '23' on line 692 == Missing Reference: '-24' is mentioned on line 692, but not defined -- Looks like a reference, but probably isn't: '0' on line 1123 -- Looks like a reference, but probably isn't: '3' on line 1130 == Outdated reference: A later version (-08) exists of draft-ietf-cbor-tags-oid-03 ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) == Outdated reference: A later version (-09) exists of draft-ietf-cose-x509-07 == Outdated reference: A later version (-23) exists of draft-ietf-lake-edhoc-02 == Outdated reference: A later version (-43) exists of draft-ietf-tls-dtls13-39 Summary: 3 errors (**), 0 flaws (~~), 6 warnings (==), 5 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: May 28, 2021 G. Selander 6 J. Mattsson 7 Ericsson AB 8 M. Furuhed 9 Nexus Group 10 November 24, 2020 12 CBOR Encoding of X.509 Certificates (CBOR Certificates) 13 draft-mattsson-cose-cbor-cert-compress-04 15 Abstract 17 This document specifies a CBOR encoding of PKIX profiled X.509 18 Certificates. The resulting certificates are called "CBOR 19 certificates". The CBOR encoding supports a large subset of RFC 20 5280, while at the same time producing very small sizes for 21 certificates compatible with RFC 7925. The CBOR encoding can be used 22 to compress DER encoded X.509 certificates and to encode natively 23 signed certificates. When uses to compress DER encoded X.509 24 certificates, the CBOR encoding can in many cases compress RFC 7925 25 profiled certificates with over 50%. The document also specifies COSE 26 headers for CBOR certificates as well as a TLS certificate type for 27 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 May 28, 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. Deployment settings . . . . . . . . . . . . . . . . . . . . . 10 70 6. Expected Certificate Sizes . . . . . . . . . . . . . . . . . 11 71 7. Natively Signed CBOR Certificates . . . . . . . . . . . . . . 11 72 8. Security Considerations . . . . . . . . . . . . . . . . . . . 12 73 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 74 9.1. CBOR Certificate Types Registry . . . . . . . . . . . . . 12 75 9.2. CBOR Attribute Type Registry . . . . . . . . . . . . . . 12 76 9.3. CBOR Extension Type Registry . . . . . . . . . . . . . . 13 77 9.4. CBOR Extended Key Usage Registry . . . . . . . . . . . . 14 78 9.5. CBOR Subject Alternative Name Registry . . . . . . . . . 15 79 9.6. CBOR Certificate Signature Algorithms Registry . . . . . 15 80 9.7. CBOR Certificate Public Key Algorithms Registry . . . . . 16 81 9.8. COSE Header Parameters Registry . . . . . . . . . . . . . 17 82 9.9. TLS Certificate Types Registry . . . . . . . . . . . . . 18 83 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 84 10.1. Normative References . . . . . . . . . . . . . . . . . . 18 85 10.2. Informative References . . . . . . . . . . . . . . . . . 19 86 Appendix A. Example CBOR Certificates . . . . . . . . . . . . . 20 87 A.1. Example RFC 7925 profiled X.509 Certificate . . . . . . . 20 88 A.2. Example HTPPS X.509 Certificate . . . . . . . . . . . . . 23 89 Appendix B. X.509 Certificate Profile, ASN.1 . . . . . . . . . . 26 90 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 28 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 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 encoding 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] specifies a certificate profile for Internet of 128 Things deployments which can be applied for lightweight certificate 129 based authentication with e.g. TLS [RFC8446], DTLS 130 [I-D.ietf-tls-dtls13], COSE [RFC8152], or EDHOC 131 [I-D.ietf-lake-edhoc]. This document specifies a CBOR encoding which 132 can support large parts of [RFC5280] based on [X.509-IoT]. The 133 encoding support all [RFC7925] profiled X.509 certificates. Two 134 variants are defined using the same CBOR encoding and differing only 135 in what is being signed: 137 o CBOR compression of DER encoded X.509 certificates [RFC5280], 138 which can be decompressed into the original DER encoded X.509 139 certificate. 141 o Natively signed CBOR certificates, which further optimizes the 142 performance in constrained environments but is not backwards 143 compatible with [RFC5280], see Section 7. 145 This document specifies COSE headers for use of the CBOR certificates 146 with COSE, see Section 9.8. The document also specifies a TLS 147 certificate type for use of the CBOR certificates with TLS (with or 148 without additional TLS certificate compression), see Section 9.9. 150 2. Notational Conventions 152 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 153 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 154 "OPTIONAL" in this document are to be interpreted as described in BCP 155 14 [RFC2119] [RFC8174] when, and only when, they appear in all 156 capitals, as shown here. 158 This specification makes use of the terminology in [RFC5280], 159 [RFC7049], [RFC7228], and [RFC8610]. 161 3. CBOR Encoding 163 This section specifies the content and encoding for CBOR 164 certificates, with the overall objective to produce a very compact 165 representation supporting large parts of [RFC5280] and everything in 166 [RFC7925]. In the CBOR encoding, static fields are elided, elliptic 167 curve points are compressed, OID are replaced with short integers, 168 time values are compressed, and redundant encoding is removed. 169 Combining these different components reduces the certificate size 170 significantly, which is not possible with general purpose 171 compressions algorithms, see Figure 1. 173 The CBOR certificate can be either a CBOR compressed X.509 174 certificate, in which case the signature is calculated on the DER 175 encoded ASN.1 data in the X.509 certificate, or a natively signed 176 CBOR certificate, in which case the signature is calculated directly 177 on the CBOR encoded data (see Section 7). In both cases the 178 certificate content is adhering to the restrictions given by 179 [RFC5280]. When used as for compression of an existing X.509 180 certificate, the encoding only works on canonical encoded 181 certificates. The encoding is known to work with DER but might work 182 with other canonical encodings. The compression does not work for 183 BER encoded certificates. 185 In the encoding described below the order of elements in arrays are 186 always encoded in the same order as the elements or the corresponding 187 SEQUENCE or SET in the DER encoding. 189 3.1. Message Fields 191 The X.509 fields and their CBOR encodings are listed below. 193 CBOR certificates are defined in terms of DER encoded [RFC5280] X.509 194 certificates: 196 o version. The 'version' field is known (fixed to v3) and is 197 omitted in the CBOR encoding. 199 o serialNumber. The 'serialNumber' INTEGER value field is encoded 200 as the unwrapped CBOR positive bignum (~biguint) 201 'certificateSerialNumber'. Any leading 0x00 byte (to indicate 202 that the number is not negative) is therefore omitted. 204 o signatureAlgorithm. The 'signatureAlgorithm' field is encoded as 205 a CBOR int 'issuerSignatureAlgorithm' (see Section 9.6) or a CBOR 206 OID tag [I-D.ietf-cbor-tags-oid]. Algorithms with parameters are 207 not supported except RSA algorithms that use parameters = NULL. 209 o signature. The 'signature' field is always the same as the 210 'signatureAlgorithm' field and always omitted from the CBOR 211 encoding. 213 o issuer. In the general case, the sequence of 214 'RelativeDistinguishedName' is encoded as CBOR array of CBOR 215 arrays of Attributes, where each Attribute type and value is 216 encoded as a (CBOR int, CBOR text string) pair. Each 217 AttributeType is encoded as a CBOR int (see Figure 3), where the 218 sign is used to represent the character string type; positive for 219 printableString, negative for utf8String. The string types 220 teletexString, universalString, and bmpString are not supported. 221 If Name contains a single Attribute containing an utf8String 222 encoded 'common name' it is encoded as a CBOR text string. If the 223 text string contains an EUI-64 of the form "HH-HH-HH-HH-HH-HH-HH- 224 HH" where 'H' is one of the symbol '0'-'9' or 'A'-'F' it is 225 encoded as a CBOR byte string of length 8 instead. EUI-64 mapped 226 from a 48-bit MAC address (i.e. of the form "HH-HH-HH-FF-FE-HH-HH- 227 HH) is encoded as a CBOR byte string of length 6. 229 o validity. The 'notBefore' and 'notAfter' fields are ASCII string 230 of the form "yymmddHHMMSSZ" for UTCTime and "yyyymmddHHMMSSZ" for 231 GeneralizedTime. They ASCII strings are converted to integers 232 using the following invertible encoding (Horner's method with 233 different bases). 235 n = SS + 61 * (MM + 60 * (HH + 24 * (dd + 32 * (mm + 13 * 236 (yy)yy)))) 237 The integer n is encoded as the unwrapped CBOR positive bignum 238 (~biguint). GeneralizedTime before the year 100 AD is not 239 supported. Decoding can be done by a succession of modulo and 240 subtraction operations. I.e. SS = n mod 61, MM = ((n - SS) / 61) 241 mod 60, etc. 243 o subject. The 'subject' is encoded exactly like issuer. 245 o subjectPublicKeyInfo. The 'algorithm' field is encoded as the 246 CBOR int 'subjectPublicKeyAlgorithm' (see Section 9.7) or a CBOR 247 OID tag [I-D.ietf-cbor-tags-oid] . Algorithms with parameters are 248 not supported except id-ecPublicKey with named curves and the RSA 249 algorithms that use parameters = NULL. For id-ecPublicKey the 250 namedCurve parameter is encoded in the CBOR int. The 251 'subjectPublicKey' BIT STRING value field is encoded as a CBOR 252 byte string. This specification assumes the BIT STRING has zero 253 unused bits and the unused bits byte is omitted. Uncompressed 254 public keys of type id-ecPublicKey are point compressed as defined 255 in Section 2.3.3 of [SECG]. If a DER encoded certificate with a 256 point compressed public key of type id-ecPublicKey is CBOR 257 encoded, the octets 0xfe and 0xfd are used instead of 0x02 and 258 0x03 in the CBOR encoding to represent an even and odd 259 y-coordinate respectively. 261 o extensions. The 'extensions' field is encoded as a CBOR array 262 where each extension is encoded as either a CBOR int (see 263 Section 9.3) followed by an optional CBOR item of any type or a 264 CBOR OID tag [I-D.ietf-cbor-tags-oid] followed by a CBOR bool 265 encoding 'critical' and the DER encoded value of the 'extnValue' 266 encoded as a CBOR byte string. If the array contains exactly two 267 ints and the absolute value of the first int is 2, the array is 268 omitted and the extensions is encoded as a single CBOR int with 269 the absolute value of the second int and the sign of the first 270 int. Extensions are encoded as specified in Section 3.2. The 271 extensions mandated to be supported by [RFC7925] are given special 272 treatment. 274 o signatureValue. The 'signatureValue' BIT STRING value field is 275 encoded as the CBOR byte string issuerSignatureValue. This 276 specification assumes the BIT STRING has zero unused bits and the 277 unused bits byte is omitted. ECDSA signatures are given special 278 treatment. For ECDSA signatures the SEQUENCE and INTEGER type and 279 length fields are omitted and the two INTEGER value fields are 280 padded to the fixed length L = ceil( log2(n) / 8 ), where n is the 281 size of the largest prime-order subgroup. For secp256r1, 282 secp384r1, and secp521r1, L is 32, 48, and 66 respectively. For 283 natively signed CBOR certificates the signatureValue is calculated 284 over the CBOR sequence TBSCertificate. 286 In addition to the above fields present in X.509, the CBOR encoding 287 introduces an additional field: 289 o cborCertificateType. A CBOR int used to indicate the type of CBOR 290 certificate. Currently, type can be a natively signed CBOR 291 certificate (cborCertificateType = 0) or a CBOR compressed X.509 292 v3 certificate (cborCertificateType = 1), see Section 9.1. 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 ; This defines an array, the elements of which are to be used in a CBOR Sequence: 300 CBORCertificate = [ 301 TBSCertificate, 302 issuerSignatureValue : bytes, 303 ] 305 TBSCertificate = ( 306 cborCertificateType : int, 307 certificateSerialNumber : ~biguint, 308 issuerSignatureAlgorithm : Algorithm, 309 issuer : Name, 310 validityNotBefore : ~biguint, 311 validityNotAfter : ~biguint, 312 subject : Name, 313 subjectPublicKeyAlgorithm : Algorithm, 314 subjectPublicKey : bytes, 315 extensions : Extensions, 316 ) 318 Algorithm = int / OID 320 OID = #6.6(bstr) ; tag number 6 is used here, but tag number is TBD 322 Name = [ * [ + Attribute ] ] / text / bytes 324 Attribute = ( 325 attributeType : int, 326 attributeValue : text, 327 ) 329 Extensions = [ * Extension ] / int, 331 Extension = ( 332 extensionID : int / OID, 333 ? critical : bool, ; present if and only if extensionID is an OID 334 extensionValue : any, ; type known from extensionType 335 ) 337 3.2. Encoding of Extensions 339 EDITOR'S NOTE: The current specification encodes many common 340 extensions with a DER encoded byte string. It should be discussed if 341 more or all commonly active extensions should be natively encoded 342 with CBOR. Would a specific CBOR encoding have to be specified for 343 each extension or can a general CBOR encoding that apply to all 344 remaining extensions be specified? 345 This section details the encoding of the 'extensions' field. The 346 'extensions' field is encoded as a CBOR array where each extensionID 347 is encoded as either a CBOR int or a CBOR OID tag. If 'extensionID' 348 is encoded an int (see Section 9.3),the sign is used to encode if the 349 extension is critical and the 'critical' field is omitted. Critical 350 extensions are encoded with a positive sign and non-critical 351 extensions are encoded with a negative sign. 353 The 'extnValue' OCTET STREAM value field is encoded as the CBOR byte 354 string 'extensionValue' except for the extensions specified below. 355 The 'extensionValue' for the extensions mandated to be supported by 356 [RFC7925] are encoded as follows: 358 o basicConstraints. If 'cA' = false then extensionValue = -2, if 359 'cA' = true and 'pathLenConstraint' is not present then 360 extensionValue = -1, and if 'cA' = true and 'pathLenConstraint' is 361 present then extensionValue = pathLenConstraint. 363 o keyUsage. The 'KeyUsage' BIT STRING is interpreted as an unsigned 364 integer n in network byte order and encoded as a CBOR int. 366 o extKeyUsage. extensionValue is encoded as an array of CBOR ints 367 (see Section 9.4) or CBOR OID tags [I-D.ietf-cbor-tags-oid] where 368 each ints or OID tag encodes a key usage purpose. If the array 369 contains a single int, the array is omitted. 371 extensionValue = [ * int / OID ] / int 373 o subjectAltName. extensionValue is encoded as an [ * ( int, any ) ] 374 array where each (int, any) pair encodes a general name (see 375 Section 9.5). If subjectAltName contains exactly one dNSName, the 376 array and the int are omitted and extensionValue is the dNSName 377 encoded as a CBOR text string. 379 3.2.1. Example Encoding of Extensions 381 The examples below use values from Section 9.3, Section 9.4, and 382 Section 9.5: 384 o A critical basicConstraints ('cA' = true) without 385 pathLenConstraint is encoded as the two CBOR ints -1, -1. 387 o A non-critical keyUsage with digitalSignature and keyAgreement 388 asserted is encoded as the two CBOR ints 2, 17 (2^0 + 2^4 = 17). 390 o A non-critical extKeyUsage containing id-kp-codeSigning and id-kp- 391 OCSPSigning is encoded as the CBOR int 3 followed by the CBOR 392 array [ 3, 6 ]. 394 o A non-critical subjectAltName containing only the dNSName 395 example.com is encoded as the CBOR int 4 followed by the CBOR text 396 string "example.com". 398 Thus, the extension field of a certificate containing all of the 399 above extensions in the given order would be encoded as the CBOR 400 array [ -1, -1, 2, 17, 3, [ 3, 6 ], 4, "example.com" ]. 402 4. Compliance Requirements for Constrained IoT 404 For general purpose applications, the normative requirements of 405 [RFC5280] applies. This section describes the mandatory to implement 406 algorithms and OIDs for constrained IoT application; the values of 407 the OIDs including certificate fields and extensions, time format, 408 attributes in distinguished names, etc. 410 TODO: Write this section 412 5. Deployment settings 414 CBOR certificates can be deployed with legacy X.509 certificates and 415 CA infrastructure. In order to verify the signature, the CBOR 416 certificate is used to recreate the original X.509 data structure to 417 be able to verify the signature. 419 For protocols like TLS/DTLS 1.2, where the handshake is sent 420 unencrypted, the actual encoding and compression can be done at 421 different locations depending on the deployment setting. For 422 example, the mapping between CBOR certificate and standard X.509 423 certificate can take place in a 6LoWPAN border gateway which allows 424 the server side to stay unmodified. This case gives the advantage of 425 the low overhead of a CBOR certificate over a constrained wireless 426 links. The conversion to X.509 within an IoT device will incur a 427 computational overhead, however, measured in energy this is 428 negligible compared to the reduced communication overhead. 430 For the setting with constrained server and server-only 431 authentication, the server only needs to be provisioned with the CBOR 432 certificate and does not perform the conversion to X.509. This 433 option is viable when client authentication can be asserted by other 434 means. 436 For protocols like IKEv2, TLS/DTLS 1.3, and EDHOC, where certificates 437 are encrypted, the proposed encoding needs to be done fully end-to- 438 end, through adding the encoding/decoding functionality to the 439 server. 441 6. Expected Certificate Sizes 443 The CBOR encoding of the sample certificate given in Appendix A 444 results in the numbers shown in Figure 1. After [RFC7925] profiling, 445 most duplicated information has been removed, and the remaining text 446 strings are minimal in size. Therefore, the further size reduction 447 reached with general compression mechanisms will be small, mainly 448 corresponding to making the ASN.1 encoding more compact. The zlib 449 number was calculated with zlib-flate. 451 zlib-flate -compress < cert.der > cert.compressed 453 +------------------+--------------+------------+--------------------+ 454 | | RFC 7925 | zlib | CBOR Certificate | 455 +------------------+---------------------------+--------------------+ 456 | Certificate Size | 314 | 295 | 138 | 457 +------------------+--------------+------------+--------------------+ 459 Figure 1: Comparing Sizes of Certificates (bytes) 461 7. Natively Signed CBOR Certificates 463 The difference between CBOR compressed X.509 certificate and natively 464 signed CBOR certificate is that the signature is calculated over the 465 CBOR encoding of the CBOR sequence TBSCertficate rather than the DER 466 encoded ASN.1 data. This removes entirely the need for ASN.1 DER and 467 base64 encoding which reduces the processing in the authenticating 468 devices and avoids known complexities with these encoding. 470 Natively signed CBOR certificates can be applied in devices that are 471 only required to authenticate to natively signed CBOR certificate 472 compatible servers. This is not a major restriction for many IoT 473 deployments, where the parties issuing and verifying certificates can 474 be a restricted ecosystem which not necessarily involves public CAs. 476 CBOR compressed X.509 certificates provides an intermediate step 477 between [RFC7925] profiled X.509 certificates and natively signed 478 CBOR certificates: An implementation of CBOR compressed X.509 479 certificates contains both the CBOR encoding of the X.509 certificate 480 and the signature operations sufficient for natively signed CBOR 481 certificates. 483 The natively signed approach based on DER encoded X.509 certificates 484 described in this document has a lot of benefits. A CA can use 485 existing ASN.1 machinery to create a DER encoded certificate, the DER 486 encoded certificate can then be transformed to CBOR before signing. 488 8. Security Considerations 490 The CBOR profiling of X.509 certificates does not change the security 491 assumptions needed when deploying standard X.509 certificates but 492 decreases the number of fields transmitted, which reduces the risk 493 for implementation errors. 495 Conversion between the certificate formats can be made in constant 496 time to reduce risk of information leakage through side channels. 498 The mechanism in this draft does not reveal any additional 499 information compared to X.509. Because of difference in size, it 500 will be possible to detect that this profile is used. The gateway 501 solution described in Section 5 requires unencrypted certificates and 502 is not recommended. 504 9. IANA Considerations 506 For all items, the 'Reference' field points to this document. 508 9.1. CBOR Certificate Types Registry 510 IANA has created a new registry titled "CBOR Certificate Types" under 511 the new heading "CBOR Certificate". For values in the interval [-24, 512 23] the registration procedure is "IETF Review". For all other 513 values the registration procedure is "Expert Review". The columns of 514 the registry are Value, Description, and Reference, where Value is an 515 integer, and the other columns are text strings. The initial 516 contents of the registry are: 518 +-------+---------------------------------------+ 519 | Value | Description | 520 +=======+=======================================+ 521 | 0 | Natively Signed CBOR Certificate | 522 | 1 | CBOR Compressed X.509 v3 Certificate | 523 +-------+---------------------------------------+ 525 Figure 2: CBOR Certificate Types 527 9.2. CBOR Attribute Type Registry 529 IANA has created a new registry titled "CBOR Attribute Type Registry" 530 under the new heading "CBOR Certificate". The columns of the 531 registry are Value, X.509 Attribute Type, and Reference, where Value 532 is an integer, and the other columns are text strings. Only positive 533 values can be registered. For values in the interval [1, 23] the 534 registration procedure is "IETF Review". For all other values the 535 registration procedure is "Expert Review". The initial contents of 536 the registry are: 538 +-------+---------------------------------------+ 539 | Value | X.509 Attribute Type | 540 +=======+=======================================+ 541 | 1 | id-at-commonName | 542 | 2 | id-at-surname | 543 | 3 | id-at-serialNumber | 544 | 4 | id-at-countryName | 545 | 5 | id-at-localityName | 546 | 6 | id-at-stateOrProvinceName | 547 | 7 | id-at-organizationName | 548 | 8 | id-at-organizationalUnitName | 549 | 9 | id-at-title | 550 | 10 | id-at-givenName | 551 | 11 | id-at-initials | 552 | 12 | id-at-generationQualifier | 553 | 13 | id-at-dnQualifier | 554 | 14 | id-at-pseudonym | 555 | 15 | id-at-organizationIdentifier | 556 +-------+---------------------------------------+ 558 Figure 3: CBOR Attribute Type Registry 560 9.3. CBOR Extension Type Registry 562 IANA has created a new registry titled "CBOR Extension Type Registry" 563 under the new heading "CBOR Certificate". The columns of the 564 registry are Value, X.509 Extension Type, and Reference, where Value 565 is an integer, and the other columns are text strings. Only positive 566 values can be registered. For values in the interval [1, 23] the 567 registration procedure is "IETF Review". For all other values the 568 registration procedure is "Expert Review". The initial contents of 569 the registry are: 571 +-------+-------------------------------------+------------------+ 572 | Value | X.509 Extension Type | extensionValue | 573 +=======+=====================================+==================+ 574 | 1 | id-ce-basicConstraints | int | 575 | 2 | id-ce-keyUsage | int | 576 | 3 | id-ce-extKeyUsage | [] / int | 577 | 4 | id-ce-subjectAltName | [] / text | 578 | 5 | id-ce-authorityKeyIdentifier | bytes | 579 | 6 | id-ce-subjectKeyIdentifier | bytes | 580 | 7 | id-ce-certificatePolicies | bytes | 581 | 8 | id-ce-cRLDistributionPoints | bytes | 582 | 9 | id-pe-authorityInfoAccess | bytes | 583 | 10 | SCT List (1.3.6.1.4.1.11129.2.4.2) | bytes | 584 | 248 | id-ce-nameConstraints | bytes | 585 | 249 | id-ce-policyConstraints | bytes | 586 | 250 | id-ce-inhibitAnyPolicy | bytes | 587 | 251 | id-ce-authorityKeyIdentifier | bytes | 588 | 252 | id-ce-policyMappings | bytes | 589 | 253 | id-ce-issuerAltName | bytes | 590 | 254 | id-ce-subjectDirectoryAttributes | bytes | 591 | 255 | id-ce-freshestCRL | bytes | 592 | 256 | id-pe-subjectInfoAccess | bytes | 593 +-------+-------------------------------------+------------------+ 595 Figure 4: CBOR Extension Type Registry 597 9.4. CBOR Extended Key Usage Registry 599 IANA has created a new registry titled "CBOR Extended Key Usage 600 Registry" under the new heading "CBOR Certificate". The columns of 601 the registry are Value, Extended Key Usage Purpose, and Reference, 602 where Value is an integer, and the other columns are text strings. 603 For values in the interval [-24, 23] the registration procedure is 604 "IETF Review". For all other values the registration procedure is 605 "Expert Review". The initial contents of the registry are: 607 +-------+---------------------------------------+ 608 | Value | Extended Key Usage | 609 +=======+=======================================+ 610 | 0 | anyExtendedKeyUsage | 611 | 1 | id-kp-serverAuth | 612 | 2 | id-kp-clientAuth | 613 | 3 | id-kp-codeSigning | 614 | 4 | id-kp-emailProtection | 615 | 5 | id-kp-timeStamping | 616 | 6 | id-kp-OCSPSigning | 617 +-------+---------------------------------------+ 619 Figure 5: CBOR Extended Key Usage Registry 621 9.5. CBOR Subject Alternative Name Registry 623 IANA has created a new registry titled "CBOR Subject Alternative Name 624 Registry" under the new heading "CBOR Certificate". The columns of 625 the registry are Value, Extended Key Usage Purpose, and Reference, 626 where Value is an integer, and the other columns are text strings. 627 For values in the interval [-24, 23] the registration procedure is 628 "IETF Review". For all other values the registration procedure is 629 "Expert Review". The initial contents of the registry are: 631 +-------+-----------------------------------+------------------+ 632 | Value | Subject Alternative Name | | 633 +=======+===================================+==================+ 634 | 0 | otherName | [ OID, bytes ] | 635 | 1 | rfc822Name | text | 636 | 2 | dNSName | text | 637 | 3 | directoryName | Name | 638 | 4 | uniformResourceIdentifier | text | 639 | 5 | iPAddress | bytes | 640 +-------+-----------------------------------+------------------+ 642 Figure 6: CBOR Subject Alternative Name Registry 644 9.6. CBOR Certificate Signature Algorithms Registry 646 IANA has created a new registry titled "CBOR Certificate Signature 647 Algorithms" under the new heading "CBOR Certificate". For values in 648 the interval [-24, 23] the registration procedure is "IETF Review". 649 For all other values the registration procedure is "Expert Review". 650 The columns of the registry are Value, X.509 Algorithm, and 651 Reference, where Value is an integer, and the other columns are text 652 strings. The initial contents of the registry are: 654 +-------+---------------------------------------+ 655 | Value | X.509 Signature Algorithm | 656 +=======+=======================================+ 657 | 0 | sha1WithRSAEncryption | 658 | 1 | sha256WithRSAEncryption | 659 | 2 | sha384WithRSAEncryption | 660 | 3 | sha512WithRSAEncryption | 661 | 4 | id-RSASSA-PSS-SHAKE128 | 662 | 5 | id-RSASSA-PSS-SHAKE256 | 663 | 6 | ecdsa-with-SHA256 | 664 | 7 | ecdsa-with-SHA384 | 665 | 8 | ecdsa-with-SHA512 | 666 | 9 | id-ecdsa-with-shake128 | 667 | 10 | id-ecdsa-with-shake256 | 668 | 11 | id-Ed25519 | 669 | 12 | id-Ed448 | 670 | 13 | id-alg-hss-lms-hashsig | 671 | 14 | id-alg-xmss | 672 | 15 | id-alg-xmssmt | 673 | 245 | sha224WithRSAEncryption | 674 | 246 | id-rsassa-pkcs1-v1_5-with-sha3-224 | 675 | 247 | id-rsassa-pkcs1-v1_5-with-sha3-256 | 676 | 248 | id-rsassa-pkcs1-v1_5-with-sha3-384 | 677 | 249 | id-rsassa-pkcs1-v1_5-with-sha3-512 | 678 | 250 | ecdsa-with-SHA1 | 679 | 251 | ecdsa-with-SHA224 | 680 | 252 | id-ecdsa-with-sha3-224 | 681 | 253 | id-ecdsa-with-sha3-256 | 682 | 254 | id-ecdsa-with-sha3-384 | 683 | 255 | id-ecdsa-with-sha3-512 | 684 +-------+---------------------------------------+ 686 Figure 7: CBOR Certificate Signature Algorithms 688 9.7. CBOR Certificate Public Key Algorithms Registry 690 IANA has created a new registry titled "CBOR Certificate Public Key 691 Algorithms" under the new heading "CBOR Certificate". For values in 692 the interval [-24, 23] the registration procedure is "IETF Review". 693 For all other values the registration procedure is "Expert Review". 694 The columns of the registry are Value, X.509 Algorithm, and 695 Reference, where Value is an integer, and the other columns are text 696 strings. The initial contents of the registry are: 698 +-------+---------------------------------------+ 699 | Value | X.509 Public Key Algorithm | 700 +=======+=======================================+ 701 | 0 | rsaEncryption | 702 | 1 | id-ecPublicKey + secp256r1 | 703 | 2 | id-ecPublicKey + secp384r1 | 704 | 3 | id-ecPublicKey + secp521r1 | 705 | 4 | id-X25519 | 706 | 5 | id-X448 | 707 | 6 | id-Ed25519 | 708 | 7 | id-Ed448 | 709 | 8 | id-alg-hss-lms-hashsig | 710 | 9 | id-alg-xmss | 711 | 10 | id-alg-xmssmt | 712 +-------+---------------------------------------+ 714 Figure 8: CBOR Certificate Public Key Algorithms 716 9.8. COSE Header Parameters Registry 718 This document registers the following entries in the "COSE Header 719 Parameters" registry under the "CBOR Object Signing and Encryption 720 (COSE)" heading. The formatting and processing are the same as the 721 corresponding x5bag, x5chain, x5t, and x5u defined in 722 [I-D.ietf-cose-x509] except that the certificates are CBOR encoded 723 instead of DER encoded. Note that certificates can also be 724 identified with a 'kid' header parameter by storing 'kid' and the 725 associated bag or chain in a dictionary. 727 +-----------+-------+----------------+---------------------+ 728 | Name | Label | Value Type | Description | 729 +===========+=======+================+=====================+ 730 | c5bag | TBD1 | COSE_X509 | An unordered bag of | 731 | | | | CBOR certificates | 732 +-----------+-------+----------------+---------------------+ 733 | c5chain | TBD2 | COSE_X509 | An ordered chain of | 734 | | | | CBOR certificates | 735 +-----------+-------+----------------+---------------------+ 736 | c5t | TBD3 | COSE_CertHash | Hash of an | 737 | | | | CBOR certificate | 738 +-----------+-------+----------------+---------------------+ 739 | c5u | TBD4 | uri | URI pointing to a | 740 | | | | CBOR certificate | 741 +-----------+-------+----------------+---------------------+ 743 9.9. TLS Certificate Types Registry 745 This document registers the following entry in the "TLS Certificate 746 Types" registry under the "Transport Layer Security (TLS) Extensions" 747 heading. The new certificate type can be used with addtional TLS 748 certificate compression [I-D.ietf-tls-certificate-compression]. 750 EDITOR'S NOTE: The TLS registrations should be discussed and approved 751 by the TLS WG at a later stage. When COSE WG has adopted work on 752 CBOR certificates, it could perhaps be presented in the TLS WG. The 753 TLS WG might e.g. want a separate draft in the TLS WG. 755 +-------+------------------+-------------+---------+ 756 | Value | Name | Recommended | Comment | 757 +=======+==================+=============+=========+ 758 | TBD5 | CBOR Certificate | Y | | 759 +-------+------------------+-------------+---------+ 761 10. References 763 10.1. Normative References 765 [I-D.ietf-cbor-tags-oid] 766 Bormann, C. and S. Leonard, "Concise Binary Object 767 Representation (CBOR) Tags for Object Identifiers", draft- 768 ietf-cbor-tags-oid-03 (work in progress), November 2020. 770 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 771 Requirement Levels", BCP 14, RFC 2119, 772 DOI 10.17487/RFC2119, March 1997, 773 . 775 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 776 Housley, R., and W. Polk, "Internet X.509 Public Key 777 Infrastructure Certificate and Certificate Revocation List 778 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 779 . 781 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 782 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 783 October 2013, . 785 [RFC7925] Tschofenig, H., Ed. and T. Fossati, "Transport Layer 786 Security (TLS) / Datagram Transport Layer Security (DTLS) 787 Profiles for the Internet of Things", RFC 7925, 788 DOI 10.17487/RFC7925, July 2016, 789 . 791 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 792 RFC 8152, DOI 10.17487/RFC8152, July 2017, 793 . 795 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 796 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 797 May 2017, . 799 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 800 Definition Language (CDDL): A Notational Convention to 801 Express Concise Binary Object Representation (CBOR) and 802 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 803 June 2019, . 805 [RFC8742] Bormann, C., "Concise Binary Object Representation (CBOR) 806 Sequences", RFC 8742, DOI 10.17487/RFC8742, February 2020, 807 . 809 10.2. Informative References 811 [I-D.ietf-cose-x509] 812 Schaad, J., "CBOR Object Signing and Encryption (COSE): 813 Header parameters for carrying and referencing X.509 814 certificates", draft-ietf-cose-x509-07 (work in progress), 815 September 2020. 817 [I-D.ietf-lake-edhoc] 818 Selander, G., Mattsson, J., and F. Palombini, "Ephemeral 819 Diffie-Hellman Over COSE (EDHOC)", draft-ietf-lake- 820 edhoc-02 (work in progress), November 2020. 822 [I-D.ietf-tls-certificate-compression] 823 Ghedini, A. and V. Vasiliev, "TLS Certificate 824 Compression", draft-ietf-tls-certificate-compression-10 825 (work in progress), January 2020. 827 [I-D.ietf-tls-dtls13] 828 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 829 Datagram Transport Layer Security (DTLS) Protocol Version 830 1.3", draft-ietf-tls-dtls13-39 (work in progress), 831 November 2020. 833 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 834 Constrained-Node Networks", RFC 7228, 835 DOI 10.17487/RFC7228, May 2014, 836 . 838 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 839 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 840 . 842 [SECG] "Elliptic Curve Cryptography, Standards for Efficient 843 Cryptography Group, ver. 2", 2009, 844 . 846 [X.509-IoT] 847 Forsby, F., Furuhed, M., Papadimitratos, P., and S. Raza, 848 "Lightweight X.509 Digital Certificates for the Internet 849 of Things.", Springer, Cham. Lecture Notes of the 850 Institute for Computer Sciences, Social Informatics and 851 Telecommunications Engineering, vol 242., July 2018, 852 . 854 Appendix A. Example CBOR Certificates 856 A.1. Example RFC 7925 profiled X.509 Certificate 858 Example of [RFC7925] profiled X.509 certificate parsed with OpenSSL. 860 Certificate: 861 Data: 862 Version: 3 (0x2) 863 Serial Number: 128269 (0x1f50d) 864 Signature Algorithm: ecdsa-with-SHA256 865 Issuer: CN=RFC test CA 866 Validity 867 Not Before: Jan 1 00:00:00 2020 GMT 868 Not After : Feb 2 00:00:00 2021 GMT 869 Subject: CN=01-23-45-FF-FE-67-89-AB 870 Subject Public Key Info: 871 Public Key Algorithm: id-ecPublicKey 872 Public-Key: (256 bit) 873 pub: 874 04:ae:4c:db:01:f6:14:de:fc:71:21:28:5f:dc:7f: 875 5c:6d:1d:42:c9:56:47:f0:61:ba:00:80:df:67:88: 876 67:84:5e:e9:a6:9f:d4:89:31:49:da:e3:d3:b1:54: 877 16:d7:53:2c:38:71:52:b8:0b:0d:f3:e1:af:40:8a: 878 95:d3:07:1e:58 879 ASN1 OID: prime256v1 880 NIST CURVE: P-256 881 X509v3 extensions: 882 X509v3 Key Usage: 883 Digital Signature 884 Signature Algorithm: ecdsa-with-SHA256 885 30:44:02:20:37:38:73:ef:87:81:b8:82:97:ef:23:5c:1f:ac: 886 cf:62:da:4e:44:74:0d:c2:a2:e6:a3:c6:c8:82:a3:23:8d:9c: 887 02:20:3a:d9:35:3b:a7:88:68:3b:06:bb:48:fe:ca:16:ea:71: 888 17:17:34:c6:75:c5:33:2b:2a:f1:cb:73:38:10:a1:fc 890 The DER encoding of the above certificate is 314 bytes. 892 30 82 01 36 30 81 DE A0 03 02 01 02 02 03 01 F5 0D 30 0A 06 08 2A 86 48 893 CE 3D 04 03 02 30 16 31 14 30 12 06 03 55 04 03 0C 0B 52 46 43 20 74 65 894 73 74 20 43 41 30 1E 17 0D 32 30 30 31 30 31 30 30 30 30 30 30 5A 17 0D 895 32 31 30 32 30 32 30 30 30 30 30 30 5A 30 22 31 20 30 1E 06 03 55 04 03 896 0C 17 30 31 2D 32 33 2D 34 35 2D 46 46 2D 46 45 2D 36 37 2D 38 39 2D 41 897 42 30 59 30 13 06 07 2A 86 48 CE 3D 02 01 06 08 2A 86 48 CE 3D 03 01 07 898 03 42 00 04 AE 4C DB 01 F6 14 DE FC 71 21 28 5F DC 7F 5C 6D 1D 42 C9 56 899 47 F0 61 BA 00 80 DF 67 88 67 84 5E E9 A6 9F D4 89 31 49 DA E3 D3 B1 54 900 16 D7 53 2C 38 71 52 B8 0B 0D F3 E1 AF 40 8A 95 D3 07 1E 58 A3 0F 30 0D 901 30 0B 06 03 55 1D 0F 04 04 03 02 07 80 30 0A 06 08 2A 86 48 CE 3D 04 03 902 02 03 47 00 30 44 02 20 37 38 73 EF 87 81 B8 82 97 EF 23 5C 1F AC CF 62 903 DA 4E 44 74 0D C2 A2 E6 A3 C6 C8 82 A3 23 8D 9C 02 20 3A D9 35 3B A7 88 904 68 3B 06 BB 48 FE CA 16 EA 71 17 17 34 C6 75 C5 33 2B 2A F1 CB 73 38 10 905 A1 FC 907 A.1.1. Example CBOR Certificate Compression 909 The CBOR certificate compression of the X.509 in CBOR diagnostic 910 format is: 912 /This defines a CBOR Sequence (RFC 8742):/ 914 1, 915 h'01f50d', 916 6, 917 "RFC test CA", 918 h'2B044180', 919 h'2D543300', 920 h'0123456789AB', 921 1, 922 h'02ae4cdb01f614defc7121285fdc7f5c6d1d42c95647f061ba 923 0080df678867845e', 924 1, 925 h'373873EF8781B88297EF235C1FACCF62DA4E44740DC2A2E6A3 926 C6C882A3238D9C3AD9353BA788683B06BB48FECA16EA711717 927 34C675C5332B2AF1CB733810A1FC' 929 The CBOR encoding (CBOR sequence) of the CBOR certificate is 138 930 bytes. 932 01 933 43 01 F5 0D 934 06 935 6B 52 46 43 20 74 65 73 74 20 43 41 936 44 2B 04 41 80 937 44 2D 54 33 00 938 46 01 23 45 67 89 AB 939 01 940 58 21 02 AE 4C DB 01 F6 14 DE FC 71 21 28 5F DC 7F 5C 6D 1D 42 C9 56 47 941 F0 61 BA 00 80 DF 67 88 67 84 5E 942 01 943 58 40 37 38 73 EF 87 81 B8 82 97 EF 23 5C 1F AC CF 62 DA 4E 44 74 0D C2 944 A2 E6 A3 C6 C8 82 A3 23 8D 9C 3A D9 35 3B A7 88 68 3B 06 BB 48 FE CA 16 945 EA 71 17 17 34 C6 75 C5 33 2B 2A F1 CB 73 38 10 A1 FC 947 A.1.2. Example: Natively Signed CBOR Certificate 949 The corresponding natively signed CBOR certificate in CBOR diagnostic 950 format is identical except for type and signatureValue. 952 /This defines a CBOR Sequence (RFC 8742):/ 954 0, 955 h'01f50d', 956 6, 957 "RFC test CA", 958 h'2B044180', 959 h'2D543300', 960 h'0123456789AB', 961 1, 962 h'02ae4cdb01f614defc7121285fdc7f5c6d1d42c95647f061 963 ba0080df678867845e', 964 1, 965 h'7F10A063DA8DB2FD49414440CDF85070AC22A266C7F1DFB1 966 577D9A35A295A8742E794258B76968C097F85542322A0796 967 0199C13CC0220A9BC729EF2ECA638CFE' 969 The CBOR encoding (CBOR sequence) of the CBOR certificate is 138 970 bytes. 972 00 973 43 01 F5 0D 974 06 975 6B 52 46 43 20 74 65 73 74 20 43 41 976 44 2B 04 41 80 977 44 2D 54 33 00 978 46 01 23 45 67 89 AB 979 01 980 58 21 02 AE 4C DB 01 F6 14 DE FC 71 21 28 5F DC 7F 5C 6D 1D 42 C9 56 47 981 F0 61 BA 00 80 DF 67 88 67 84 5E 982 01 983 58 40 7F 10 A0 63 DA 8D B2 FD 49 41 44 40 CD F8 50 70 AC 22 A2 66 C7 F1 984 DF B1 57 7D 9A 35 A2 95 A8 74 2E 79 42 58 B7 69 68 C0 97 F8 55 42 32 2A 985 07 96 01 99 C1 3C C0 22 0A 9B C7 29 EF 2E CA 63 8C FE 987 A.2. Example HTPPS X.509 Certificate 989 The DER encoding of the tools.ietf.org certificate is 1647 bytes. 991 30 82 06 6b 30 82 05 53 a0 03 02 01 02 02 09 00 a6 a5 5c 87 0e 39 b4 0e 992 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 81 c6 31 0b 30 09 06 03 993 55 04 06 13 02 55 53 31 10 30 0e 06 03 55 04 08 13 07 41 72 69 7a 6f 6e 994 61 31 13 30 11 06 03 55 04 07 13 0a 53 63 6f 74 74 73 64 61 6c 65 31 25 995 30 23 06 03 55 04 0a 13 1c 53 74 61 72 66 69 65 6c 64 20 54 65 63 68 6e 996 6f 6c 6f 67 69 65 73 2c 20 49 6e 63 2e 31 33 30 31 06 03 55 04 0b 13 2a 997 68 74 74 70 3a 2f 2f 63 65 72 74 73 2e 73 74 61 72 66 69 65 6c 64 74 65 998 63 68 2e 63 6f 6d 2f 72 65 70 6f 73 69 74 6f 72 79 2f 31 34 30 32 06 03 999 55 04 03 13 2b 53 74 61 72 66 69 65 6c 64 20 53 65 63 75 72 65 20 43 65 1000 72 74 69 66 69 63 61 74 65 20 41 75 74 68 6f 72 69 74 79 20 2d 20 47 32 1001 30 1e 17 0d 32 30 31 30 30 31 31 39 33 38 33 36 5a 17 0d 32 31 31 31 30 1002 32 31 39 33 38 33 36 5a 30 3e 31 21 30 1f 06 03 55 04 0b 13 18 44 6f 6d 1003 61 69 6e 20 43 6f 6e 74 72 6f 6c 20 56 61 6c 69 64 61 74 65 64 31 19 30 1004 17 06 03 55 04 03 0c 10 2a 2e 74 6f 6f 6c 73 2e 69 65 74 66 2e 6f 72 67 1005 30 82 01 22 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 82 01 0f 00 1006 30 82 01 0a 02 82 01 01 00 b1 e1 37 e8 eb 82 d6 89 fa db f5 c2 4b 77 f0 1007 2c 4a de 72 6e 3e 13 60 d1 a8 66 1e c4 ad 3d 32 60 e5 f0 99 b5 f4 7a 7a 1008 48 55 21 ee 0e 39 12 f9 ce 0d ca f5 69 61 c7 04 ed 6e 0f 1d 3b 1e 50 88 1009 79 3a 0e 31 41 16 f1 b1 02 64 68 a5 cd f5 4a 0a ca 99 96 35 08 c3 7e 27 1010 5d d0 a9 cf f3 e7 28 af 37 d8 b6 7b dd f3 7e ae 6e 97 7f f7 ca 69 4e cc 1011 d0 06 df 5d 27 9b 3b 12 e7 e6 fe 08 6b 52 7b 82 11 7c 72 b3 46 eb c1 e8 1012 78 b8 0f cb e1 eb bd 06 44 58 dc 83 50 b2 a0 62 5b dc 81 b8 36 e3 9e 7c 1013 79 b2 a9 53 8a e0 0b c9 4a 2a 13 39 31 13 bd 2c cf a8 70 cf 8c 8d 3d 01 1014 a3 88 ae 12 00 36 1d 1e 24 2b dd 79 d8 53 01 26 ed 28 4f c9 86 94 83 4e 1015 c8 e1 14 2e 85 b3 af d4 6e dd 69 46 af 41 25 0e 7a ad 8b f2 92 ca 79 d9 1016 7b 32 4f f7 77 e8 f9 b4 4f 23 5c d4 5c 03 ae d8 ab 3a ca 13 5f 5d 5d 5d 1017 a1 02 03 01 00 01 a3 82 02 e1 30 82 02 dd 30 0c 06 03 55 1d 13 01 01 ff 1018 04 02 30 00 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 03 1019 01 06 08 2b 06 01 05 05 07 03 02 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 1020 02 05 a0 30 3d 06 03 55 1d 1f 04 36 30 34 30 32 a0 30 a0 2e 86 2c 68 74 1021 74 70 3a 2f 2f 63 72 6c 2e 73 74 61 72 66 69 65 6c 64 74 65 63 68 2e 63 1022 6f 6d 2f 73 66 69 67 32 73 31 2d 32 34 32 2e 63 72 6c 30 63 06 03 55 1d 1023 20 04 5c 30 5a 30 4e 06 0b 60 86 48 01 86 fd 6e 01 07 17 01 30 3f 30 3d 1024 06 08 2b 06 01 05 05 07 02 01 16 31 68 74 74 70 3a 2f 2f 63 65 72 74 69 1025 66 69 63 61 74 65 73 2e 73 74 61 72 66 69 65 6c 64 74 65 63 68 2e 63 6f 1026 6d 2f 72 65 70 6f 73 69 74 6f 72 79 2f 30 08 06 06 67 81 0c 01 02 01 30 1027 81 82 06 08 2b 06 01 05 05 07 01 01 04 76 30 74 30 2a 06 08 2b 06 01 05 1028 05 07 30 01 86 1e 68 74 74 70 3a 2f 2f 6f 63 73 70 2e 73 74 61 72 66 69 1029 65 6c 64 74 65 63 68 2e 63 6f 6d 2f 30 46 06 08 2b 06 01 05 05 07 30 02 1030 86 3a 68 74 74 70 3a 2f 2f 63 65 72 74 69 66 69 63 61 74 65 73 2e 73 74 1031 61 72 66 69 65 6c 64 74 65 63 68 2e 63 6f 6d 2f 72 65 70 6f 73 69 74 6f 1032 72 79 2f 73 66 69 67 32 2e 63 72 74 30 1f 06 03 55 1d 23 04 18 30 16 80 1033 14 25 45 81 68 50 26 38 3d 3b 2d 2c be cd 6a d9 b6 3d b3 66 63 30 2b 06 1034 03 55 1d 11 04 24 30 22 82 10 2a 2e 74 6f 6f 6c 73 2e 69 65 74 66 2e 6f 1035 72 67 82 0e 74 6f 6f 6c 73 2e 69 65 74 66 2e 6f 72 67 30 1d 06 03 55 1d 1036 0e 04 16 04 14 ad 8a b4 1c 07 51 d7 92 89 07 b0 b7 84 62 2f 36 55 7a 5f 1037 4d 30 82 01 06 06 0a 2b 06 01 04 01 d6 79 02 04 02 04 81 f7 04 81 f4 00 1038 f2 00 77 00 f6 5c 94 2f d1 77 30 22 14 54 18 08 30 94 56 8e e3 4d 13 19 1039 33 bf df 0c 2f 20 0b cc 4e f1 64 e3 00 00 01 74 e5 ac 71 13 00 00 04 03 1040 00 48 30 46 02 21 00 8c f5 48 52 ce 56 35 43 39 11 cf 10 cd b9 1f 52 b3 1041 36 39 22 3a d1 38 a4 1d ec a6 fe de 1f e9 0f 02 21 00 bc a2 25 43 66 c1 1042 9a 26 91 c4 7a 00 b5 b6 53 ab bd 44 c2 f8 ba ae f4 d2 da f2 52 7c e6 45 1043 49 95 00 77 00 5c dc 43 92 fe e6 ab 45 44 b1 5e 9a d4 56 e6 10 37 fb d5 1044 fa 47 dc a1 73 94 b2 5e e6 f6 c7 0e ca 00 00 01 74 e5 ac 72 3c 00 00 04 1045 03 00 48 30 46 02 21 00 a5 e0 90 6e 63 e9 1d 4f dd ef ff 03 52 b9 1e 50 1046 89 60 07 56 4b 44 8a 38 28 f5 96 dc 6b 28 72 6d 02 21 00 fc 91 ea ed 02 1047 16 88 66 05 4e e1 8a 2e 53 46 c4 cc 51 fe b3 fa 10 a9 1d 2e db f9 91 25 1048 f8 6c e6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 82 01 01 00 14 1049 04 3f a0 be d2 ee 3f a8 6e 3a 1f 78 8e a0 4c 35 53 0f 11 06 1f ff 60 a1 1050 6d 0b 83 e9 d9 2a db b3 3f 9d b3 d7 e0 59 4c 19 a8 e4 19 a5 0c a7 70 72 1051 77 63 d5 fe 64 51 0a d2 7a d6 50 a5 8a 92 38 ec cb 2f 0f 5a c0 64 58 4d 1052 5c 06 b9 73 63 68 27 8b 89 34 dc 79 c7 1d 3a fd 34 5f 83 14 41 58 49 80 1053 68 29 80 39 8a 86 72 69 cc 79 37 ce e3 97 f7 dc f3 95 88 ed 81 03 29 00 1054 d2 a2 c7 ba ab d6 3a 8e ca 09 0b d9 fb 39 26 4b ff 03 d8 8e 2d 3f 6b 21 1055 ca 8a 7d d8 5f fb 94 ba 83 de 9c fc 15 8d 61 fa 67 2d b0 c7 db 3d 25 0a 1056 41 4a 85 d3 7f 49 46 37 3c f4 b1 75 d0 52 f3 dd c7 66 f1 4b fd aa 00 ed 1057 bf e4 7e ed 01 ec 7b e4 f6 46 fc 31 fd 72 fe 03 d2 f2 65 af 4d 7e e2 81 1058 9b 7a fd 30 3c f5 52 f4 05 34 a0 8a 3e 19 41 58 c8 a8 e0 51 71 84 09 15 1059 ae ec a5 77 75 fa 18 f7 d5 77 d5 31 cc c7 2d 1061 A.2.1. Example CBOR Certificate Compression 1063 The CBOR certificate compression of the X.509 in CBOR diagnostic 1064 format is: 1066 /This defines a CBOR Sequence (RFC 8742):/ 1068 1, 1069 h'A6A55C870E39B40E', 1070 0, 1071 [ 1072 [4, "US"], 1073 [6, "Arizona"], 1074 [5, "Scottsdale"], 1075 [7, "Starfield Technologies, Inc."], 1076 [8, "http://certs.starfieldtech.com/repository/"], 1077 [1, "Starfield Secure Certificate Authority - G2"] 1078 ], 1079 h'2D3EE7F6', 1080 h'2F98B716', 1081 [ 1082 [8, "Domain Control Validated"], 1083 [-1, "*.tools.ietf.org"] 1084 ], 1085 0, 1086 h'3082010A0282010100B1E137E8EB82D689FADBF5C24B77F02C4ADE726E3E1360D1A8661EC4AD3D3260E5F099B5F47A7A485521EE0E3912F9CE0DCAF56961C704ED6E0F1D3B1E5088793A0E314116F1B1026468A5CDF54A0ACA99963508C37E275DD0A9CFF3E728AF37D8B67BDDF37EAE6E977FF7CA694ECCD006DF5D279B3B12E7E6FE086B527B82117C72B346EBC1E878B80FCBE1EBBD064458DC8350B2A0625BDC81B836E39E7C79B2A9538AE00BC94A2A13393113BD2CCFA870CF8C8D3D01A388AE1200361D1E242BDD79D8530126ED284FC98694834EC8E1142E85B3AFD46EDD6946AF41250E7AAD8BF292CA79D97B324FF777E8F9B44F235CD45C03AED8AB3ACA135F5D5D5DA10203010001', 1087 [ 1088 -1, -2, 1089 3, [ 1, 2 ], 1090 -2, 5, 1091 8, h'30343032a030a02e862c687474703a2f2f63726c2e737461726669656c64746563682e636f6d2f736669673273312d3234322e63726c', 1092 7, h'305A304E060B6086480186FD6E01071701303F303D06082B060105050702011631687474703A2F2F6365727469666963617465732E737461726669656C64746563682E636F6D2F7265706F7369746F72792F3008060667810C010201', 1093 9, h'3074302A06082B06010505073001861E687474703A2F2F6F6373702E737461726669656C64746563682E636F6D2F304606082B06010505073002863A687474703A2F2F6365727469666963617465732E737461726669656C64746563682E636F6D2F7265706F7369746F72792F73666967322E637274', 1094 5, h'30168014254581685026383D3B2D2CBECD6AD9B63DB36663', 1095 4, [ 2, "*.tools.ietf.org", 2, "tools.ietf.org" ], 1096 6, h'0414AD8AB41C0751D7928907B0B784622F36557A5F4D', 1097 10, h'0481F400F2007700F65C942FD1773022145418083094568EE34D131933BFDF0C2F200BCC4EF164E300000174E5AC711300000403004830460221008CF54852CE5635433911CF10CDB91F52B33639223AD138A41DECA6FEDE1FE90F022100BCA2254366C19A2691C47A00B5B653ABBD44C2F8BAAEF4D2DAF2527CE64549950077005CDC4392FEE6AB4544B15E9AD456E61037FBD5FA47DCA17394B25EE6F6C70ECA00000174E5AC723C0000040300483046022100A5E0906E63E91D4FDDEFFF0352B91E50896007564B448A3828F596DC6B28726D022100FC91EAED02168866054EE18A2E5346C4CC51FEB3FA10A91D2EDBF99125F86CE6' 1098 ], 1099 h'14043FA0BED2EE3FA86E3A1F788EA04C35530F11061FFF60A16D0B83E9D92ADBB33F9DB3D7E0594C19A8E419A50CA770727763D5FE64510AD27AD650A58A9238ECCB2F0F5AC064584D5C06B9736368278B8934DC79C71D3AFD345F831441584980682980398A867269CC7937CEE397F7DCF39588ED81032900D2A2C7BAABD63A8ECA090BD9FB39264BFF03D88E2D3F6B21CA8A7DD85FFB94BA83DE9CFC158D61FA672DB0C7DB3D250A414A85D37F4946373CF4B175D052F3DDC766F14BFDAA00EDBFE47EED01EC7BE4F646FC31FD72FE03D2F265AF4D7EE2819B7AFD303CF552F40534A08A3E194158C8A8E05171840915AEECA57775FA18F7D577D531CCC72D' 1101 The CBOR encoding (CBOR sequence) of the CBOR certificate is 1374 1102 bytes. 1104 Appendix B. X.509 Certificate Profile, ASN.1 1106 EDITOR'S NOTE: The ASN.1 below is not up to date with the rest of the 1107 specification. The below ASN.1 for RFC 7925 profile should be in 1108 draft-ietf-uta-tls13-iot-profile instead. If CBOR Certificates 1109 support a large subset of RFC 5280, we should probably not duplicate 1110 all the ASN.1 in that document. Should be discussed what kind and 1111 how much (if any) ASN.1 this document needs. If possible, one option 1112 would be to have ASN.1 for the restrictions compared to RFC 5280. 1114 IOTCertificate DEFINITIONS EXPLICIT TAGS ::= BEGIN 1116 Certificate ::= SEQUENCE { 1117 tbsCertificate TBSCertificate, 1118 signatureAlgorithm AlgorithmIdentifier, 1119 signatureValue BIT STRING 1120 } 1122 TBSCertificate ::= SEQUENCE { 1123 version [0] INTEGER {v3(2)}, 1124 serialNumber INTEGER (1..MAX), 1125 signature AlgorithmIdentifier, 1126 issuer Name, 1127 validity Validity, 1128 subject Name, 1129 subjectPublicKeyInfo SubjectPublicKeyInfo, 1130 extensions [3] Extensions OPTIONAL 1131 } 1133 Name ::= SEQUENCE SIZE (1) OF DistinguishedName 1135 DistinguishedName ::= SET SIZE (1) OF CommonName 1137 CommonName ::= SEQUENCE { 1138 type OBJECT IDENTIFIER (id-at-commonName), 1139 value UTF8String 1140 } 1142 Validity ::= SEQUENCE { 1143 notBefore UTCTime, 1144 notAfter UTCTime 1145 } 1147 SubjectPublicKeyInfo ::= SEQUENCE { 1148 algorithm AlgorithmIdentifier, 1149 subjectPublicKey BIT STRING 1150 } 1152 AlgorithmIdentifier ::= SEQUENCE { 1153 algorithm OBJECT IDENTIFIER, 1154 parameters ANY DEFINED BY algorithm OPTIONAL } 1155 } 1157 Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension 1159 Extension ::= SEQUENCE { 1160 extnId OBJECT IDENTIFIER, 1161 critical BOOLEAN DEFAULT FALSE, 1162 extnValue OCTET STRING 1163 } 1165 id-at-commonName OBJECT IDENTIFIER ::= 1166 {joint-iso-itu-t(2) ds(5) attributeType(4) 3} 1168 END 1170 Acknowledgments 1172 The authors want to thank Henk Birkholz, Carsten Bormann, Russ 1173 Housley, Olle Johansson, Benjamin Kaduk, Ilari Liusvaara, Laurence 1174 Lundblade, Thomas Peterson, Michael Richardson, Stefan Santesson, Jim 1175 Schaad, Fraser Tweedale, and Rene Struik for reviewing and commenting 1176 on intermediate versions of the draft. 1178 Authors' Addresses 1180 Shahid Raza 1181 RISE AB 1183 Email: shahid.raza@ri.se 1185 Joel Hoeglund 1186 RISE AB 1188 Email: joel.hoglund@ri.se 1190 Goeran Selander 1191 Ericsson AB 1193 Email: goran.selander@ericsson.com 1195 John Preuss Mattsson 1196 Ericsson AB 1198 Email: john.mattsson@ericsson.com 1200 Martin Furuhed 1201 Nexus Group 1203 Email: martin.furuhed@nexusgroup.com