Internet-Draft | sd-cwt | August 2023 |
Prorock & Steele | Expires 5 February 2024 | [Page] |
This document describes how to perform selective disclosure of claims withing a CBOR Web Token (CWT) [RFC8392] as well as how to create and verify those tokens.¶
This document does not define any new cryptography.¶
This Internet-Draft is submitted in full conformance with the 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 and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 5 February 2024.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].¶
The following terminology is used throughout this document:¶
CBOR claims are cpommonly signed using COSE Sign1 where only one signature is placed on a particular message. There are many cases where a signer may wish to ensure that the authenticity of a message has not been compromised via a digital signature, but where they only wish to reveal some values of the original signed message. This document outlines a precise method for formulating and transmitting these messages, encompassing elements such as claims, claim keys, and necessary data structures. This kind of signed information exchange proves particularly beneficial in scenarios where a CBOR Web Token (CWT) might transit via an intermediary before undergoing third-party verification. Frequently, such a third party might necessitate, or be permitted to access only a subset of the information encapsulated in the CWT. This proposed model facilitates selective data disclosure, while still preserving the ability to validate the original signature.¶
This representation relies on claims registered in the IANA CBOR Web Token (CWT) Claims Registry whenever possible.¶
Figure 1: SD-CWT Issuance and Presentation Flow¶
+------------+ | | | Issuer | | | +------------+ | Issues SD-CWT | v +------------+ | | | Holder | | | +------------+ | Presents SD-CWT | v +-------------+ | |+ | Verifiers ||+ | ||| +-------------+|| +-------------+| +-------------+¶
An SD-CWT is a CWT of the hash digests of the claim values with unique random salts and other metadata. It MUST be digitally signed using the issuer's private key.¶
SD-CWT-CLAIMS = (METADATA, CWT-CLAIMS) SD-CWT = SD-CWT-CLAIMS | SIG(SD-CWT-CLAIMS, ISSUER-PRIV-KEY)¶
CWT-CLAIMS is a simple object with claim names mapped to hash digests over the claim values with unique random salts:¶
CWT-CLAIMS = ( CLAIM-NAME: HASH(SALT | CLAIM-VALUE) )*¶
In a case where an SD-CWT is sent with all information disclose, the SD-CWT is sent together with the mapping of the plain-text claim values, the salt values, and potentially some other information. In this case, the the payload contains the CWT-CLAIMS, and the field "disclosures" contains the mapping, the salt values, and other metadata.¶
In a case where an SD-CWT is sent with only some information discosed, only the desired claims, mappings, and salts are added to the disclosure.¶
The CDDL fragment that represents the above text for COSE_Sign1 follows.¶
SD-CWT = [ Headers, payload : bstr / nil, signature : bstr, disclosures: bstr / nil ]¶
TBD - Describe verifiacation process¶
TBD - Discuss optioinality, mechanism, and value¶
TBD- Discuss use with countersignatures in the unprotected header¶
TBD - Describe common data structures in CDDL¶
All security considerations from COSE [RFC8152] and CWT [RFC8392] SHOULD be followed.¶
To maintain the integrity of the issued claims, the Selective Disclosure-CBOR Web Token (SD-CWT) MUST be signed by the issuer. Absence of this signature leaves the SD-CWT vulnerable to attackers, who can alter or append claims (for instance, modifying the "email" attribute to hijack the victim's account or inserting a fabricated academic qualification).¶
The verifier is required to verify the signature on the SD-CWT to guarantee its authenticity and that no tampering has occurred post issuance. If the signature on the SD-CWT fails the verification process, the SD-CWT MUST be unequivocally rejected.¶
This section will register the "application/sd-cwt" media type [RFC2046] in the "Media Types" registry [IANA.MediaTypes] in the manner described in RFC 6838 [RFC6838], which can be used to indicate that the content is a CWT.¶
The authors would like to thank those that have worked on similar items for providing selective disclosure mechanisms in JSON, especially: Tobias Looker, Kristina Yasuda, Daniel Fett, Oliver Terbu, and Michael Jones.¶