draft-ietf-ace-cbor-web-token-08.txt   draft-ietf-ace-cbor-web-token-09.txt 
ACE Working Group M. Jones ACE Working Group M. Jones
Internet-Draft Microsoft Internet-Draft Microsoft
Intended status: Standards Track E. Wahlstroem Intended status: Standards Track E. Wahlstroem
Expires: February 17, 2018 Expires: April 29, 2018
S. Erdtman S. Erdtman
Spotify AB Spotify AB
H. Tschofenig H. Tschofenig
ARM Ltd. ARM Ltd.
August 16, 2017 October 26, 2017
CBOR Web Token (CWT) CBOR Web Token (CWT)
draft-ietf-ace-cbor-web-token-08 draft-ietf-ace-cbor-web-token-09
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 Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on February 17, 2018. This Internet-Draft will expire on April 29, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 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
(http://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 . . . . . . . . . . . . . . . . . . . . . . . . 3
skipping to change at page 2, line 52 skipping to change at page 2, line 52
9.3. CoAP Content-Formats Registration . . . . . . . . . . . . 13 9.3. CoAP Content-Formats Registration . . . . . . . . . . . . 13
9.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 13 9.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 13
9.4. CBOR Tag registration . . . . . . . . . . . . . . . . . . 14 9.4. CBOR Tag registration . . . . . . . . . . . . . . . . . . 14
9.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 14 9.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 14
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 14
10.1. Normative References . . . . . . . . . . . . . . . . . . 14 10.1. Normative References . . . . . . . . . . . . . . . . . . 14
10.2. Informative References . . . . . . . . . . . . . . . . . 15 10.2. Informative References . . . . . . . . . . . . . . . . . 15
Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 15 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 15
A.1. Example CWT Claims Set . . . . . . . . . . . . . . . . . 15 A.1. Example CWT Claims Set . . . . . . . . . . . . . . . . . 15
A.2. Example keys . . . . . . . . . . . . . . . . . . . . . . 16 A.2. Example keys . . . . . . . . . . . . . . . . . . . . . . 16
A.2.1. 128-bit Symmetric Key as Hex Encoded String . . . . . 16 A.2.1. 128-bit Symmetric Key . . . . . . . . . . . . . . . . 16
A.2.2. 256-bit Symmetric Key as Hex Encoded String . . . . . 16 A.2.2. 256-bit Symmetric Key . . . . . . . . . . . . . . . . 16
A.2.3. ECDSA P-256 256-bit COSE Key . . . . . . . . . . . . 16 A.2.3. ECDSA P-256 256-bit COSE Key . . . . . . . . . . . . 17
A.3. Example Signed CWT . . . . . . . . . . . . . . . . . . . 17 A.3. Example Signed CWT . . . . . . . . . . . . . . . . . . . 17
A.4. Example MACed CWT . . . . . . . . . . . . . . . . . . . . 18 A.4. Example MACed CWT . . . . . . . . . . . . . . . . . . . . 18
A.5. Example Encrypted CWT . . . . . . . . . . . . . . . . . . 19 A.5. Example Encrypted CWT . . . . . . . . . . . . . . . . . . 19
A.6. Example Nested CWT . . . . . . . . . . . . . . . . . . . 20 A.6. Example Nested CWT . . . . . . . . . . . . . . . . . . . 20
A.7. Example MACed CWT with a floating-point value . . . . . . 21 A.7. Example MACed CWT with a floating-point value . . . . . . 21
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 22 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 22
Appendix C. Document History . . . . . . . . . . . . . . . . . . 22 Appendix C. Document History . . . . . . . . . . . . . . . . . . 22
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24
1. Introduction 1. Introduction
skipping to change at page 14, line 42 skipping to change at page 14, line 42
<http://www.iana.org/assignments/core-parameters/ <http://www.iana.org/assignments/core-parameters/
core-parameters.xhtml#content-formats>. core-parameters.xhtml#content-formats>.
[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,
<http://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <http://www.rfc-editor.org/info/rfc7049>. October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token [RFC7519] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
(JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015, (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015,
<http://www.rfc-editor.org/info/rfc7519>. <https://www.rfc-editor.org/info/rfc7519>.
[RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)",
RFC 8152, DOI 10.17487/RFC8152, July 2017, RFC 8152, DOI 10.17487/RFC8152, July 2017,
<http://www.rfc-editor.org/info/rfc8152>. <https://www.rfc-editor.org/info/rfc8152>.
10.2. Informative References 10.2. Informative References
[IANA.JWT.Claims] [IANA.JWT.Claims]
IANA, "JSON Web Token Claims", IANA, "JSON Web Token Claims",
<http://www.iana.org/assignments/jwt>. <http://www.iana.org/assignments/jwt>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", RFC 5226, IANA Considerations Section in RFCs", RFC 5226,
DOI 10.17487/RFC5226, May 2008, DOI 10.17487/RFC5226, May 2008,
<http://www.rfc-editor.org/info/rfc5226>. <https://www.rfc-editor.org/info/rfc5226>.
[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type
Specifications and Registration Procedures", BCP 13, Specifications and Registration Procedures", BCP 13,
RFC 6838, DOI 10.17487/RFC6838, January 2013, RFC 6838, DOI 10.17487/RFC6838, January 2013,
<http://www.rfc-editor.org/info/rfc6838>. <https://www.rfc-editor.org/info/rfc6838>.
[RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web
Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May
2015, <http://www.rfc-editor.org/info/rfc7515>. 2015, <https://www.rfc-editor.org/info/rfc7515>.
[RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", [RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)",
RFC 7516, DOI 10.17487/RFC7516, May 2015, RFC 7516, DOI 10.17487/RFC7516, May 2015,
<http://www.rfc-editor.org/info/rfc7516>. <https://www.rfc-editor.org/info/rfc7516>.
Appendix A. Examples Appendix A. Examples
This appendix includes a set of CWT examples that show how the CWT This appendix includes a set of CWT examples that show how the CWT
Claims Set can be protected. There are examples that are signed, Claims Set can be protected. There are examples that are signed,
MACed, encrypted, and that use nested signing and encryption. To MACed, encrypted, and that use nested signing and encryption. To
make the examples easier to read, they are presented both as hex make the examples easier to read, they are presented both as hex
strings and in the extended CBOR diagnostic notation described in strings and in the extended CBOR diagnostic notation described in
Section 6 of [RFC7049]. Section 6 of [RFC7049].
skipping to change at page 16, line 29 skipping to change at page 16, line 29
} }
Figure 4: Example CWT Claims Set in CBOR diagnostic notation Figure 4: 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 as Hex Encoded String A.2.1. 128-bit Symmetric Key
231f4c4d4d3051fdc2ec0a3851d5b383 a42050231f4c4d4d3051fdc2ec0a3851d5b3830104024c53796d6d6574726963
313238030a
A.2.2. 256-bit Symmetric Key as Hex Encoded String Figure 5: 128-bit symmetric COSE_Key as hex string
403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d79569388 {
/ k / -1: h'231f4c4d4d3051fdc2ec0a3851d5b383'
/ kty / 1: 4 / Symmetric /,
/ kid / 2: h'53796d6d6574726963313238' / 'Symmetric128' /,
/ alg / 3: 10 / AES-CCM-16-64-128 /
}
Figure 6: 128-bit symmetric COSE_Key in CBOR diagnostic notation
A.2.2. 256-bit Symmetric Key
a4205820403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d
795693880104024c53796d6d6574726963323536030a
Figure 7: 256-bit symmetric COSE_Key as hex string
{
/ k / -1: h'403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1
ec99192d79569388'
/ kty / 1: 4 / Symmetric /,
/ kid / 4: h'53796d6d6574726963323536' / 'Symmetric256' /,
/ alg / 3: 4 / HMAC 256/64 /
}
Figure 8: 256-bit symmetric COSE_Key in CBOR diagnostic notation
A.2.3. ECDSA P-256 256-bit COSE Key A.2.3. ECDSA P-256 256-bit COSE Key
a622582060f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168db952997 a72358206c1382765aec5358f117733d281c1c7bdc39884d04a45a1e6c67c858
1a36e7b92358206c1382765aec5358f117733d281c1c7bdc39884d04a45a1e6c bc206c1922582060f7f1a780d8a783bfb7a2dd6b2796e8128dbbcef9d3d168db
67c858bc206c1903260102215820143329cce7868e416927599cf65a34f3ce2f 9529971a36e7b9215820143329cce7868e416927599cf65a34f3ce2ffda55a7e
fda55a7eca69ed8919a394d42f0f2001 ca69ed8919a394d42f0f2001010202524173796d6d6574726963454344534132
35360326
Figure 5: ECDSA 256-bit COSE Key as hex string Figure 9: 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
23536' / 'AsymmetricECDSA256' /,
/ alg / 3: -7 / ECDSA 256 / / alg / 3: -7 / ECDSA 256 /
} }
Figure 6: ECDSA 256-bit COSE Key in CBOR diagnostic notation Figure 10: 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.
d28443a10126a05850a70175636f61703a2f2f61732e6578616d706c652e636f6 d28443a10126a104524173796d6d657472696345434453413235365850a701756
d02656572696b77037818636f61703a2f2f6c696768742e6578616d706c652e63 36f61703a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f
6f6d041a5612aeb0051a5610d9f0061a5610d9f007420b7158405427c1ff28d23 61703a2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d
fbad1f29c4c7c6a555e601d6fa29f9179bc3d7438bacaca5acd08c8d4d4f96131 9f0061a5610d9f007420b7158405427c1ff28d23fbad1f29c4c7c6a555e601d6f
680c429a01f85951ecee743a52b9b63632c57209120e1c9e30 a29f9179bc3d7438bacaca5acd08c8d4d4f96131680c429a01f85951ecee743a5
2b9b63632c57209120e1c9e30
Figure 7: Signed CWT as hex string Figure 11: 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
23536' / 'AsymmetricECDSA256' /
},
/ payload / << { / payload / << {
/ 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'
} >>, } >>,
/ signature / h'5427c1ff28d23fbad1f29c4c7c6a555e601d6fa29f / signature / h'5427c1ff28d23fbad1f29c4c7c6a555e601d6fa29f
9179bc3d7438bacaca5acd08c8d4d4f96131680c42 9179bc3d7438bacaca5acd08c8d4d4f96131680c42
9a01f85951ecee743a52b9b63632c57209120e1c9e 9a01f85951ecee743a52b9b63632c57209120e1c9e
30' 30'
] ]
) )
Figure 8: Signed CWT in CBOR diagnostic notation Figure 12: 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.
d83dd18443a10104a05850a70175636f61703a2f2f61732e6578616d706c652e d83dd18443a10104a1044c53796d6d65747269633235365850a70175636f6170
636f6d02656572696b77037818636f61703a2f2f6c696768742e6578616d706c 3a2f2f61732e6578616d706c652e636f6d02656572696b77037818636f61703a
652e636f6d041a5612aeb0051a5610d9f0061a5610d9f007420b7148093101ef 2f2f6c696768742e6578616d706c652e636f6d041a5612aeb0051a5610d9f006
6d789200 1a5610d9f007420b7148093101ef6d789200
Figure 9: MACed CWT with CWT tag as hex string Figure 13: 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' /
},
/ payload / << { / payload / << {
/ 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'
} >>, } >>,
/ tag / h'093101ef6d789200' / tag / h'093101ef6d789200'
] ]
) )
) )
Figure 10: MACed CWT with CWT tag in CBOR diagnostic notation Figure 14: 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.
d08343a1010aa1054d99a0d7846e762c49ffe8a63e0b5858b918a11fd81e438b d08343a1010aa2044c53796d6d6574726963313238054d99a0d7846e762c49ff
7f973d9e2e119bcb22424ba0f38a80f27562f400ee1d0d6c0fdb559c02421fd3 e8a63e0b5858b918a11fd81e438b7f973d9e2e119bcb22424ba0f38a80f27562
84fc2ebe22d7071378b0ea7428fff157444d45f7e6afcda1aae5f6495830c586 f400ee1d0d6c0fdb559c02421fd384fc2ebe22d7071378b0ea7428fff157444d
27087fc5b4974f319a8707a635dd643b 45f7e6afcda1aae5f6495830c58627087fc5b4974f319a8707a635dd643b
Figure 11: Encrypted CWT as hex string Figure 15: 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 / {
/ iv / 5: h'99a0d7846e762c49ffe8a63e0b' / kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /,
/ iv / 5: h'99a0d7846e762c49ffe8a63e0b'
}, },
/ ciphertext / h'b918a11fd81e438b7f973d9e2e119bcb22424ba0f38 / ciphertext / h'b918a11fd81e438b7f973d9e2e119bcb22424ba0f38
a80f27562f400ee1d0d6c0fdb559c02421fd384fc2e a80f27562f400ee1d0d6c0fdb559c02421fd384fc2e
be22d7071378b0ea7428fff157444d45f7e6afcda1a be22d7071378b0ea7428fff157444d45f7e6afcda1a
ae5f6495830c58627087fc5b4974f319a8707a635dd ae5f6495830c58627087fc5b4974f319a8707a635dd
643b' 643b'
] ]
) )
Figure 12: Encrypted CWT in CBOR diagnostic notation Figure 16: 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.
d08343a1010aa1054d86bbd41cc32604396324b7f38058a372439fbff538aa7b d08343a1010aa2044c53796d6d6574726963313238054d4a0694c0e69ee6b595
601ebfb29454050a3c99fd13b27216d084556496c7355c4bb462510f8e0e8479 6655c7b258b7f6b0914f993de822cc47e5e57a188d7960b528a747446fe12f0e
dbe08722d620e96bcb7764d75140d96220f062679b46b897e7abe0c325dc2c96 7de05650dec74724366763f167a29c002dfd15b34d8993391cf49bc91127f545
d8bb2c8334e3b92a42c0078983e753c054e647ad5387ed149f802f52b5a95ebf dba8703d66f5b7f1ae91237503d371e6333df9708d78c4fb8a8386c8ff09dc49
5f153c4fd64854ab7531e082b7f22721f939d257c94f8bc248e1d9cf04f9dd4e af768b23179deab78d96490a66d5724fb33900c60799d9872fac6da3bdb89043
5de7ab62df37842fabec230a657d4abf7162bc786345ebb8eb3af0 d67c2a05414ce331b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bff142631
610a7e0f677b7e9b0bc73adefdcee16d9d5d284c616abeab5d8c291ce0
Figure 13: Signed and Encrypted CWT as hex string Figure 17: 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 / {
/ iv / 5: h'86bbd41cc32604396324b7f380' / kid / 4: h'53796d6d6574726963313238' / 'Symmetric128' /,
/ iv / 5: h'86bbd41cc32604396324b7f380'
}, },
/ ciphertext / h'72439fbff538aa7b601ebfb29454050a3c99fd13b27 / ciphertext / h'f6b0914f993de822cc47e5e57a188d7960b528a7474
216d084556496c7355c4bb462510f8e0e8479dbe087 46fe12f0e7de05650dec74724366763f167a29c002d
22d620e96bcb7764d75140d96220f062679b46b897e fd15b34d8993391cf49bc91127f545dba8703d66f5b
7abe0c325dc2c96d8bb2c8334e3b92a42c0078983e7 7f1ae91237503d371e6333df9708d78c4fb8a8386c8
53c054e647ad5387ed149f802f52b5a95ebf5f153c4 ff09dc49af768b23179deab78d96490a66d5724fb33
fd64854ab7531e082b7f22721f939d257c94f8bc248 900c60799d9872fac6da3bdb89043d67c2a05414ce3
e1d9cf04f9dd4e5de7ab62df37842fabec230a657d4 31b5b8f1ed8ff7138f45905db2c4d5bc8045ab372bf
abf7162bc786345ebb8eb3af0' f142631610a7e0f677b7e9b0bc73adefdcee16d9d5d
284c616abeab5d8c291ce0'
] ]
) )
Figure 14: Signed and Encrypted CWT in CBOR diagnostic notation Figure 18: 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.
d18443a10104a04ba106fb41d584367c20000048b8816f34c0542892 d18443a10104a1044c53796d6d65747269633235364ba106fb41d584367c2000
0048b8816f34c0542892
Figure 15: MACed CWT with a floating-point value as hex string Figure 19: 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' /,
},
/ payload / << { / payload / << {
/ iat / 6: 1443944944.5 / iat / 6: 1443944944.5
} >>, } >>,
/ tag / h'b8816f34c0542892' / tag / h'b8816f34c0542892'
] ]
) )
Figure 16: MACed CWT with a floating-point value in CBOR diagnostic Figure 20: MACed CWT with a floating-point value in CBOR diagnostic
notation notation
Appendix B. Acknowledgements Appendix B. 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, notably Carsten incorporates suggestions made by many people, notably Carsten
Bormann, Jim Schaad, Ludwig Seitz, and Goeran Selander. Bormann, Jim Schaad, Ludwig Seitz, and Goeran Selander.
Appendix C. Document History Appendix C. Document History
[[ to be removed by the RFC Editor before publication as an RFC ]] [[ to be removed by the RFC Editor before publication as an RFC ]]
-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 -08
o Updated the diagnostic notation for embedded objects in the o Updated the diagnostic notation for embedded objects in the
examples, addressing feedback by Carsten Bormann. examples, addressing feedback by Carsten Bormann.
-07 -07
o Updated examples for signing and encryption. Signatures are now o Updated examples for signing and encryption. Signatures are now
deterministic as recommended by COSE specification. deterministic as recommended by COSE specification.
 End of changes. 45 change blocks. 
70 lines changed or deleted 118 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/