Skip to content

Commit 0480bf4

Browse files
committed
Rework content integrity section based on @jyasskin's feedback.
1 parent b11eec7 commit 0480bf4

File tree

1 file changed

+79
-54
lines changed

1 file changed

+79
-54
lines changed

index.html

Lines changed: 79 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,110 +3126,136 @@ <h4>Semantic Interoperability</h4>
31263126
<section>
31273127
<h2>Integrity of Related Resources</h2>
31283128
<p>
3129-
When including a link to an external resource in a [=verifiable credential=],
3130-
it is desirable to know whether the resource that is pointed to is the same at
3131-
signing time as it is at verification time. This applies to cases where there is
3132-
an external resource that is remotely retrieved as well as to cases where the
3133-
[=issuer=] and/or [=verifier=] may have local cached copies of a resource.
3134-
</p>
3135-
<p>
3136-
It is also desirable to know that the contents of the JSON-LD context(s) used in
3137-
the [=verifiable credential=] are the same when used by both the
3138-
[=issuer=] and [=verifier=].
3139-
</p>
3140-
<p>
3141-
To validate that a resource referenced by a [=verifiable credential=] is the
3142-
same at verification time as it is at issuing time, an implementer MAY include a
3143-
property named <code id="defn-relatedResource">relatedResource</code> that
3144-
stores an array of objects that describe additional integrity metadata about
3145-
each resource referenced by the [=verifiable credential=]. If
3146-
`relatedResource` is present, there MUST be an object in the array
3147-
for each remote resource for each context used in the verifiable credential.
3129+
When including a link to an external resource in a [=verifiable credential=], it
3130+
is desirable to know whether the resource has been modified after the
3131+
[=verifiable credential=] was issued. This applies to cases where there is an
3132+
external resource that is remotely retrieved, as well as to cases where the
3133+
[=issuer=] and/or [=verifier=] might have local cached copies of a resource. It
3134+
is also desirable to know that the contents of the JSON-LD context(s) used in
3135+
the [=verifiable credential=] are the same when used by both the [=issuer=] and
3136+
[=verifier=].
31483137
</p>
3138+
31493139
<p class="issue" title="Mandatory listing of contexts in relatedResouce are under debate.">
31503140
The requirement that contexts be listed in `relatedResource` is currently being
31513141
debated in the VCWG. This requirement might be removed in future iterations of
31523142
the specification.
31533143
</p>
3144+
31543145
<p>
3155-
Each object in the `relatedResource` array MUST contain the
3156-
following: the [[URL]] to the resource named `id` and the
3157-
<code id="defn-digestSRI">digestSRI</code> information for the resource
3158-
constructed using the method specified in
3159-
<a href="https://www.w3.org/TR/SRI/#integrity-metadata">Subresource Integrity</a>.
3146+
To extend integrity protection to a related resource, an [=issuer=] of a
3147+
[=verifiable credential=] MAY include the `relatedResource` property:
31603148
</p>
3149+
3150+
<dl>
3151+
<dt id="defn-relatedResource">relatedResource</dt>
3152+
<dd>
3153+
The value of the `relatedResource` property MUST be associated with one or
3154+
more objects of the following form:
3155+
<table class="simple">
3156+
<thead>
3157+
<th>Property</th>
3158+
<th>Description</th>
3159+
</thead>
3160+
<tbody>
3161+
<tr>
3162+
<td>`id`</td>
3163+
<td>
3164+
The identifier for the resource is REQUIRED and conforms to the format defined
3165+
in Section [[[#identifiers]]]. The value MUST be unique among the list of
3166+
related resource objects.
3167+
</td>
3168+
</tr>
3169+
<tr>
3170+
<td>`mediaType`</td>
3171+
<td>
3172+
An OPTIONAL valid media type as listed in the
3173+
<a href="https://www.iana.org/assignments/media-types/media-types.xhtml">
3174+
IANA Media Types</a> registry.
3175+
</td>
3176+
</tr>
3177+
<tr>
3178+
<td>`digestSRI`</td>
3179+
<td>
3180+
A cryptographic digest, as defined in [[[SRI]]].
3181+
</td>
3182+
</tr>
3183+
<tr>
3184+
<td>`digestMultibase`</td>
3185+
<td>
3186+
A cryptographic digest, as defined in [[[VC-DATA-INTEGRITY]]].
3187+
</td>
3188+
</tr>
3189+
</tbody>
3190+
</table>
3191+
Each object associated with `relatedResource` MUST contain at least a
3192+
`digestSRI` or `digestMultibase` value.
3193+
</dd>
3194+
</dl>
3195+
31613196
<p class="issue" title="Unification of cryptographic hash expression formats are under discussion">
31623197
The Working Group is currently attempting to determine whether cryptographic hash
31633198
expression formats can be unified across all of the VCWG core specifications.
31643199
Candidates for this mechanism include `digestSRI` and `digestMultibase`. There
31653200
are arguments for and against unification that the WG is currently debating.
31663201
</p>
3202+
31673203
<p>
3168-
There MUST NOT be more than one object in the `relatedResource` per
3169-
`id`.
3170-
</p>
3171-
<p>
3172-
An object in the `relatedResource` array MAY contain a property named
3173-
`mediaType` that indicates the expected media type for the indicated
3174-
`resource`. If a `mediaType` is included, its value
3175-
SHOULD:
3204+
If a `mediaType` is listed, implementations that retrieve the resource
3205+
using [[[?RFC9110]]] SHOULD:
31763206
</p>
31773207
<ul>
31783208
<li>
3179-
be a valid media type as listed in the
3180-
<a href="https://www.iana.org/assignments/media-types/media-types.xhtml">
3181-
IANA Media Types</a> registry
3182-
</li>
3183-
<li>
3184-
be used when retrieving the content, such as via the `Accept` HTTP Header
3209+
use the media type in the `Accept` HTTP Header, and
31853210
</li>
31863211
<li>
3187-
match the retrieved content media type, such as via the `Content-Type` HTTP
3188-
Header.
3212+
use the media type in the `Content-Type` HTTP Header.
31893213
</li>
31903214
</ul>
31913215

31923216
<p>
3193-
Any object in the [=verifiable credential=] that contains an `id` [[URL]]
3217+
Any object in the [=verifiable credential=] that contains an `id`
31943218
property MAY be annotated with integrity information as specified in this
3195-
section by inclusion of `digestSRI`
3196-
in the object.
3219+
section.
31973220
</p>
3221+
31983222
<p>
3199-
Any objects for which selective disclosure is desired SHOULD NOT be included as
3200-
an object in the `relatedResource` array.
3223+
Any objects for which selective disclosure or unlinkable disclosure is desired
3224+
SHOULD NOT be included as an object in the `relatedResource` array.
32013225
</p>
3226+
32023227
<p>
32033228
Specification authors that write algorithms that fetch a resource based on the
32043229
`id` of an object inside a [=conforming document=] need to consider whether
32053230
that resource's content is vital to the validity of that document. If it is, the
3206-
specification MUST produce a validation error unless the resource has the
3207-
expected media type and its bytes hash to the expected digest.
3231+
specification MUST produce a validation error unless the resource matches the
3232+
expected media type and cryptographic digest.
32083233
</p>
32093234
<p>
32103235
Implementers are urged to consult appropriate sources, such as the
32113236
<a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">
32123237
FIPS 180-4 Secure Hash Standard</a> and the
32133238
<a href="https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF">
32143239
Commercial National Security Algorithm Suite 2.0</a> to ensure that they are
3215-
chosing a current and reliable hash algorithm. At the time of this writing
3240+
choosing a current and reliable hash algorithm. At the time of this writing
32163241
`sha384` SHOULD be considered the minimum strength hash algorithm for use by
32173242
implementers.
32183243
</p>
32193244
<p class="issue">
32203245
The working group is discussing if we will adopt more aspects of subresource
32213246
integrity as defined in [[SRI]] is adopted into the [[JSON-LD11]] specification as
32223247
noted in that specifications <a href="https://www.w3.org/TR/json-ld11/#security">
3223-
current security considerations</a> of that specification, this hash in the VC
3224-
can serve as an additional check towards ensuring that a cached context used
3225-
when issuing the VC matches the remote resource.
3248+
current security considerations</a> of that specification, the
3249+
approach described in this section can serve as an additional check towards
3250+
ensuring that a cached context used when issuing
3251+
a [=verifiable credential=] matches the remote resource.
32263252
</p>
32273253
<p>
32283254
An example of a related resource integrity object referencing JSON-LD contexts.
32293255
</p>
32303256

32313257
<pre class="example nohighlight"
3232-
title="Usage of the relatedResource property">
3258+
title="Usage of the relatedResource and digestSRI property">
32333259
"relatedResource": [{
32343260
"id": "https://www.w3.org/ns/credentials/v2",
32353261
"digestSRI":
@@ -3252,9 +3278,8 @@ <h2>Integrity of Related Resources</h2>
32523278
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
32533279
"image": {
32543280
"id": "https://university.example.org/images/58473",
3255-
"digestSRI":
3256-
"sha384-ZfAwuJmMgoX3s86L7x9XSPi3AEbiz6S/5SyGHJPCxWHs5NEth/c5S9QoS1zZft+J",
32573281
"mediaType": "application/svg+xml",
3282+
"digestMultibase": "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"
32583283
},
32593284
...
32603285
}

0 commit comments

Comments
 (0)