@@ -3090,136 +3090,110 @@ <h4>Semantic Interoperability</h4>
3090
3090
< section >
3091
3091
< h2 > Integrity of Related Resources</ h2 >
3092
3092
< p >
3093
- When including a link to an external resource in a [=verifiable credential=], it
3094
- is desirable to know whether the resource has been modified after the
3095
- [=verifiable credential=] was issued. This applies to cases where there is an
3096
- external resource that is remotely retrieved, as well as to cases where the
3097
- [=issuer=] and/or [=verifier=] might have local cached copies of a resource. It
3098
- is also desirable to know that the contents of the JSON-LD context(s) used in
3099
- the [=verifiable credential=] are the same when used by both the [=issuer=] and
3100
- [=verifier=].
3093
+ When including a link to an external resource in a [=verifiable credential=],
3094
+ it is desirable to know whether the resource that is pointed to is the same at
3095
+ signing time as it is at verification time. This applies to cases where there is
3096
+ an external resource that is remotely retrieved as well as to cases where the
3097
+ [=issuer=] and/or [=verifier=] may have local cached copies of a resource.
3098
+ </ p >
3099
+ < p >
3100
+ It is also desirable to know that the contents of the JSON-LD context(s) used in
3101
+ the [=verifiable credential=] are the same when used by both the
3102
+ [=issuer=] and [=verifier=].
3103
+ </ p >
3104
+ < p >
3105
+ To validate that a resource referenced by a [=verifiable credential=] is the
3106
+ same at verification time as it is at issuing time, an implementer MAY include a
3107
+ property named < code id ="defn-relatedResource "> relatedResource</ code > that
3108
+ stores an array of objects that describe additional integrity metadata about
3109
+ each resource referenced by the [=verifiable credential=]. If
3110
+ `relatedResource` is present, there MUST be an object in the array
3111
+ for each remote resource for each context used in the verifiable credential.
3101
3112
</ p >
3102
-
3103
3113
< p class ="issue " title ="Mandatory listing of contexts in relatedResouce are under debate. ">
3104
3114
The requirement that contexts be listed in `relatedResource` is currently being
3105
3115
debated in the VCWG. This requirement might be removed in future iterations of
3106
3116
the specification.
3107
3117
</ p >
3108
-
3109
3118
< p >
3110
- To extend integrity protection to a related resource, an [=issuer=] of a
3111
- [=verifiable credential=] MAY include the `relatedResource` property:
3119
+ Each object in the `relatedResource` array MUST contain the
3120
+ following: the [[URL]] to the resource named `id` and the
3121
+ < code id ="defn-digestSRI "> digestSRI</ code > information for the resource
3122
+ constructed using the method specified in
3123
+ < a href ="https://www.w3.org/TR/SRI/#integrity-metadata "> Subresource Integrity</ a > .
3112
3124
</ p >
3113
-
3114
- < dl >
3115
- < dt id ="defn-relatedResource "> relatedResource</ dt >
3116
- < dd >
3117
- The value of the `relatedResource` property MUST be associated with one or
3118
- more objects of the following form:
3119
- < table class ="simple ">
3120
- < thead >
3121
- < th > Property</ th >
3122
- < th > Description</ th >
3123
- </ thead >
3124
- < tbody >
3125
- < tr >
3126
- < td > `id`</ td >
3127
- < td >
3128
- The identifier for the resource is REQUIRED and conforms to the format defined
3129
- in Section [[[#identifiers]]]. The value MUST be unique among the list of
3130
- related resource objects.
3131
- </ td >
3132
- </ tr >
3133
- < tr >
3134
- < td > `mediaType`</ td >
3135
- < td >
3136
- An OPTIONAL valid media type as listed in the
3137
- < a href ="https://www.iana.org/assignments/media-types/media-types.xhtml ">
3138
- IANA Media Types</ a > registry.
3139
- </ td >
3140
- </ tr >
3141
- < tr >
3142
- < td > `digestSRI`</ td >
3143
- < td >
3144
- A cryptographic digest, as defined in [[[SRI]]].
3145
- </ td >
3146
- </ tr >
3147
- < tr >
3148
- < td > `digestMultibase`</ td >
3149
- < td >
3150
- A cryptographic digest, as defined in [[[VC-DATA-INTEGRITY]]].
3151
- </ td >
3152
- </ tr >
3153
- </ tbody >
3154
- </ table >
3155
- Each object associated with `relatedResource` MUST contain at least a
3156
- `digestSRI` or `digestMultibase` value.
3157
- </ dd >
3158
- </ dl >
3159
-
3160
3125
< p class ="issue " title ="Unification of cryptographic hash expression formats are under discussion ">
3161
3126
The Working Group is currently attempting to determine whether cryptographic hash
3162
3127
expression formats can be unified across all of the VCWG core specifications.
3163
3128
Candidates for this mechanism include `digestSRI` and `digestMultibase`. There
3164
3129
are arguments for and against unification that the WG is currently debating.
3165
3130
</ p >
3166
-
3167
3131
< p >
3168
- If a `mediaType` is listed, implementations that retrieve the resource
3169
- using [[[?RFC9110]]] SHOULD:
3132
+ There MUST NOT be more than one object in the `relatedResource` per
3133
+ `id`.
3134
+ </ p >
3135
+ < p >
3136
+ An object in the `relatedResource` array MAY contain a property named
3137
+ `mediaType` that indicates the expected media type for the indicated
3138
+ `resource`. If a `mediaType` is included, its value
3139
+ SHOULD:
3170
3140
</ p >
3171
3141
< ul >
3172
3142
< li >
3173
- use the media type in the `Accept` HTTP Header, and
3143
+ be a valid media type as listed in the
3144
+ < a href ="https://www.iana.org/assignments/media-types/media-types.xhtml ">
3145
+ IANA Media Types</ a > registry
3146
+ </ li >
3147
+ < li >
3148
+ be used when retrieving the content, such as via the `Accept` HTTP Header
3174
3149
</ li >
3175
3150
< li >
3176
- use the media type in the `Content-Type` HTTP Header.
3151
+ match the retrieved content media type, such as via the `Content-Type` HTTP
3152
+ Header.
3177
3153
</ li >
3178
3154
</ ul >
3179
3155
3180
3156
< p >
3181
- Any object in the [=verifiable credential=] that contains an `id`
3157
+ Any object in the [=verifiable credential=] that contains an `id` [[URL]]
3182
3158
property MAY be annotated with integrity information as specified in this
3183
- section.
3159
+ section by inclusion of `digestSRI`
3160
+ in the object.
3184
3161
</ p >
3185
-
3186
3162
< p >
3187
- Any objects for which selective disclosure or unlinkable disclosure is desired
3188
- SHOULD NOT be included as an object in the `relatedResource` array.
3163
+ Any objects for which selective disclosure is desired SHOULD NOT be included as
3164
+ an object in the `relatedResource` array.
3189
3165
</ p >
3190
-
3191
3166
< p >
3192
3167
Specification authors that write algorithms that fetch a resource based on the
3193
3168
`id` of an object inside a [=conforming document=] need to consider whether
3194
3169
that resource's content is vital to the validity of that document. If it is, the
3195
- specification MUST produce a validation error unless the resource matches the
3196
- expected media type and cryptographic digest.
3170
+ specification MUST produce a validation error unless the resource has the
3171
+ expected media type and its bytes hash to the expected digest.
3197
3172
</ p >
3198
3173
< p >
3199
3174
Implementers are urged to consult appropriate sources, such as the
3200
3175
< a href ="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf ">
3201
3176
FIPS 180-4 Secure Hash Standard</ a > and the
3202
3177
< a href ="https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF ">
3203
3178
Commercial National Security Algorithm Suite 2.0</ a > to ensure that they are
3204
- choosing a current and reliable hash algorithm. At the time of this writing
3179
+ chosing a current and reliable hash algorithm. At the time of this writing
3205
3180
`sha384` SHOULD be considered the minimum strength hash algorithm for use by
3206
3181
implementers.
3207
3182
</ p >
3208
3183
< p class ="issue ">
3209
3184
The working group is discussing if we will adopt more aspects of subresource
3210
3185
integrity as defined in [[SRI]] is adopted into the [[JSON-LD11]] specification as
3211
3186
noted in that specifications < a href ="https://www.w3.org/TR/json-ld11/#security ">
3212
- current security considerations</ a > of that specification, the
3213
- approach described in this section can serve as an additional check towards
3214
- ensuring that a cached context used when issuing
3215
- a [=verifiable credential=] matches the remote resource.
3187
+ current security considerations</ a > of that specification, this hash in the VC
3188
+ can serve as an additional check towards ensuring that a cached context used
3189
+ when issuing the VC matches the remote resource.
3216
3190
</ p >
3217
3191
< p >
3218
3192
An example of a related resource integrity object referencing JSON-LD contexts.
3219
3193
</ p >
3220
3194
3221
3195
< pre class ="example nohighlight "
3222
- title ="Usage of the relatedResource and digestSRI property ">
3196
+ title ="Usage of the relatedResource property ">
3223
3197
"relatedResource": [{
3224
3198
"id": "https://www.w3.org/ns/credentials/v2",
3225
3199
"digestSRI":
@@ -3242,8 +3216,9 @@ <h2>Integrity of Related Resources</h2>
3242
3216
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
3243
3217
"image": {
3244
3218
"id": "https://university.example.org/images/58473",
3219
+ "digestSRI":
3220
+ "sha384-ZfAwuJmMgoX3s86L7x9XSPi3AEbiz6S/5SyGHJPCxWHs5NEth/c5S9QoS1zZft+J",
3245
3221
"mediaType": "application/svg+xml",
3246
- "digestMultibase": "zQmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n"
3247
3222
},
3248
3223
...
3249
3224
}
0 commit comments