You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-cose-cbor-encoded-cert.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -258,7 +258,7 @@ This document also specifies C509 Certification Requests; see {{CSR}}. It furthe
258
258
259
259
{::boilerplate bcp14-tagged}
260
260
261
-
This specification makes use of the terminology in {{RFC2986}}, {{RFC5280}}, {{RFC7228}}, {{RFC8610}}, and {{RFC8949}}. When referring to CBOR, this specification always refers to Deterministically Encoded CBOR as specified in {{Sections 4.2.1 and 4.2.2 of RFC8949}}.
261
+
This specification makes use of the terminology in {{RFC2986}}, {{RFC5280}}, {{RFC7228}}, {{RFC8610}}, and {{RFC8949}}. Unless otherwise specified, when referring to CBOR this specification always refers to Deterministically Encoded CBOR as specified in {{Sections 4.2.1 and 4.2.2 of RFC8949}}.
262
262
263
263
# C509 Certificate {#certificate}
264
264
@@ -332,11 +332,12 @@ C509 certificates are defined in terms of DER-encoded X.509 certificates {{RFC52
332
332
333
333
The 'version' field is encoded in the 'c509CertificateType' CBOR int. The field 'c509CertificateType' also indicates the type of the C509 certificate. Two types are defined in this document: natively signed C509 certificates, following X.509 v3 (c509CertificateType = 2); and CBOR re-encoded X.509 v3 DER certificate (c509CertificateType = 3), see {{type}}. The number of elements in TBSCertificate is fixed and determined by the type. Additional types may be added in the future.
334
334
335
-
### certificateSerialNumber
335
+
### certificateSerialNumber {#csn}
336
336
337
-
The 'certificateSerialNumber' INTEGER value field is encoded as the unwrapped CBOR unsigned bignum (~biguint) 'CertificateSerialNumber'. Any leading 0x00 byte is therefore omitted.
338
-
(As the numbers encoded this way are unsigned, there is no need to prepend a 00 byte to avoid a leading one bit being interpreted as the sign of a negative number.)
339
-
Serial numbers are always encoded as CBOR byte string even if the number can fit in a CBOR integer. This deviates from deterministic CBOR encoding {{RFC8949}}.
337
+
The 'certificateSerialNumber' positive INTEGER value field is encoded as the unwrapped CBOR unsigned bignum (~biguint) 'CertificateSerialNumber'.
338
+
Leading 0x00 bytes are omitted following the preferred serialization as specified in {{Section 3.4.3 of RFC8949}}.
339
+
Serial numbers are always encoded as CBOR byte string even if the number can fit in an ordinary CBOR unsigned integer.
340
+
This deviates from the preferred serialization of integers as specified in {{Section 3.4.3 of RFC8949}}, but provides an alternative deterministic encoding.
340
341
When converting back to X.509 format, in case ofC509Certificate type 3 or C509CertificationRequest type 3, if the highest bit in first byte is set, the leading 0x00 byte is put back to prepend to the byte string.
341
342
342
343
### signature
@@ -760,6 +761,8 @@ Where both a specific and a generic CBOR encoding are supported, the specific CB
760
761
761
762
Native C509 certificates MUST use only specific CBOR-encoded fields. However, when decoding non-native C509 certificates, the decoder may need to support, for example, the (extensionID: ~oid, extensionValue: bytes / [bytes]) encoding of an extension for which an (extensionID: int, extensionValue: Defined) encoding exists. One reason is that the certificate might have been issued before the specific CBOR extension was registered.
762
763
764
+
One specific case of deterministic but non-preferred serialization is CertificateSerialNumber, where byte string encoding is used also for small unsigned integers, see {{csn}}.
765
+
763
766
## C509 Name in TLS and DTLS
764
767
765
768
In TLS and DTLS, the subject of a trusted authority may be sent to the peer to help it select the certificate chain, as in the CertificateAuthoritiesExtension in {{RFC8446}}, in the certificate_authorities field of CertificateRequest in {{RFC5246}}, or in the TrustedAuthorities in {{RFC6066}}. For such usage in TLS and DTLS, the C509 name is wrapped in a distinguished name {{X.501}} with exactly one RelativeDistinguishedName, which in turn contains exactly one AttributeTypeAndValue with the attribute C509Name. The attribute value is the raw byte string of the encoded C509 Name as specified in {{subject}}.
0 commit comments