draft-ietf-ace-cbor-web-token-15.txt | rfc8392.txt | |||
---|---|---|---|---|
ACE Working Group M. Jones | Internet Engineering Task Force (IETF) M. Jones | |||
Internet-Draft Microsoft | Request for Comments: 8392 Microsoft | |||
Intended status: Standards Track E. Wahlstroem | Category: Standards Track E. Wahlstroem | |||
Expires: September 20, 2018 | ISSN: 2070-1721 | |||
S. Erdtman | S. Erdtman | |||
Spotify AB | Spotify AB | |||
H. Tschofenig | H. Tschofenig | |||
ARM Ltd. | ARM Ltd. | |||
March 19, 2018 | May 2018 | |||
CBOR Web Token (CWT) | CBOR Web Token (CWT) | |||
draft-ietf-ace-cbor-web-token-15 | ||||
Abstract | Abstract | |||
CBOR Web Token (CWT) is a compact means of representing claims to be | CBOR Web Token (CWT) is a compact means of representing claims to be | |||
transferred between two parties. The claims in a CWT are encoded in | transferred between two parties. The claims in a CWT are encoded in | |||
the Concise Binary Object Representation (CBOR) and CBOR Object | the Concise Binary Object Representation (CBOR), and CBOR Object | |||
Signing and Encryption (COSE) is used for added application layer | Signing and Encryption (COSE) is used for added application-layer | |||
security protection. A claim is a piece of information asserted | security protection. A claim is a piece of information asserted | |||
about a subject and is represented as a name/value pair consisting of | about a subject and is represented as a name/value pair consisting of | |||
a claim name and a claim value. CWT is derived from JSON Web Token | a claim name and a claim value. CWT is derived from JSON Web Token | |||
(JWT) but uses CBOR rather than JSON. | (JWT) but uses CBOR rather than JSON. | |||
Status of This Memo | Status of This Memo | |||
This Internet-Draft is submitted in full conformance with the | This is an Internet Standards Track document. | |||
provisions of BCP 78 and BCP 79. | ||||
Internet-Drafts are working documents of the Internet Engineering | ||||
Task Force (IETF). Note that other groups may also distribute | ||||
working documents as Internet-Drafts. The list of current Internet- | ||||
Drafts is at https://datatracker.ietf.org/drafts/current/. | ||||
Internet-Drafts are draft documents valid for a maximum of six months | This document is a product of the Internet Engineering Task Force | |||
and may be updated, replaced, or obsoleted by other documents at any | (IETF). It represents the consensus of the IETF community. It has | |||
time. It is inappropriate to use Internet-Drafts as reference | received public review and has been approved for publication by the | |||
material or to cite them other than as "work in progress." | Internet Engineering Steering Group (IESG). Further information on | |||
Internet Standards is available in Section 2 of RFC 7841. | ||||
This Internet-Draft will expire on September 20, 2018. | Information about the current status of this document, any errata, | |||
and how to provide feedback on it may be obtained at | ||||
https://www.rfc-editor.org/info/rfc8392. | ||||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2018 IETF Trust and the persons identified as the | Copyright (c) 2018 IETF Trust and the persons identified as the | |||
document authors. All rights reserved. | document authors. All rights reserved. | |||
This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
(https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
publication of this document. Please review these documents | publication of this document. Please review these documents | |||
carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
described in the Simplified BSD License. | described in the Simplified BSD License. | |||
Table of Contents | Table of Contents | |||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
1.1. CBOR Related Terminology . . . . . . . . . . . . . . . . 3 | 1.1. CBOR-Related Terminology . . . . . . . . . . . . . . . . 4 | |||
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
3. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 | 3. Claims . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
3.1. Registered Claims . . . . . . . . . . . . . . . . . . . . 5 | 3.1. Registered Claims . . . . . . . . . . . . . . . . . . . . 5 | |||
3.1.1. iss (Issuer) Claim . . . . . . . . . . . . . . . . . 5 | 3.1.1. iss (Issuer) Claim . . . . . . . . . . . . . . . . . 5 | |||
3.1.2. sub (Subject) Claim . . . . . . . . . . . . . . . . . 5 | 3.1.2. sub (Subject) Claim . . . . . . . . . . . . . . . . . 6 | |||
3.1.3. aud (Audience) Claim . . . . . . . . . . . . . . . . 5 | 3.1.3. aud (Audience) Claim . . . . . . . . . . . . . . . . 6 | |||
3.1.4. exp (Expiration Time) Claim . . . . . . . . . . . . . 5 | 3.1.4. exp (Expiration Time) Claim . . . . . . . . . . . . . 6 | |||
3.1.5. nbf (Not Before) Claim . . . . . . . . . . . . . . . 5 | 3.1.5. nbf (Not Before) Claim . . . . . . . . . . . . . . . 6 | |||
3.1.6. iat (Issued At) Claim . . . . . . . . . . . . . . . . 6 | 3.1.6. iat (Issued At) Claim . . . . . . . . . . . . . . . . 6 | |||
3.1.7. cti (CWT ID) Claim . . . . . . . . . . . . . . . . . 6 | 3.1.7. cti (CWT ID) Claim . . . . . . . . . . . . . . . . . 6 | |||
4. Summary of the claim names, keys, and value types . . . . . . 6 | 4. Summary of the Claim Names, Keys, and Value Types . . . . . . 7 | |||
5. CBOR Tags and Claim Values . . . . . . . . . . . . . . . . . 6 | 5. CBOR Tags and Claim Values . . . . . . . . . . . . . . . . . 7 | |||
6. CWT CBOR Tag . . . . . . . . . . . . . . . . . . . . . . . . 6 | 6. CWT CBOR Tag . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
7. Creating and Validating CWTs . . . . . . . . . . . . . . . . 7 | 7. Creating and Validating CWTs . . . . . . . . . . . . . . . . 8 | |||
7.1. Creating a CWT . . . . . . . . . . . . . . . . . . . . . 7 | 7.1. Creating a CWT . . . . . . . . . . . . . . . . . . . . . 8 | |||
7.2. Validating a CWT . . . . . . . . . . . . . . . . . . . . 8 | 7.2. Validating a CWT . . . . . . . . . . . . . . . . . . . . 9 | |||
8. Security Considerations . . . . . . . . . . . . . . . . . . . 9 | 8. Security Considerations . . . . . . . . . . . . . . . . . . . 10 | |||
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 | 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 | |||
9.1. CBOR Web Token (CWT) Claims Registry . . . . . . . . . . 10 | 9.1. CBOR Web Token (CWT) Claims Registry . . . . . . . . . . 11 | |||
9.1.1. Registration Template . . . . . . . . . . . . . . . . 11 | 9.1.1. Registration Template . . . . . . . . . . . . . . . . 12 | |||
9.1.2. Initial Registry Contents . . . . . . . . . . . . . . 11 | 9.1.2. Initial Registry Contents . . . . . . . . . . . . . . 12 | |||
9.2. Media Type Registration . . . . . . . . . . . . . . . . . 13 | 9.2. Media Type Registration . . . . . . . . . . . . . . . . . 14 | |||
9.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 13 | 9.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 14 | |||
9.3. CoAP Content-Formats Registration . . . . . . . . . . . . 14 | 9.3. CoAP Content-Formats Registration . . . . . . . . . . . . 14 | |||
9.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 14 | 9.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 15 | |||
9.4. CBOR Tag registration . . . . . . . . . . . . . . . . . . 14 | 9.4. CBOR Tag registration . . . . . . . . . . . . . . . . . . 15 | |||
9.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 14 | 9.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 15 | |||
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 | 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 | |||
10.1. Normative References . . . . . . . . . . . . . . . . . . 14 | 10.1. Normative References . . . . . . . . . . . . . . . . . . 15 | |||
10.2. Informative References . . . . . . . . . . . . . . . . . 15 | 10.2. Informative References . . . . . . . . . . . . . . . . . 16 | |||
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 16 | Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 17 | |||
A.1. Example CWT Claims Set . . . . . . . . . . . . . . . . . 16 | A.1. Example CWT Claims Set . . . . . . . . . . . . . . . . . 17 | |||
A.2. Example keys . . . . . . . . . . . . . . . . . . . . . . 16 | A.2. Example Keys . . . . . . . . . . . . . . . . . . . . . . 17 | |||
A.2.1. 128-bit Symmetric Key . . . . . . . . . . . . . . . . 17 | A.2.1. 128-Bit Symmetric Key . . . . . . . . . . . . . . . . 18 | |||
A.2.2. 256-bit Symmetric Key . . . . . . . . . . . . . . . . 17 | A.2.2. 256-Bit Symmetric Key . . . . . . . . . . . . . . . . 18 | |||
A.2.3. ECDSA P-256 256-bit COSE Key . . . . . . . . . . . . 17 | A.2.3. Elliptic Curve Digital Signature Algorithm (ECDSA) | |||
A.3. Example Signed CWT . . . . . . . . . . . . . . . . . . . 18 | P-256 256-Bit COSE Key . . . . . . . . . . . . . . . 19 | |||
A.4. Example MACed CWT . . . . . . . . . . . . . . . . . . . . 19 | A.3. Example Signed CWT . . . . . . . . . . . . . . . . . . . 19 | |||
A.5. Example Encrypted CWT . . . . . . . . . . . . . . . . . . 20 | A.4. Example MACed CWT . . . . . . . . . . . . . . . . . . . . 20 | |||
A.6. Example Nested CWT . . . . . . . . . . . . . . . . . . . 21 | A.5. Example Encrypted CWT . . . . . . . . . . . . . . . . . . 21 | |||
A.7. Example MACed CWT with a floating-point value . . . . . . 22 | A.6. Example Nested CWT . . . . . . . . . . . . . . . . . . . 22 | |||
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 23 | A.7. Example MACed CWT with a Floating-Point Value . . . . . . 23 | |||
Appendix C. Document History . . . . . . . . . . . . . . . . . . 23 | Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 24 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 25 | |||
1. Introduction | 1. Introduction | |||
The JSON Web Token (JWT) [RFC7519] is a standardized security token | The JSON Web Token (JWT) [RFC7519] is a standardized security token | |||
format that has found use in OAuth 2.0 and OpenID Connect | format that has found use in OAuth 2.0 and OpenID Connect | |||
deployments, among other applications. JWT uses JSON Web Signature | deployments, among other applications. JWT uses JSON Web Signature | |||
(JWS) [RFC7515] and JSON Web Encryption (JWE) [RFC7516] to secure the | (JWS) [RFC7515] and JSON Web Encryption (JWE) [RFC7516] to secure the | |||
contents of the JWT, which is a set of claims represented in JSON. | contents of the JWT, which is a set of claims represented in JSON. | |||
The use of JSON for encoding information is popular for Web and | The use of JSON for encoding information is popular for Web and | |||
native applications, but it is considered inefficient for some | native applications, but it is considered inefficient for some | |||
Internet of Things (IoT) systems that use low power radio | Internet of Things (IoT) systems that use low-power radio | |||
technologies. | technologies. | |||
An alternative encoding of claims is defined in this document. | An alternative encoding of claims is defined in this document. | |||
Instead of using JSON, as provided by JWTs, this specification uses | Instead of using JSON, as provided by JWTs, this specification uses | |||
CBOR [RFC7049] and calls this new structure "CBOR Web Token (CWT)", | CBOR [RFC7049] and calls this new structure "CBOR Web Token (CWT)", | |||
which is a compact means of representing secured claims to be | which is a compact means of representing secured claims to be | |||
transferred between two parties. CWT is closely related to JWT. It | transferred between two parties. CWT is closely related to JWT. It | |||
references the JWT claims and both its name and pronunciation are | references the JWT claims and both its name and pronunciation are | |||
derived from JWT. To protect the claims contained in CWTs, the CBOR | derived from JWT (the suggested pronunciation of CWT is the same as | |||
Object Signing and Encryption (COSE) [RFC8152] specification is used. | the English word "cot"). To protect the claims contained in CWTs, | |||
the CBOR Object Signing and Encryption (COSE) [RFC8152] specification | ||||
The suggested pronunciation of CWT is the same as the English word | is used. | |||
"cot". | ||||
1.1. CBOR Related Terminology | 1.1. CBOR-Related Terminology | |||
In JSON, maps are called objects and only have one kind of map key: a | In JSON, maps are called objects and only have one kind of map key: a | |||
string. CBOR uses strings, negative integers, and unsigned integers | string. CBOR uses strings, negative integers, and unsigned integers | |||
as map keys. The integers are used for compactness of encoding and | as map keys. The integers are used for compactness of encoding and | |||
easy comparison. The inclusion of strings allows for an additional | easy comparison. The inclusion of strings allows for an additional | |||
range of short encoded values to be used. | range of short encoded values to be used. | |||
2. Terminology | 2. Terminology | |||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
"OPTIONAL" in this document are to be interpreted as described in BCP | "OPTIONAL" in this document are to be interpreted as described in | |||
14 [RFC2119] [RFC8174] when, and only when, they appear in all | BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
capitals, as shown here. | capitals, as shown here. | |||
This document reuses terminology from JWT [RFC7519] and COSE | This document reuses terminology from JWT [RFC7519] and COSE | |||
[RFC8152]. | [RFC8152]. | |||
StringOrURI | StringOrURI | |||
The "StringOrURI" term in this specification has the same meaning | The "StringOrURI" term in this specification has the same meaning | |||
and processing rules as the JWT "StringOrURI" term defined in | and processing rules as the JWT "StringOrURI" term defined in | |||
Section 2 of [RFC7519], except that it is represented as a CBOR | Section 2 of [RFC7519], except that it is represented as a CBOR | |||
text string instead of a JSON text string. | text string instead of a JSON text string. | |||
skipping to change at page 5, line 8 ¶ | skipping to change at page 5, line 41 ¶ | |||
the absence of such requirements, all claims that are not understood | the absence of such requirements, all claims that are not understood | |||
by implementations MUST be ignored. | by implementations MUST be ignored. | |||
To keep CWTs as small as possible, the Claim Keys are represented | To keep CWTs as small as possible, the Claim Keys are represented | |||
using integers or text strings. Section 4 summarizes all keys used | using integers or text strings. Section 4 summarizes all keys used | |||
to identify the claims defined in this document. | to identify the claims defined in this document. | |||
3.1. Registered Claims | 3.1. Registered Claims | |||
None of the claims defined below are intended to be mandatory to use | None of the claims defined below are intended to be mandatory to use | |||
or implement. They rather provide a starting point for a set of | or implement. Rather, they provide a starting point for a set of | |||
useful, interoperable claims. Applications using CWTs should define | useful, interoperable claims. Applications using CWTs should define | |||
which specific claims they use and when they are required or | which specific claims they use and when they are required or | |||
optional. | optional. | |||
3.1.1. iss (Issuer) Claim | 3.1.1. iss (Issuer) Claim | |||
The "iss" (issuer) claim has the same meaning and processing rules as | The "iss" (issuer) claim has the same meaning and processing rules as | |||
the "iss" claim defined in Section 4.1.1 of [RFC7519], except that | the "iss" claim defined in Section 4.1.1 of [RFC7519], except that | |||
the value is a StringOrURI, as defined in Section 2 of this | the value is a StringOrURI, as defined in Section 2 of this | |||
specification. The Claim Key 1 is used to identify this claim. | specification. The Claim Key 1 is used to identify this claim. | |||
skipping to change at page 6, line 19 ¶ | skipping to change at page 7, line 5 ¶ | |||
the value is a NumericDate, as defined in Section 2 of this | the value is a NumericDate, as defined in Section 2 of this | |||
specification. The Claim Key 6 is used to identify this claim. | specification. The Claim Key 6 is used to identify this claim. | |||
3.1.7. cti (CWT ID) Claim | 3.1.7. cti (CWT ID) Claim | |||
The "cti" (CWT ID) claim has the same meaning and processing rules as | The "cti" (CWT ID) claim has the same meaning and processing rules as | |||
the "jti" claim defined in Section 4.1.7 of [RFC7519], except that | the "jti" claim defined in Section 4.1.7 of [RFC7519], except that | |||
the value is a byte string. The Claim Key 7 is used to identify this | the value is a byte string. The Claim Key 7 is used to identify this | |||
claim. | claim. | |||
4. Summary of the claim names, keys, and value types | 4. Summary of the Claim Names, Keys, and Value Types | |||
+------+-----+----------------------------------+ | +------+-----+----------------------------------+ | |||
| Name | Key | Value type | | | Name | Key | Value Type | | |||
+------+-----+----------------------------------+ | +------+-----+----------------------------------+ | |||
| iss | 1 | text string | | | iss | 1 | text string | | |||
| sub | 2 | text string | | | sub | 2 | text string | | |||
| aud | 3 | text string | | | aud | 3 | text string | | |||
| exp | 4 | integer or floating-point number | | | exp | 4 | integer or floating-point number | | |||
| nbf | 5 | integer or floating-point number | | | nbf | 5 | integer or floating-point number | | |||
| iat | 6 | integer or floating-point number | | | iat | 6 | integer or floating-point number | | |||
| cti | 7 | byte string | | | cti | 7 | byte string | | |||
+------+-----+----------------------------------+ | +------+-----+----------------------------------+ | |||
Table 1: Summary of the claim names, keys, and value types | Table 1: Summary of the Claim Names, Keys, and Value Types | |||
5. CBOR Tags and Claim Values | 5. CBOR Tags and Claim Values | |||
The claim values defined in this specification MUST NOT be prefixed | The claim values defined in this specification MUST NOT be prefixed | |||
with any CBOR tag. For instance, while CBOR tag 1 (epoch-based date/ | with any CBOR tag. For instance, while CBOR tag 1 (epoch-based date/ | |||
time) could logically be prefixed to values of the "exp", "nbf", and | time) could logically be prefixed to values of the "exp", "nbf", and | |||
"iat" claims, this is unnecessary, since the representation of the | "iat" claims, this is unnecessary since the representation of the | |||
claim values is already specified by the claim definitions. Tagging | claim values is already specified by the claim definitions. Tagging | |||
claim values would only take up extra space without adding | claim values would only take up extra space without adding | |||
information. However, this does not prohibit future claim | information. However, this does not prohibit future claim | |||
definitions from requiring the use of CBOR tags for those specific | definitions from requiring the use of CBOR tags for those specific | |||
claims. | claims. | |||
6. CWT CBOR Tag | 6. CWT CBOR Tag | |||
How to determine that a CBOR data structure is a CWT is application- | How to determine that a CBOR data structure is a CWT is application | |||
dependent. In some cases, this information is known from the | dependent. In some cases, this information is known from the | |||
application context, such as from the position of the CWT in a data | application context, such as from the position of the CWT in a data | |||
structure at which the value must be a CWT. One method of indicating | structure at which the value must be a CWT. One method of indicating | |||
that a CBOR object is a CWT is the use of the "application/cwt" | that a CBOR object is a CWT is the use of the "application/cwt" | |||
content type by a transport protocol. | content type by a transport protocol. | |||
This section defines the CWT CBOR tag as another means for | This section defines the CWT CBOR tag as another means for | |||
applications to declare that a CBOR data structure is a CWT. Its use | applications to declare that a CBOR data structure is a CWT. Its use | |||
is optional and is intended for use in cases in which this | is optional and is intended for use in cases in which this | |||
information would not otherwise be known. | information would not otherwise be known. | |||
skipping to change at page 7, line 22 ¶ | skipping to change at page 8, line 15 ¶ | |||
If present, the CWT tag MUST prefix a tagged object using one of the | If present, the CWT tag MUST prefix a tagged object using one of the | |||
COSE CBOR tags. In this example, the COSE_Mac0 tag is used. The | COSE CBOR tags. In this example, the COSE_Mac0 tag is used. The | |||
actual COSE_Mac0 object has been excluded from this example. | actual COSE_Mac0 object has been excluded from this example. | |||
/ CWT CBOR tag / 61( | / CWT CBOR tag / 61( | |||
/ COSE_Mac0 CBOR tag / 17( | / COSE_Mac0 CBOR tag / 17( | |||
/ COSE_Mac0 object / | / COSE_Mac0 object / | |||
) | ) | |||
) | ) | |||
Figure 1: Example of a CWT tag usage | Figure 1: Example of CWT Tag Usage | |||
7. Creating and Validating CWTs | 7. Creating and Validating CWTs | |||
7.1. Creating a CWT | 7.1. Creating a CWT | |||
To create a CWT, the following steps are performed. The order of the | To create a CWT, the following steps are performed. The order of the | |||
steps is not significant in cases where there are no dependencies | steps is not significant in cases where there are no dependencies | |||
between the inputs and outputs of the steps. | between the inputs and outputs of the steps. | |||
1. Create a CWT Claims Set containing the desired claims. | 1. Create a CWT Claims Set containing the desired claims. | |||
skipping to change at page 8, line 51 ¶ | skipping to change at page 9, line 43 ¶ | |||
4. Verify that the resulting COSE Header includes only parameters | 4. Verify that the resulting COSE Header includes only parameters | |||
and values whose syntax and semantics are both understood and | and values whose syntax and semantics are both understood and | |||
supported or that are specified as being ignored when not | supported or that are specified as being ignored when not | |||
understood. | understood. | |||
5. Depending upon whether the CWT is a signed, MACed, or encrypted, | 5. Depending upon whether the CWT is a signed, MACed, or encrypted, | |||
there are three cases: | there are three cases: | |||
* If the CWT is a COSE_Sign/COSE_Sign1, follow the steps | * If the CWT is a COSE_Sign/COSE_Sign1, follow the steps | |||
specified in [RFC8152] Section 4 (Signing Objects) for | specified in Section 4 of [RFC8152] ("Signing Objects") for | |||
validating a COSE_Sign/COSE_Sign1 object. Let the Message be | validating a COSE_Sign/COSE_Sign1 object. Let the Message be | |||
the COSE_Sign/COSE_Sign1 payload. | the COSE_Sign/COSE_Sign1 payload. | |||
* Else, if the CWT is a COSE_Mac/COSE_Mac0, follow the steps | * Else, if the CWT is a COSE_Mac/COSE_Mac0, follow the steps | |||
specified in [RFC8152] Section 6 (MAC Objects) for validating | specified in Section 6 of [RFC8152] ("MAC Objects") for | |||
a COSE_Mac/COSE_Mac0 object. Let the Message be the COSE_Mac/ | validating a COSE_Mac/COSE_Mac0 object. Let the Message be | |||
COSE_Mac0 payload. | the COSE_Mac/COSE_Mac0 payload. | |||
* Else, if the CWT is a COSE_Encrypt/COSE_Encrypt0 object, | * Else, if the CWT is a COSE_Encrypt/COSE_Encrypt0 object, | |||
follow the steps specified in [RFC8152] Section 5 (Encryption | follow the steps specified in Section 5 of [RFC8152] | |||
Objects) for validating a COSE_Encrypt/COSE_Encrypt0 object. | ("Encryption Objects") for validating a COSE_Encrypt/ | |||
Let the Message be the resulting plaintext. | COSE_Encrypt0 object. Let the Message be the resulting | |||
plaintext. | ||||
6. If the Message begins with a COSE CBOR tag, then the Message is a | 6. If the Message begins with a COSE CBOR tag, then the Message is a | |||
CWT that was the subject of nested signing, MACing, or encryption | CWT that was the subject of nested signing, MACing, or encryption | |||
operations. In this case, return to Step 1, using the Message as | operations. In this case, return to Step 1, using the Message as | |||
the CWT. | the CWT. | |||
7. Verify that the Message is a valid CBOR map; let the CWT Claims | 7. Verify that the Message is a valid CBOR map; let the CWT Claims | |||
Set be this CBOR map. | Set be this CBOR map. | |||
8. Security Considerations | 8. Security Considerations | |||
skipping to change at page 9, line 41 ¶ | skipping to change at page 10, line 35 ¶ | |||
Since the claims conveyed in a CWT may be used to make authorization | Since the claims conveyed in a CWT may be used to make authorization | |||
decisions, it is not only important to protect the CWT in transit but | decisions, it is not only important to protect the CWT in transit but | |||
also to ensure that the recipient can authenticate the party that | also to ensure that the recipient can authenticate the party that | |||
assembled the claims and created the CWT. Without trust of the | assembled the claims and created the CWT. Without trust of the | |||
recipient in the party that created the CWT, no sensible | recipient in the party that created the CWT, no sensible | |||
authorization decision can be made. Furthermore, the creator of the | authorization decision can be made. Furthermore, the creator of the | |||
CWT needs to carefully evaluate each claim value prior to including | CWT needs to carefully evaluate each claim value prior to including | |||
it in the CWT so that the recipient can be assured of the validity of | it in the CWT so that the recipient can be assured of the validity of | |||
the information provided. | the information provided. | |||
While syntactically the signing and encryption operations for Nested | Syntactically, the signing and encryption operations for Nested CWTs | |||
CWTs may be applied in any order, if both signing and encryption are | may be applied in any order; however, if both signing and encryption | |||
necessary, normally producers should sign the message and then | are necessary, producers normally should sign the message and then | |||
encrypt the result (thus encrypting the signature). This prevents | encrypt the result (thus encrypting the signature). This prevents | |||
attacks in which the signature is stripped, leaving just an encrypted | attacks in which the signature is stripped, leaving just an encrypted | |||
message, as well as providing privacy for the signer. Furthermore, | message, as well as providing privacy for the signer. Furthermore, | |||
signatures over encrypted text are not considered valid in many | signatures over encrypted text are not considered valid in many | |||
jurisdictions. | jurisdictions. | |||
9. IANA Considerations | 9. IANA Considerations | |||
9.1. CBOR Web Token (CWT) Claims Registry | 9.1. CBOR Web Token (CWT) Claims Registry | |||
This section establishes the IANA "CBOR Web Token (CWT) Claims" | IANA has created the "CBOR Web Token (CWT) Claims" registry | |||
registry. | [IANA.CWT.Claims]. | |||
Registration requests are evaluated using the criteria described in | Registration requests are evaluated using the criteria described in | |||
the Claim Key instructions in the registration template below after a | the Claim Key instructions in the registration template below after a | |||
three-week review period on the cwt-reg-review@ietf.org mailing list, | three-week review period on the cwt-reg-review@ietf.org mailing list, | |||
on the advice of one or more Designated Experts. However, to allow | on the advice of one or more Designated Experts [RFC8126]. However, | |||
for the allocation of values prior to publication, the Designated | to allow for the allocation of values prior to publication, the | |||
Experts may approve registration once they are satisfied that such a | Designated Experts may approve registration once they are satisfied | |||
specification will be published. [[ Note to the RFC Editor: The name | that such a specification will be published. | |||
of the mailing list should be determined in consultation with the | ||||
IESG and IANA. Suggested name: cwt-reg-review@ietf.org. ]] | ||||
Registration requests sent to the mailing list for review should use | Registration requests sent to the mailing list for review should use | |||
an appropriate subject (e.g., "Request to register claim: example"). | an appropriate subject (e.g., "Request to register claim: example"). | |||
Registration requests that are undetermined for a period longer than | Registration requests that are undetermined for a period longer than | |||
21 days can be brought to the IESG's attention (using the | 21 days can be brought to the IESG's attention (using the | |||
iesg@ietf.org mailing list) for resolution. | iesg@ietf.org mailing list) for resolution. | |||
Criteria that should be applied by the Designated Experts includes | Criteria that should be applied by the Designated Experts includes | |||
determining whether the proposed registration duplicates existing | determining whether the proposed registration duplicates existing | |||
functionality, whether it is likely to be of general applicability or | functionality, whether it is likely to be of general applicability or | |||
skipping to change at page 11, line 25 ¶ | skipping to change at page 12, line 25 ¶ | |||
[IANA.JWT.Claims]. CWT claims should normally have a | [IANA.JWT.Claims]. CWT claims should normally have a | |||
corresponding JWT claim. If a corresponding JWT claim would not | corresponding JWT claim. If a corresponding JWT claim would not | |||
make sense, the Designated Experts can choose to accept | make sense, the Designated Experts can choose to accept | |||
registrations for which the JWT Claim Name is listed as "N/A". | registrations for which the JWT Claim Name is listed as "N/A". | |||
Claim Key: | Claim Key: | |||
CBOR map key for the claim. Different ranges of values use | CBOR map key for the claim. Different ranges of values use | |||
different registration policies [RFC8126]. Integer values from | different registration policies [RFC8126]. Integer values from | |||
-256 to 255 and strings of length 1 are designated as Standards | -256 to 255 and strings of length 1 are designated as Standards | |||
Action. Integer values from -65536 to -257 and from 256 to 65535 | Action. Integer values from -65536 to -257 and from 256 to 65535 | |||
and strings of length 2 are designated as Specification Required. | along with strings of length 2 are designated as Specification | |||
Integer values greater than 65535 and strings of length greater | Required. Integer values greater than 65535 and strings of length | |||
than 2 are designated as Expert Review. Integer values less than | greater than 2 are designated as Expert Review. Integer values | |||
-65536 are marked as Private Use. | less than -65536 are marked as Private Use. | |||
Claim Value Type(s): | Claim Value Type(s): | |||
CBOR types that can be used for the claim value. | CBOR types that can be used for the claim value. | |||
Change Controller: | Change Controller: | |||
For Standards Track RFCs, list the "IESG". For others, give the | For Standards Track RFCs, list the "IESG". For others, give the | |||
name of the responsible party. Other details (e.g., postal | name of the responsible party. Other details (e.g., postal | |||
address, email address, home page URI) may also be included. | address, email address, home page URI) may also be included. | |||
Specification Document(s): | Specification Document(s): | |||
skipping to change at page 11, line 52 ¶ | skipping to change at page 12, line 52 ¶ | |||
included but is not required. | included but is not required. | |||
9.1.2. Initial Registry Contents | 9.1.2. Initial Registry Contents | |||
o Claim Name: (RESERVED) | o Claim Name: (RESERVED) | |||
o Claim Description: This registration reserves the key value 0. | o Claim Description: This registration reserves the key value 0. | |||
o JWT Claim Name: N/A | o JWT Claim Name: N/A | |||
o Claim Key: 0 | o Claim Key: 0 | |||
o Claim Value Type(s): N/A | o Claim Value Type(s): N/A | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): [[ this specification ]] | o Specification Document(s): [RFC8392] | |||
o Claim Name: "iss" | o Claim Name: iss | |||
o Claim Description: Issuer | o Claim Description: Issuer | |||
o JWT Claim Name: "iss" | o JWT Claim Name: iss | |||
o Claim Key: 1 | o Claim Key: 1 | |||
o Claim Value Type(s): text string | o Claim Value Type(s): text string | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.1 of [[ this specification | o Specification Document(s): Section 3.1.1 of [RFC8392] | |||
]] | ||||
o Claim Name: "sub" | o Claim Name: sub | |||
o Claim Description: Subject | o Claim Description: Subject | |||
o JWT Claim Name: "sub" | o JWT Claim Name: sub | |||
o Claim Key: 2 | o Claim Key: 2 | |||
o Claim Value Type(s): text string | o Claim Value Type(s): text string | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.2 of [[ this specification | o Specification Document(s): Section 3.1.2 of [RFC8392] | |||
]] | ||||
o Claim Name: "aud" | o Claim Name: aud | |||
o Claim Description: Audience | o Claim Description: Audience | |||
o JWT Claim Name: "aud" | o JWT Claim Name: aud | |||
o Claim Key: 3 | o Claim Key: 3 | |||
o Claim Value Type(s): text string | o Claim Value Type(s): text string | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.3 of [[ this specification | o Specification Document(s): Section 3.1.3 of [RFC8392] | |||
]] | ||||
o Claim Name: "exp" | o Claim Name: exp | |||
o Claim Description: Expiration Time | o Claim Description: Expiration Time | |||
o JWT Claim Name: "exp" | o JWT Claim Name: exp | |||
o Claim Key: 4 | o Claim Key: 4 | |||
o Claim Value Type(s): integer or floating-point number | o Claim Value Type(s): integer or floating-point number | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.4 of [[ this specification | o Specification Document(s): Section 3.1.4 of [RFC8392] | |||
]] | ||||
o Claim Name: "nbf" | o Claim Name: nbf | |||
o Claim Description: Not Before | o Claim Description: Not Before | |||
o JWT Claim Name: "nbf" | o JWT Claim Name: nbf | |||
o Claim Key: 5 | o Claim Key: 5 | |||
o Claim Value Type(s): integer or floating-point number | o Claim Value Type(s): integer or floating-point number | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.5 of [[ this specification | o Specification Document(s): Section 3.1.5 of [RFC8392] | |||
]] | ||||
o Claim Name: "iat" | o Claim Name: iat | |||
o Claim Description: Issued At | o Claim Description: Issued At | |||
o JWT Claim Name: "iat" | o JWT Claim Name: iat | |||
o Claim Key: 6 | o Claim Key: 6 | |||
o Claim Value Type(s): integer or floating-point number | o Claim Value Type(s): integer or floating-point number | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.6 of [[ this specification | o Specification Document(s): Section 3.1.6 of [RFC8392] | |||
]] | o Claim Name: cti | |||
o Claim Name: "cti" | ||||
o Claim Description: CWT ID | o Claim Description: CWT ID | |||
o JWT Claim Name: "jti" | o JWT Claim Name: jti | |||
o Claim Key: 7 | o Claim Key: 7 | |||
o Claim Value Type(s): byte string | o Claim Value Type(s): byte string | |||
o Change Controller: IESG | o Change Controller: IESG | |||
o Specification Document(s): Section 3.1.7 of [[ this specification | o Specification Document(s): Section 3.1.7 of [RFC8392] | |||
]] | ||||
9.2. Media Type Registration | 9.2. Media Type Registration | |||
This section registers the "application/cwt" media type in the "Media | IANA has registered the "application/cwt" media type in the "Media | |||
Types" registry [IANA.MediaTypes] in the manner described in RFC 6838 | Types" registry [IANA.MediaTypes] in the manner described in RFC 6838 | |||
[RFC6838], which can be used to indicate that the content is a CWT. | [RFC6838], which can be used to indicate that the content is a CWT. | |||
9.2.1. Registry Contents | 9.2.1. Registry Contents | |||
o Type name: application | o Type name: application | |||
o Subtype name: cwt | o Subtype name: cwt | |||
o Required parameters: N/A | o Required parameters: N/A | |||
o Optional parameters: N/A | o Optional parameters: N/A | |||
o Encoding considerations: binary | o Encoding considerations: binary | |||
o Security considerations: See the Security Considerations section | o Security considerations: See the Security Considerations section | |||
of [[ this specification ]] | of [RFC8392] | |||
o Interoperability considerations: N/A | o Interoperability considerations: N/A | |||
o Published specification: [[ this specification ]] | o Published specification: [RFC8392] | |||
o Applications that use this media type: IoT applications sending | o Applications that use this media type: IoT applications sending | |||
security tokens over HTTP(S), CoAP(S), and other transports. | security tokens over HTTP(S), CoAP(S), and other transports. | |||
o Fragment identifier considerations: N/A | o Fragment identifier considerations: N/A | |||
o Additional information: | o Additional information: | |||
Magic number(s): N/A | Magic number(s): N/A | |||
File extension(s): N/A | File extension(s): N/A | |||
Macintosh file type code(s): N/A | Macintosh file type code(s): N/A | |||
o Person & email address to contact for further information: | o Person & email address to contact for further information: | |||
IESG, iesg@ietf.org | IESG, iesg@ietf.org | |||
o Intended usage: COMMON | o Intended usage: COMMON | |||
o Restrictions on usage: none | o Restrictions on usage: none | |||
o Author: Michael B. Jones, mbj@microsoft.com | o Author: Michael B. Jones, mbj@microsoft.com | |||
o Change controller: IESG | o Change controller: IESG | |||
o Provisional registration? No | o Provisional registration? No | |||
9.3. CoAP Content-Formats Registration | 9.3. CoAP Content-Formats Registration | |||
This section registers the CoAP Content-Format ID for the | IANA has registered the CoAP Content-Format ID for the "application/ | |||
"application/cwt" media type in the "CoAP Content-Formats" registry | cwt" media type in the "CoAP Content-Formats" registry | |||
[IANA.CoAP.Content-Formats]. | [IANA.CoAP.Content-Formats]. | |||
9.3.1. Registry Contents | 9.3.1. Registry Contents | |||
o Media Type: application/cwt | o Media Type: application/cwt | |||
o Encoding: - | o Encoding: - | |||
o Id: TBD (maybe 61) | o Id: 61 | |||
o Reference: [[ this specification ]] | o Reference: [RFC8392] | |||
9.4. CBOR Tag registration | 9.4. CBOR Tag registration | |||
This section registers the CWT CBOR tag in the "CBOR Tags" registry | IANA has registered the CWT CBOR tag in the "CBOR Tags" registry | |||
[IANA.CBOR.Tags]. | [IANA.CBOR.Tags]. | |||
9.4.1. Registry Contents | 9.4.1. Registry Contents | |||
o CBOR Tag: TBD (maybe 61 to use the same value as the Content- | o CBOR Tag: 61 | |||
Format) | ||||
o Data Item: CBOR Web Token (CWT) | o Data Item: CBOR Web Token (CWT) | |||
o Semantics: CBOR Web Token (CWT), as defined in [[ this | o Semantics: CBOR Web Token (CWT), as defined in [RFC8392] | |||
specification ]] | o Reference: [RFC8392] | |||
o Description of Semantics: [[ this specification ]] | ||||
o Point of Contact: Michael B. Jones, mbj@microsoft.com | o Point of Contact: Michael B. Jones, mbj@microsoft.com | |||
10. References | 10. References | |||
10.1. Normative References | 10.1. Normative References | |||
[IANA.CBOR.Tags] | [IANA.CBOR.Tags] | |||
IANA, "Concise Binary Object Representation (CBOR) Tags", | IANA, "Concise Binary Object Representation (CBOR) Tags", | |||
<http://www.iana.org/assignments/cbor-tags/ | <http://www.iana.org/assignments/cbor-tags/>. | |||
cbor-tags.xhtml>. | ||||
[IANA.CoAP.Content-Formats] | [IANA.CoAP.Content-Formats] | |||
IANA, "CoAP Content-Formats", | IANA, "CoAP Content-Formats", | |||
<http://www.iana.org/assignments/core-parameters/ | <https://www.iana.org/assignments/core-parameters/>. | |||
core-parameters.xhtml#content-formats>. | ||||
[IANA.CWT.Claims] | ||||
IANA, "CBOR Web Token (CWT) Claims", | ||||
<http://www.iana.org/assignments/cwt>. | ||||
[IANA.MediaTypes] | [IANA.MediaTypes] | |||
IANA, "Media Types", | IANA, "Media Types", | |||
<http://www.iana.org/assignments/media-types>. | <http://www.iana.org/assignments/media-types>. | |||
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
<https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
skipping to change at page 16, line 29 ¶ | skipping to change at page 17, line 29 ¶ | |||
A.1. Example CWT Claims Set | A.1. Example CWT Claims Set | |||
The CWT Claims Set used for the different examples displays usage of | The CWT Claims Set used for the different examples displays usage of | |||
all the defined claims. For signed and MACed examples, the CWT | all the defined claims. For signed and MACed examples, the CWT | |||
Claims Set is the CBOR encoding as a byte string. | Claims Set is the CBOR encoding as a byte string. | |||
a70175636f61703a2f2f61732e6578616d706c652e636f6d02656572696b7703 | a70175636f61703a2f2f61732e6578616d706c652e636f6d02656572696b7703 | |||
7818636f61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0 | 7818636f61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0 | |||
051a5610d9f0061a5610d9f007420b71 | 051a5610d9f0061a5610d9f007420b71 | |||
Figure 2: Example CWT Claims Set as hex string | Figure 2: Example CWT Claims Set as Hex String | |||
{ | { | |||
/ iss / 1: "coap://as.example.com", | / iss / 1: "coap://as.example.com", | |||
/ sub / 2: "erikw", | / sub / 2: "erikw", | |||
/ aud / 3: "coap://light.example.com", | / aud / 3: "coap://light.example.com", | |||
/ exp / 4: 1444064944, | / exp / 4: 1444064944, | |||
/ nbf / 5: 1443944944, | / nbf / 5: 1443944944, | |||
/ iat / 6: 1443944944, | / iat / 6: 1443944944, | |||
/ cti / 7: h'0b71' | / cti / 7: h'0b71' | |||
} | } | |||
Figure 3: Example CWT Claims Set in CBOR diagnostic notation | Figure 3: Example CWT Claims Set in CBOR Diagnostic Notation | |||
A.2. Example keys | A.2. Example Keys | |||
This section contains the keys used to sign, MAC, and encrypt the | This section contains the keys used to sign, MAC, and encrypt the | |||
messages in this appendix. Line breaks are for display purposes | messages in this appendix. Line breaks are for display purposes | |||
only. | only. | |||
A.2.1. 128-bit Symmetric Key | A.2.1. 128-Bit Symmetric Key | |||
a42050231f4c4d4d3051fdc2ec0a3851d5b3830104024c53796d6d6574726963 | a42050231f4c4d4d3051fdc2ec0a3851d5b3830104024c53796d6d6574726963 | |||
313238030a | 313238030a | |||
Figure 4: 128-bit symmetric COSE_Key as hex string | Figure 4: 128-Bit Symmetric COSE_Key as Hex String | |||
{ | { | |||
/ k / -1: h'231f4c4d4d3051fdc2ec0a3851d5b383' | / k / -1: h'231f4c4d4d3051fdc2ec0a3851d5b383' | |||
/ kty / 1: 4 / Symmetric /, | / kty / 1: 4 / Symmetric /, | |||
/ kid / 2: h'53796d6d6574726963313238' / 'Symmetric128' /, | / kid / 2: h'53796d6d6574726963313238' / 'Symmetric128' /, | |||
/ alg / 3: 10 / AES-CCM-16-64-128 / | / alg / 3: 10 / AES-CCM-16-64-128 / | |||
} | } | |||
Figure 5: 128-bit symmetric COSE_Key in CBOR diagnostic notation | Figure 5: 128-Bit Symmetric COSE_Key in CBOR Diagnostic Notation | |||
A.2.2. 256-bit Symmetric Key | A.2.2. 256-Bit Symmetric Key | |||
a4205820403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d | a4205820403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d | |||
795693880104024c53796d6d6574726963323536030a | 795693880104024c53796d6d6574726963323536030a | |||
Figure 6: 256-bit symmetric COSE_Key as hex string | Figure 6: 256-Bit Symmetric COSE_Key as Hex String | |||
{ | { | |||
/ k / -1: h'403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1 | / k / -1: h'403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1 | |||
ec99192d79569388' | ec99192d79569388' | |||
/ kty / 1: 4 / Symmetric /, | / kty / 1: 4 / Symmetric /, | |||
/ kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /, | / kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /, | |||
/ alg / 3: 4 / HMAC 256/64 / | / alg / 3: 4 / HMAC 256/64 / | |||
} | } | |||
Figure 7: 256-bit symmetric COSE_Key in CBOR diagnostic notation | Figure 7: 256-Bit Symmetric COSE_Key in CBOR Diagnostic Notation | |||
A.2.3. ECDSA P-256 256-bit COSE Key | A.2.3. Elliptic Curve Digital Signature Algorithm (ECDSA) P-256 256-Bit | |||
COSE Key | ||||
a72358206c1382765aec5358f117733d281c1c7bdc39884d04a45a1e6c67c858 | a72358206c1382765aec5358f117733d281c1c7bdc39884d04a45a1e6c67c858 | |||
bc206c1922582060f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168db | bc206c1922582060f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168db | |||
9529971a36e7b9215820143329cce7868e416927599cf65a34f3ce2ffda55a7e | 9529971a36e7b9215820143329cce7868e416927599cf65a34f3ce2ffda55a7e | |||
ca69ed8919a394d42f0f2001010202524173796d6d6574726963454344534132 | ca69ed8919a394d42f0f2001010202524173796d6d6574726963454344534132 | |||
35360326 | 35360326 | |||
Figure 8: ECDSA 256-bit COSE Key as hex string | Figure 8: ECDSA 256-Bit COSE Key as Hex String | |||
{ | { | |||
/ d / -4: h'6c1382765aec5358f117733d281c1c7bdc39884d04a45a1e | / d / -4: h'6c1382765aec5358f117733d281c1c7bdc39884d04a45a1e | |||
6c67c858bc206c19', | 6c67c858bc206c19', | |||
/ y / -3: h'60f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168 | / y / -3: h'60f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168 | |||
db9529971a36e7b9', | db9529971a36e7b9', | |||
/ x / -2: h'143329cce7868e416927599cf65a34f3ce2ffda55a7eca69 | / x / -2: h'143329cce7868e416927599cf65a34f3ce2ffda55a7eca69 | |||
ed8919a394d42f0f', | ed8919a394d42f0f', | |||
/ crv / -1: 1 / P-256 /, | / crv / -1: 1 / P-256 /, | |||
/ kty / 1: 2 / EC2 /, | / kty / 1: 2 / EC2 /, | |||
/ kid / 2: h'4173796d6d657472696345434453413 | / kid / 2: h'4173796d6d657472696345434453413 | |||
23536' / 'AsymmetricECDSA256' /, | 23536' / 'AsymmetricECDSA256' /, | |||
/ alg / 3: -7 / ECDSA 256 / | / alg / 3: -7 / ECDSA 256 / | |||
} | } | |||
Figure 9: ECDSA 256-bit COSE Key in CBOR diagnostic notation | Figure 9: ECDSA 256-Bit COSE Key in CBOR Diagnostic Notation | |||
A.3. Example Signed CWT | A.3. Example Signed CWT | |||
This section shows a signed CWT with a single recipient and a full | This section shows a signed CWT with a single recipient and a full | |||
CWT Claims Set. | CWT Claims Set. | |||
The signature is generated using the private key listed in | The signature is generated using the private key listed in | |||
Appendix A.2.3 and it can be validated using the public key from | Appendix A.2.3, and it can be validated using the public key from | |||
Appendix A.2.3. Line breaks are for display purposes only. | Appendix A.2.3. Line breaks are for display purposes only. | |||
d28443a10126a104524173796d6d657472696345434453413235365850a701756 | d28443a10126a104524173796d6d657472696345434453413235365850a701756 | |||
36f61703a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f | 36f61703a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f | |||
61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d | 61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d | |||
9f0061a5610d9f007420b7158405427c1ff28d23fbad1f29c4c7c6a555e601d6f | 9f0061a5610d9f007420b7158405427c1ff28d23fbad1f29c4c7c6a555e601d6f | |||
a29f9179bc3d7438bacaca5acd08c8d4d4f96131680c429a01f85951ecee743a5 | a29f9179bc3d7438bacaca5acd08c8d4d4f96131680c429a01f85951ecee743a5 | |||
2b9b63632c57209120e1c9e30 | 2b9b63632c57209120e1c9e30 | |||
Figure 10: Signed CWT as hex string | Figure 10: Signed CWT as Hex String | |||
18( | 18( | |||
[ | [ | |||
/ protected / << { | / protected / << { | |||
/ alg / 1: -7 / ECDSA 256 / | / alg / 1: -7 / ECDSA 256 / | |||
} >>, | } >>, | |||
/ unprotected / { | / unprotected / { | |||
/ kid / 4: h'4173796d6d657472696345434453413 | / kid / 4: h'4173796d6d657472696345434453413 | |||
23536' / 'AsymmetricECDSA256' / | 23536' / 'AsymmetricECDSA256' / | |||
}, | }, | |||
skipping to change at page 19, line 30 ¶ | skipping to change at page 20, line 30 ¶ | |||
/ iat / 6: 1443944944, | / iat / 6: 1443944944, | |||
/ cti / 7: h'0b71' | / cti / 7: h'0b71' | |||
} >>, | } >>, | |||
/ signature / h'5427c1ff28d23fbad1f29c4c7c6a555e601d6fa29f | / signature / h'5427c1ff28d23fbad1f29c4c7c6a555e601d6fa29f | |||
9179bc3d7438bacaca5acd08c8d4d4f96131680c42 | 9179bc3d7438bacaca5acd08c8d4d4f96131680c42 | |||
9a01f85951ecee743a52b9b63632c57209120e1c9e | 9a01f85951ecee743a52b9b63632c57209120e1c9e | |||
30' | 30' | |||
] | ] | |||
) | ) | |||
Figure 11: Signed CWT in CBOR diagnostic notation | Figure 11: Signed CWT in CBOR Diagnostic Notation | |||
A.4. Example MACed CWT | A.4. Example MACed CWT | |||
This section shows a MACed CWT with a single recipient, a full CWT | This section shows a MACed CWT with a single recipient, a full CWT | |||
Claims Set, and a CWT tag. | Claims Set, and a CWT tag. | |||
The MAC is generated using the 256-bit symmetric key from | The MAC is generated using the 256-bit symmetric key from | |||
Appendix A.2.2 with a 64-bit truncation. Line breaks are for display | Appendix A.2.2 with a 64-bit truncation. Line breaks are for display | |||
purposes only. | purposes only. | |||
d83dd18443a10104a1044c53796d6d65747269633235365850a70175636f6170 | d83dd18443a10104a1044c53796d6d65747269633235365850a70175636f6170 | |||
3a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f61703a | 3a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f61703a | |||
2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d9f006 | 2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d9f006 | |||
1a5610d9f007420b7148093101ef6d789200 | 1a5610d9f007420b7148093101ef6d789200 | |||
Figure 12: MACed CWT with CWT tag as hex string | Figure 12: MACed CWT with CWT Tag as Hex String | |||
61( | 61( | |||
17( | 17( | |||
[ | [ | |||
/ protected / << { | / protected / << { | |||
/ alg / 1: 4 / HMAC-256-64 / | / alg / 1: 4 / HMAC-256-64 / | |||
} >>, | } >>, | |||
/ unprotected / { | / unprotected / { | |||
/ kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' / | / kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' / | |||
}, | }, | |||
skipping to change at page 20, line 28 ¶ | skipping to change at page 21, line 28 ¶ | |||
/ exp / 4: 1444064944, | / exp / 4: 1444064944, | |||
/ nbf / 5: 1443944944, | / nbf / 5: 1443944944, | |||
/ iat / 6: 1443944944, | / iat / 6: 1443944944, | |||
/ cti / 7: h'0b71' | / cti / 7: h'0b71' | |||
} >>, | } >>, | |||
/ tag / h'093101ef6d789200' | / tag / h'093101ef6d789200' | |||
] | ] | |||
) | ) | |||
) | ) | |||
Figure 13: MACed CWT with CWT tag in CBOR diagnostic notation | Figure 13: MACed CWT with CWT Tag in CBOR Diagnostic Notation | |||
A.5. Example Encrypted CWT | A.5. Example Encrypted CWT | |||
This section shows an encrypted CWT with a single recipient and a | This section shows an encrypted CWT with a single recipient and a | |||
full CWT Claims Set. | full CWT Claims Set. | |||
The encryption is done with AES-CCM mode using the 128-bit symmetric | The encryption is done with AES-CCM mode using the 128-bit symmetric | |||
key from Appendix A.2.1 with a 64-bit tag and 13-byte nonce, i.e., | key from Appendix A.2.1 with a 64-bit tag and 13-byte nonce, i.e., | |||
COSE AES-CCM-16-64-128. Line breaks are for display purposes only. | COSE AES-CCM-16-64-128. Line breaks are for display purposes only. | |||
d08343a1010aa2044c53796d6d6574726963313238054d99a0d7846e762c49ff | d08343a1010aa2044c53796d6d6574726963313238054d99a0d7846e762c49ff | |||
e8a63e0b5858b918a11fd81e438b7f973d9e2e119bcb22424ba0f38a80f27562 | e8a63e0b5858b918a11fd81e438b7f973d9e2e119bcb22424ba0f38a80f27562 | |||
f400ee1d0d6c0fdb559c02421fd384fc2ebe22d7071378b0ea7428fff157444d | f400ee1d0d6c0fdb559c02421fd384fc2ebe22d7071378b0ea7428fff157444d | |||
45f7e6afcda1aae5f6495830c58627087fc5b4974f319a8707a635dd643b | 45f7e6afcda1aae5f6495830c58627087fc5b4974f319a8707a635dd643b | |||
Figure 14: Encrypted CWT as hex string | Figure 14: Encrypted CWT as Hex String | |||
16( | 16( | |||
[ | [ | |||
/ protected / << { | / protected / << { | |||
/ alg / 1: 10 / AES-CCM-16-64-128 / | / alg / 1: 10 / AES-CCM-16-64-128 / | |||
} >>, | } >>, | |||
/ unprotected / { | / unprotected / { | |||
/ kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /, | / kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /, | |||
/ iv / 5: h'99a0d7846e762c49ffe8a63e0b' | / iv / 5: h'99a0d7846e762c49ffe8a63e0b' | |||
}, | }, | |||
/ ciphertext / h'b918a11fd81e438b7f973d9e2e119bcb22424ba0f38 | / ciphertext / h'b918a11fd81e438b7f973d9e2e119bcb22424ba0f38 | |||
a80f27562f400ee1d0d6c0fdb559c02421fd384fc2e | a80f27562f400ee1d0d6c0fdb559c02421fd384fc2e | |||
be22d7071378b0ea7428fff157444d45f7e6afcda1a | be22d7071378b0ea7428fff157444d45f7e6afcda1a | |||
ae5f6495830c58627087fc5b4974f319a8707a635dd | ae5f6495830c58627087fc5b4974f319a8707a635dd | |||
643b' | 643b' | |||
] | ] | |||
) | ) | |||
Figure 15: Encrypted CWT in CBOR diagnostic notation | Figure 15: Encrypted CWT in CBOR Diagnostic Notation | |||
A.6. Example Nested CWT | A.6. Example Nested CWT | |||
This section shows a Nested CWT, signed and then encrypted, with a | This section shows a Nested CWT, signed and then encrypted, with a | |||
single recipient and a full CWT Claims Set. | single recipient and a full CWT Claims Set. | |||
The signature is generated using the private ECDSA key from | The signature is generated using the private ECDSA key from | |||
Appendix A.2.3 and it can be validated using the public ECDSA parts | Appendix A.2.3, and it can be validated using the public ECDSA parts | |||
from Appendix A.2.3. The encryption is done with AES-CCM mode using | from Appendix A.2.3. The encryption is done with AES-CCM mode using | |||
the 128-bit symmetric key from Appendix A.2.1 with a 64-bit tag and | the 128-bit symmetric key from Appendix A.2.1 with a 64-bit tag and | |||
13-byte nonce, i.e., COSE AES-CCM-16-64-128. The content type is set | 13-byte nonce, i.e., COSE AES-CCM-16-64-128. The content type is set | |||
to CWT to indicate that there are multiple layers of COSE protection | to CWT to indicate that there are multiple layers of COSE protection | |||
before finding the CWT Claims Set. The decrypted ciphertext will be a | before finding the CWT Claims Set. The decrypted ciphertext will be a | |||
COSE_sign1 structure. In this example, it is the same one as in | COSE_sign1 structure. In this example, it is the same one as in | |||
Appendix A.3, i.e., a Signed CWT Claims Set. Note that there is no | Appendix A.3, i.e., a Signed CWT Claims Set. Note that there is no | |||
limitation to the number of layers; this is an example with two | limitation to the number of layers; this is an example with two | |||
layers. Line breaks are for display purposes only. | layers. Line breaks are for display purposes only. | |||
d08343a1010aa2044c53796d6d6574726963313238054d4a0694c0e69ee6b595 | d08343a1010aa2044c53796d6d6574726963313238054d4a0694c0e69ee6b595 | |||
6655c7b258b7f6b0914f993de822cc47e5e57a188d7960b528a747446fe12f0e | 6655c7b258b7f6b0914f993de822cc47e5e57a188d7960b528a747446fe12f0e | |||
7de05650dec74724366763f167a29c002dfd15b34d8993391cf49bc91127f545 | 7de05650dec74724366763f167a29c002dfd15b34d8993391cf49bc91127f545 | |||
dba8703d66f5b7f1ae91237503d371e6333df9708d78c4fb8a8386c8ff09dc49 | dba8703d66f5b7f1ae91237503d371e6333df9708d78c4fb8a8386c8ff09dc49 | |||
af768b23179deab78d96490a66d5724fb33900c60799d9872fac6da3bdb89043 | af768b23179deab78d96490a66d5724fb33900c60799d9872fac6da3bdb89043 | |||
d67c2a05414ce331b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bff142631 | d67c2a05414ce331b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bff142631 | |||
610a7e0f677b7e9b0bc73adefdcee16d9d5d284c616abeab5d8c291ce0 | 610a7e0f677b7e9b0bc73adefdcee16d9d5d284c616abeab5d8c291ce0 | |||
Figure 16: Signed and Encrypted CWT as hex string | Figure 16: Signed and Encrypted CWT as Hex String | |||
16( | 16( | |||
[ | [ | |||
/ protected / << { | / protected / << { | |||
/ alg / 1: 10 / AES-CCM-16-64-128 / | / alg / 1: 10 / AES-CCM-16-64-128 / | |||
} >>, | } >>, | |||
/ unprotected / { | / unprotected / { | |||
/ kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /, | / kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /, | |||
/ iv / 5: h'4a0694c0e69ee6b5956655c7b2' | / iv / 5: h'4a0694c0e69ee6b5956655c7b2' | |||
}, | }, | |||
skipping to change at page 22, line 26 ¶ | skipping to change at page 23, line 26 ¶ | |||
fd15b34d8993391cf49bc91127f545dba8703d66f5b | fd15b34d8993391cf49bc91127f545dba8703d66f5b | |||
7f1ae91237503d371e6333df9708d78c4fb8a8386c8 | 7f1ae91237503d371e6333df9708d78c4fb8a8386c8 | |||
ff09dc49af768b23179deab78d96490a66d5724fb33 | ff09dc49af768b23179deab78d96490a66d5724fb33 | |||
900c60799d9872fac6da3bdb89043d67c2a05414ce3 | 900c60799d9872fac6da3bdb89043d67c2a05414ce3 | |||
31b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bf | 31b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bf | |||
f142631610a7e0f677b7e9b0bc73adefdcee16d9d5d | f142631610a7e0f677b7e9b0bc73adefdcee16d9d5d | |||
284c616abeab5d8c291ce0' | 284c616abeab5d8c291ce0' | |||
] | ] | |||
) | ) | |||
Figure 17: Signed and Encrypted CWT in CBOR diagnostic notation | Figure 17: Signed and Encrypted CWT in CBOR Diagnostic Notation | |||
A.7. Example MACed CWT with a floating-point value | A.7. Example MACed CWT with a Floating-Point Value | |||
This section shows a MACed CWT with a single recipient and a simple | This section shows a MACed CWT with a single recipient and a simple | |||
CWT Claims Set. The CWT Claims Set with a floating-point 'iat' value. | CWT Claims Set. The CWT Claims Set with a floating-point 'iat' value. | |||
The MAC is generated using the 256-bit symmetric key from | The MAC is generated using the 256-bit symmetric key from | |||
Appendix A.2.2 with a 64-bit truncation. Line breaks are for display | Appendix A.2.2 with a 64-bit truncation. Line breaks are for display | |||
purposes only. | purposes only. | |||
d18443a10104a1044c53796d6d65747269633235364ba106fb41d584367c2000 | d18443a10104a1044c53796d6d65747269633235364ba106fb41d584367c2000 | |||
0048b8816f34c0542892 | 0048b8816f34c0542892 | |||
Figure 18: MACed CWT with a floating-point value as hex string | Figure 18: MACed CWT with a Floating-Point Value as Hex String | |||
17( | 17( | |||
[ | [ | |||
/ protected / << { | / protected / << { | |||
/ alg / 1: 4 / HMAC-256-64 / | / alg / 1: 4 / HMAC-256-64 / | |||
} >>, | } >>, | |||
/ unprotected / { | / unprotected / { | |||
/ kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /, | / kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /, | |||
}, | }, | |||
/ payload / << { | / payload / << { | |||
/ iat / 6: 1443944944.5 | / iat / 6: 1443944944.5 | |||
} >>, | } >>, | |||
/ tag / h'b8816f34c0542892' | / tag / h'b8816f34c0542892' | |||
] | ] | |||
) | ) | |||
Figure 19: MACed CWT with a floating-point value in CBOR diagnostic | Figure 19: MACed CWT with a Floating-Point Value | |||
notation | in CBOR Diagnostic Notation | |||
Appendix B. Acknowledgements | Acknowledgements | |||
This specification is based on JSON Web Token (JWT) [RFC7519], the | This specification is based on JSON Web Token (JWT) [RFC7519], the | |||
authors of which also include Nat Sakimura and John Bradley. It also | authors of which also include Nat Sakimura and John Bradley. It also | |||
incorporates suggestions made by many people, including Carsten | incorporates suggestions made by many people, including Carsten | |||
Bormann, Alissa Cooper, Esko Dijk, Benjamin Kaduk, Warren Kumari, | Bormann, Alissa Cooper, Esko Dijk, Benjamin Kaduk, Warren Kumari, | |||
Carlos Martinez, Alexey Melnikov, Kathleen Moriarty, Eric Rescorla, | Carlos Martinez, Alexey Melnikov, Kathleen Moriarty, Eric Rescorla, | |||
Dan Romascanu, Adam Roach, Kyle Rose, Jim Schaad, Ludwig Seitz, and | Dan Romascanu, Adam Roach, Kyle Rose, Jim Schaad, Ludwig Seitz, and | |||
Goeran Selander. | Goeran Selander. | |||
[[ RFC Editor: Is it possible to preserve the non-ASCII spellings of | ||||
the names Erik Wahlstroem and Goeran Selander in the final | ||||
specification? ]] | ||||
Appendix C. Document History | ||||
[[ to be removed by the RFC Editor before publication as an RFC ]] | ||||
-15 | ||||
o Added section references when the terms "NumericDate" and | ||||
"StringOrURI" are used, as suggested by Adam Roach. | ||||
-14 | ||||
o Cleaned up the descriptions of the numeric ranges of claim keys | ||||
being registered in the registration template for the "CBOR Web | ||||
Token (CWT) Claims" registry, as suggested by Adam Roach. | ||||
o Clarified the relationships between the JWT and CWT "NumericDate" | ||||
and "StringOrURI" terms, as suggested by Adam Roach. | ||||
o Eliminated unnecessary uses of the word "type", as suggested by | ||||
Adam Roach. | ||||
o Added the text "IANA must only accept registry updates from the | ||||
Designated Experts and should direct all requests for registration | ||||
to the review mailing list" from RFC 7519, as suggested by Amanda | ||||
Baber of IANA, which is also intended to address Alexey Melnikov's | ||||
comment. | ||||
o Removed a superfluous comma, as suggested by Warren Kumari. | ||||
o Acknowledged additional reviewers. | ||||
-13 | ||||
o Clarified the registration criteria applied to different ranges of | ||||
Claim Key values, as suggested by Kathleen Moriarty and Dan | ||||
Romascanu. | ||||
o No longer describe the syntax of CWT claims as being the same as | ||||
that of the corresponding JWT claims, as suggested by Kyle Rose. | ||||
o Added guidance about the selection of the Designated Experts, as | ||||
suggested by Benjamin Kaduk. | ||||
o Acknowledged additional reviewers. | ||||
-12 | ||||
o Updated the RFC 5226 reference to RFC 8126. | ||||
o Made the IANA registration criteria consistent across sections. | ||||
o Stated that registrations for the limited set of values between | ||||
-256 and 255 and strings of length 1 are to be restricted to | ||||
claims with general applicability. | ||||
o Changed the "Reference" field name to "Description of Semantics" | ||||
in the CBOR Tag registration request. | ||||
o Asked the RFC Editor whether it is possible to preserve the non- | ||||
ASCII spellings of the names Erik Wahlstroem and Goeran Selander | ||||
in the final specification. | ||||
-11 | ||||
o Corrected the "iv" value in the signed and encrypted CWT example. | ||||
o Mention CoAP in the "application/cwt" media type registration. | ||||
o Changed references of the form "Section 4.1.1 of JWT <xref | ||||
target="RFC7519"/>" to "Section 4.1.1 of <xref target="RFC7519"/>" | ||||
so that rfcmarkup will generate correct external section reference | ||||
links. | ||||
o Updated Acknowledgements. | ||||
-10 | ||||
o Clarified that the audience claim value can be a single audience | ||||
value or an array of audience values, just as is the case for the | ||||
JWT "aud" claim. | ||||
o Clarified the nested CWT description. | ||||
o Changed uses of "binary string" to "byte string". | ||||
-09 | ||||
o Added key ID values to the examples. | ||||
o Key values for the examples are now represented in COSE_Key format | ||||
using CBOR diagnostic notation. | ||||
-08 | ||||
o Updated the diagnostic notation for embedded objects in the | ||||
examples, addressing feedback by Carsten Bormann. | ||||
-07 | ||||
o Updated examples for signing and encryption. Signatures are now | ||||
deterministic as recommended by COSE specification. | ||||
-06 | ||||
o Addressed review comments by Carsten Bormann and Jim Schaad. All | ||||
changes were editorial in nature. | ||||
-05 | ||||
o Addressed working group last call comments with the following | ||||
changes: | ||||
o Say that CWT is derived from JWT, rather than CWT is a profile of | ||||
JWT. | ||||
o Used CBOR type names in descriptions, rather than major/minor type | ||||
numbers. | ||||
o Clarified the NumericDate and StringOrURI descriptions. | ||||
o Changed to allow CWT claim names to use values of any legal CBOR | ||||
map key type. | ||||
o Changed to use the CWT tag to identify nested CWTs instead of the | ||||
CWT content type. | ||||
o Added an example using a floating-point date value. | ||||
o Acknowledged reviewers. | ||||
-04 | ||||
o Specified that the use of CBOR tags to prefix any of the claim | ||||
values defined in this specification is NOT RECOMMENDED. | ||||
-03 | ||||
o Reworked the examples to include signed, MACed, encrypted, and | ||||
nested CWTs. | ||||
o Defined the CWT CBOR tag and explained its usage. | ||||
-02 | ||||
o Added IANA registration for the application/cwt media type. | ||||
o Clarified the nested CWT language. | ||||
o Corrected nits identified by Ludwig Seitz. | ||||
-01 | ||||
o Added IANA registration for CWT Claims. | ||||
o Added IANA registration for the application/cwt CoAP content- | ||||
format type. | ||||
o Added Samuel Erdtman as an editor. | ||||
o Changed Erik's e-mail address. | ||||
-00 | ||||
o Created the initial working group version based on draft- | ||||
wahlstroem-ace-cbor-web-token-00. | ||||
Authors' Addresses | Authors' Addresses | |||
Michael B. Jones | Michael B. Jones | |||
Microsoft | Microsoft | |||
Email: mbj@microsoft.com | Email: mbj@microsoft.com | |||
URI: http://self-issued.info/ | URI: http://self-issued.info/ | |||
Erik Wahlstroem | Erik Wahlstroem | |||
Sweden | Sweden | |||
End of changes. 86 change blocks. | ||||
342 lines changed or deleted | 160 lines changed or added | |||
This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |