Skip to content

Commit f7fbfeb

Browse files
authored
Merge pull request #142 from ietf-wg-jose/proof-and-presentation-keys
Change Issued JWK / Presented JWK Protected Headers
2 parents f22dbdb + 88bc11a commit f7fbfeb

File tree

4 files changed

+81
-60
lines changed

4 files changed

+81
-60
lines changed

draft-ietf-jose-json-proof-algorithms.md

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ organization = "Ping Identity"
4646

4747
.# Abstract
4848

49-
The JSON Proof Algorithms (JPA) specification registers cryptographic algorithms and identifiers to be used with the JSON Web Proof and JSON Web Key (JWK) specifications. It defines IANA registries for these identifiers.
49+
The JSON Proof Algorithms (JPA) specification registers cryptographic algorithms and identifiers to be used with the JSON Web Proof, JSON Web Key (JWK), and COSE specifications. It defines IANA registries for these identifiers.
5050

5151
{mainmatter}
5252

@@ -160,9 +160,9 @@ Each individual payload is signed using the selected internal algorithm using th
160160

161161
### Issuer Protected Header
162162

163-
The JWK of the issuer's Ephemeral Key MUST be included in the issuer protected header with the property name of `proof_jwk` and contain only the REQUIRED values to represent the public key.
163+
The issuer's Ephemeral Key MUST be included in the issuer protected header via the Proof Key header parameter.
164164

165-
The holder's Presentation Key JWK MUST be included in issuer protected header using the `presentation_jwk` parameter.
165+
The holder's Presentation Key MUST be included in issuer protected header via the Presentation Key header parameter.
166166

167167
The issuer protected header is signed using the given JWA and the issuer's Stable Key.
168168

@@ -199,9 +199,9 @@ Since the individual signatures in the proof value are unique and remain unchang
199199

200200
### Verification
201201

202-
The verifier MUST verify the issuer protected header octets against the first part in the proof using the issuer's Stable Key. It MUST also verify the presentation protected header octets against the second part in the proof value using the holder's Presentation Key, as provided in the `presentation_jwk` claim in the issuer protected header.
202+
The verifier MUST verify the issuer protected header octets against the first part in the proof using the issuer's Stable Key. It MUST also verify the presentation protected header octets against the second part in the proof value using the holder's Presentation Key, as provided in the Presentation Key header parameter.
203203

204-
With the headers verified, the issuer's Ephemeral Key as given in the issuer protected header `proof_jwk` parameter can then be used to verify each of the disclosed payload signatures.
204+
With the headers verified, the Proof Key header parameter can then be used to verify each of the disclosed payload signatures.
205205

206206
### JPA Registration {#SU-registration}
207207

@@ -221,11 +221,9 @@ The `BBS-PROOF` `alg` parameter value in the presentation protected header corre
221221

222222
### Key Format
223223

224-
The key used for the `BBS` algorithm is an elliptic curve-based key pair, specifically against the G_2 subgroup of a pairing friendly curve. Additional details on key generation can be found in [@!I-D.irtf-cfrg-bbs-signatures, Section 3.4]
224+
The key used for the `BBS` algorithm is an elliptic curve-based key pair, specifically against the G_2 subgroup of a pairing friendly curve. Additional details on key generation can be found in [@!I-D.irtf-cfrg-bbs-signatures, Section 3.4]. The JWK and Cose Key Object representations of the key are detailed in [@!I-D.ietf-cose-bls-key-representations].
225225

226-
The JWK form of this key is an `OKP` type with a curve of `BLS12381G2`, with `x` being the base64url-encoded form of the output of `point_to_octets_E2`. The use of this curve is described in [@!I-D.ietf-cose-bls-key-representations].
227-
228-
There is no additional holder key necessary for presentation proofs.
226+
There is no additional holder presentation key necessary for presentation proofs.
229227

230228
### Issuance
231229

@@ -269,22 +267,16 @@ The design is intentionally minimal and only involves using a single standardize
269267

270268
### Holder Setup
271269

272-
Prior to the issuer creating a new JWP, it must have presentation binding information provided by the holder. This enables the holder to perform replay prevention while presenting the JWP.
273-
274-
The presentation key used by the holder must be transferred to the issuer and verified, likely through a challenge and self-signing mechanism. If the holder requires unlinkability, it must also generate a new key that is verified and bound to each new JWP.
270+
Prior to the issuer creating a new JWP, the issuer MUST have a presentation public key provided by the holder.
275271

276-
How these holder presentation keys are transferred and verified is out of scope of this specification. Protocols such as OpenID Connect can be used to accomplish this. What is required by this definition is that the holder's presentation key MUST be included in the issuer's protected header using the `presentation_jwk` parameter with a JWK as the value.
272+
The holder's presentation key MUST be included in the issuer's protected header using the Presentation Key header parameter.
277273

278274
### Issuer Setup
279275

280276
To use the MAC algorithm, the issuer must have a stable public key pair to perform signing. To start the issuance process, a single 32-byte random Shared Secret must first be generated. This value will be shared privately to the holder as part of the issuer's JWP proof value.
281277

282278
The Shared Secret is used by both the issuer and holder as the MAC method's key to generate a new set of unique ephemeral keys. These keys are then used as the input to generate a MAC that protects each payload.
283279

284-
### Issuer Protected Header {#issuer-protected-header}
285-
286-
The holder's presentation key JWK MUST be included in the issuer protected header using the `presentation_jwk` parameter. The issuer MUST validate that the holder has possession of this key through a trusted mechanism such as verifying the signature of a unique nonce value from the holder.
287-
288280
### Combined MAC Representation
289281

290282
The combined MAC representation is a single octet string representing the MAC values of the issuer protected header, along with each payload provided by the issuer. This representation is signed by the issuer, but not shared - parties will recreate this octet string and verify the signature to verify the integrity of supplied issuer protected header and the integrity of any disclosed payloads.
@@ -317,7 +309,7 @@ See the JWS [Presentation Protected Header](#presentation-protected-header) sect
317309

318310
> Editor's Note: The current definition here is incomplete, the holder's signature needs to also incorporate the presented proof.
319311
320-
The first value in the presentation proof is the presentation signature. This is a signature over the presentation protected header, using the key specified by the `presentation_jwk` parameter in the issuer protected header.
312+
The first value in the presentation proof is the presentation signature. This is a signature over the presentation protected header, using the key specified by the Presentation Key header parameter in the issuer protected header.
321313

322314
The second value is the issuer signature over the Combined MAC Representation provided with the issued form.
323315

@@ -637,31 +629,6 @@ Algorithm Analysis Documents(s):
637629
* Specification Document(s): (#MAC-registration) of this specification
638630
* Algorithm Analysis Documents(s): n/a
639631

640-
## JSON Web Proof Header Parameters Registration {#HdrReg}
641-
642-
This section registers the following JWP Header Parameters in the
643-
IANA "JSON Web Proof Header Parameters" registry
644-
established by [@!I-D.ietf-jose-json-web-proof].
645-
646-
### Registry Contents {#HdrContents}
647-
648-
#### Proof JWK Header Parameter
649-
650-
* Header Parameter Name: `proof_jwk`
651-
* Header Parameter Description: Issuer's Ephemeral Key
652-
* Header Parameter Usage Location(s): Issued
653-
* Change Controller: IETF
654-
* Specification Document(s): (#issuer-protected-header) of this specification
655-
656-
#### Presentation JWK Header Parameter
657-
658-
* Header Parameter Name: `presentation_jwk`
659-
* Header Parameter Description: Holder's Presentation Key
660-
* Header Parameter Usage Location(s): Issued
661-
* Change Controller: IETF
662-
* Specification Document(s): (#issuer-protected-header) of this specification
663-
664-
665632
{backmatter}
666633

667634
<reference anchor="VC-DATA-MODEL-2.0" target="https://www.w3.org/TR/vc-data-model-2.0">
@@ -686,7 +653,6 @@ established by [@!I-D.ietf-jose-json-web-proof].
686653
</front>
687654
</reference>
688655

689-
690656
# Example JWPs
691657

692658
The following examples use algorithms defined in JSON Proof Algorithms and also contain the keys used, so that implementations can validate these samples.
@@ -903,6 +869,17 @@ The BBS examples were generated using the library at https://github.com/mattrglo
903869

904870
[[ To be removed from the final specification ]]
905871

872+
-latest
873+
874+
* Defer BBS key definition to [@I-D.ietf-cose-bls-key-representations]
875+
* Modify example generation to use `proof_key` and `presentation_key` names
876+
* Change `proof_jwk` to `proof_key` and `presentation_jwk` to
877+
`presentation_key` to better represent that the key may be JSON
878+
or CBOR-formatted.
879+
* Moved the registry for `proof_key` and `presentation_key` to JWP
880+
where they are defined. Consolidated usage, purpose and
881+
requirements from algorith musage under these definitions.
882+
906883
-06
907884

908885
* Update reference to new repository home

draft-ietf-jose-json-web-proof.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,39 +308,52 @@ therefore, it MUST occur only within the JWP Protected Header.
308308
Use of this Header Parameter is OPTIONAL.
309309
This Header Parameter MUST be understood and processed by implementations.
310310

311-
### "proof_jwk" (Proof JWK) Header Parameter {#proof_jwkDef}
311+
### "proof_key" (Proof Key) Header Parameter {#proof_keyDef}
312+
313+
The `proof_key` (Proof Key) represents the public key used by the issuer
314+
for proof of possession within certain algorithms. This is an ephemeral
315+
key that MUST be unique for each issued JWP.
312316

313-
The `proof_jwk` (Proof JWK) represents the public key used by the issuer
314-
for proof of possession.
315317
This header parameter is references a JSON Web Key (JWK) public
316318
key value when represented as a JSON Protected Header, and a COSE Key
317319
Object when represented as a CBOR Protected Header.
318320

319321
It MUST contain only public key parameters and
320322
SHOULD contain only the minimum parameters necessary to represent the key;
321323
other parameters included can be checked for consistency and honored, or they can be ignored.
322-
This Header Parameter MUST be present in the JWP issuer header parameters
323-
and MUST be understood and processed by implementations.
324324

325-
### "presentation_jwk" (Presentation JWK) Header Parameter {#presentation_jwkDef}
325+
When present, this Header Parameter MUST be understood and processed by implementations.
326+
327+
### "presentation_key" (Presentation Key) Header Parameter {#presentation_keyDef}
328+
329+
The `presentation_key` (Presentation Key) represents the public key
330+
with certain algorithms, and is used by the holder for proof of
331+
possession and integrity protection of the presented protected header.
326332

327-
The `presentation_jwk` (Presentation JWK) represents the public key used by the holder
328-
for proof of possession.
333+
The issuer MUST validate that the holder has possession of this key
334+
through a trusted mechanism, such as requiring the signature of a
335+
unique nonce value from the holder before issuing the JWP.
329336

330337
This header parameter is references a JSON Web Key (JWK) public
331338
key value when represented as a JSON Protected Header, and a COSE Key
332339
Object when represented as a CBOR Protected Header.
333340

334-
It MUST contain only public key parameters and
335-
SHOULD contain only the minimum parameters necessary to represent the key;
336-
other parameters included can be checked for consistency and honored, or they can be ignored.
337-
This Header Parameter MUST be present in the JWP issuer header parameters
338-
and MUST be understood and processed by implementations.
341+
It MUST contain only public key parameters and SHOULD contain only the
342+
minimum parameters necessary to represent the key; other parameters
343+
included can be checked for consistency and honored, or they can be
344+
ignored.
345+
346+
If holder unlinkability is required, this value MUST not be repeated
347+
in multiple issued JWPs; a different presentation key MUST
348+
be included in each issuance.
349+
350+
This Header Parameter MUST be understood and processed by implementations when present.
339351

340352
### "iss" (Issuer) Header Parameter {#issDef}
341353

342354
The `iss` (issuer) Header Parameter identifies the principal that issued the JWP.
343355
The processing of this claim is generally application specific.
356+
344357
The `iss` value is a case-sensitive string containing a StringOrURI value.
345358
Its definition is intentionally parallel to the `iss` claim defined in [@!RFC7519].
346359

@@ -805,6 +818,24 @@ This section registers the Header Parameters defined in
805818
* Change Controller: IETF
806819
* Specification Document(s): (#claimsDef) of this specification
807820

821+
#### Proof Key Header Parameter
822+
823+
* Header Parameter Name: Proof Key
824+
* Header Parameter JSON Label: `proof_key`
825+
* Header Parameter CBOR Label: 9
826+
* Header Parameter Usage Location(s): Issued
827+
* Change Controller: IETF
828+
* Specification Document(s): (#proof_keyDef) of this specification
829+
830+
#### Presentation Key Header Parameter
831+
832+
* Header Parameter Name: Presentation Key
833+
* Header Parameter JSON Label: `presentation_key`
834+
* Header Parameter CBOR Label: 10
835+
* Header Parameter Usage Location(s): Issued
836+
* Change Controller: IETF
837+
* Specification Document(s): (#presentation_keyDef) of this specification
838+
808839
## Media Type Registration {#MediaReg}
809840

810841
### Registry Contents {#MediaContents}
@@ -1017,6 +1048,19 @@ for his valuable contributions to this specification.
10171048

10181049
[[ To be removed from the final specification ]]
10191050

1051+
-latest
1052+
1053+
* Modify example generation to use `proof_key` and `presentation_key` names
1054+
* Change `proof_jwk` to `proof_key` and `presentation_jwk` to
1055+
`presentation_key` to better represent that the key may be JSON
1056+
or CBOR-formatted.
1057+
* Moved the registry for `proof_key` and `presentation_key` to JWP
1058+
where they are defined. Consolidated usage, purpose and
1059+
requirements from algorith musage under these definitions.
1060+
* Clarified that `proof_key` and `presentation_key` are required
1061+
by particular algorithms and are not more generally required for
1062+
issued and presented JWPs.
1063+
10201064
-06
10211065

10221066
* Update reference to new repository home.

fixtures/mac-h256-fixtures.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const holderPrivateKey = crypto.createPrivateKey({
3535
/// Create Issued JWP
3636

3737
// Modify the issuer protected header by adding the Holder's public key
38-
issuerProtectedHeaderJSON.presentation_jwk = holderPublicKeyJSON;
38+
issuerProtectedHeaderJSON.presentation_key = holderPublicKeyJSON;
3939

4040
// encode/sign the issuer protected header w/ the stable key
4141
const finalIssuerProtectedHeader = JSON.stringify(issuerProtectedHeaderJSON);

fixtures/su-es256-fixtures.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const ephemeralPrivateKey = crypto.createPrivateKey({
3434
// storage as we build up
3535
const sigs = [];
3636

37-
issuerProtectedHeaderJSON.proof_jwk = ephemeralPrivateKeyJSON;
38-
issuerProtectedHeaderJSON.presentation_jwk = holderPrivateKeyJSON;
37+
issuerProtectedHeaderJSON.proof_key = ephemeralPrivateKeyJSON;
38+
issuerProtectedHeaderJSON.presentation_key = holderPrivateKeyJSON;
3939
await fs.writeFile("build/su-es256-issuer-protected-header.json", JSON.stringify(issuerProtectedHeaderJSON, null, 2), {encoding: "UTF-8"});
4040
await fs.writeFile("build/su-es256-issuer-protected-header.json.wrapped", lineWrap(JSON.stringify(issuerProtectedHeaderJSON, null, 2)), {encoding: "UTF-8"});
4141

0 commit comments

Comments
 (0)