@@ -3126,110 +3126,136 @@ <h4>Semantic Interoperability</h4>
3126
3126
< section >
3127
3127
< h2 > Integrity of Related Resources</ h2 >
3128
3128
< 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=].
3148
3137
</ p >
3138
+
3149
3139
< p class ="issue " title ="Mandatory listing of contexts in relatedResouce are under debate. ">
3150
3140
The requirement that contexts be listed in `relatedResource` is currently being
3151
3141
debated in the VCWG. This requirement might be removed in future iterations of
3152
3142
the specification.
3153
3143
</ p >
3144
+
3154
3145
< 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:
3160
3148
</ 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
+
3161
3196
< p class ="issue " title ="Unification of cryptographic hash expression formats are under discussion ">
3162
3197
The Working Group is currently attempting to determine whether cryptographic hash
3163
3198
expression formats can be unified across all of the VCWG core specifications.
3164
3199
Candidates for this mechanism include `digestSRI` and `digestMultibase`. There
3165
3200
are arguments for and against unification that the WG is currently debating.
3166
3201
</ p >
3202
+
3167
3203
< 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:
3176
3206
</ p >
3177
3207
< ul >
3178
3208
< 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
3185
3210
</ li >
3186
3211
< 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.
3189
3213
</ li >
3190
3214
</ ul >
3191
3215
3192
3216
< p >
3193
- Any object in the [=verifiable credential=] that contains an `id` [[URL]]
3217
+ Any object in the [=verifiable credential=] that contains an `id`
3194
3218
property MAY be annotated with integrity information as specified in this
3195
- section by inclusion of `digestSRI`
3196
- in the object.
3219
+ section.
3197
3220
</ p >
3221
+
3198
3222
< 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.
3201
3225
</ p >
3226
+
3202
3227
< p >
3203
3228
Specification authors that write algorithms that fetch a resource based on the
3204
3229
`id` of an object inside a [=conforming document=] need to consider whether
3205
3230
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.
3208
3233
</ p >
3209
3234
< p >
3210
3235
Implementers are urged to consult appropriate sources, such as the
3211
3236
< a href ="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf ">
3212
3237
FIPS 180-4 Secure Hash Standard</ a > and the
3213
3238
< a href ="https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF ">
3214
3239
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
3216
3241
`sha384` SHOULD be considered the minimum strength hash algorithm for use by
3217
3242
implementers.
3218
3243
</ p >
3219
3244
< p class ="issue ">
3220
3245
The working group is discussing if we will adopt more aspects of subresource
3221
3246
integrity as defined in [[SRI]] is adopted into the [[JSON-LD11]] specification as
3222
3247
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.
3226
3252
</ p >
3227
3253
< p >
3228
3254
An example of a related resource integrity object referencing JSON-LD contexts.
3229
3255
</ p >
3230
3256
3231
3257
< pre class ="example nohighlight "
3232
- title ="Usage of the relatedResource property ">
3258
+ title ="Usage of the relatedResource and digestSRI property ">
3233
3259
"relatedResource": [{
3234
3260
"id": "https://www.w3.org/ns/credentials/v2",
3235
3261
"digestSRI":
@@ -3252,9 +3278,8 @@ <h2>Integrity of Related Resources</h2>
3252
3278
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
3253
3279
"image": {
3254
3280
"id": "https://university.example.org/images/58473",
3255
- "digestSRI":
3256
- "sha384-ZfAwuJmMgoX3s86L7x9XSPi3AEbiz6S/5SyGHJPCxWHs5NEth/c5S9QoS1zZft+J",
3257
3281
"mediaType": "application/svg+xml",
3282
+ "digestMultibase": "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"
3258
3283
},
3259
3284
...
3260
3285
}
0 commit comments