-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
2474 lines (2463 loc) · 121 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<title>Securing Verifiable Credentials using JOSE and COSE</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script class="remove" src="https://cdn.jsdelivr.net/gh/w3c/[email protected]/dist/main.js"></script>
<script class="remove">
// See https://github.com/w3c/respec/wiki/ for how to configure ReSpec
var respecConfig = {
group: "vc",
// specification status (e.g., WD, NOTE, etc.). If in doubt use
// ED.
specStatus: "CR",
crEnd: "2025-01-19",
// the specification's short name, as in
// http://www.w3.org/TR/short-name/
shortName: "vc-jose-cose",
// if you wish the publication date to be other than today, set
// this
// publishDate: "2024-12-19",
implementationReportURI: "https://w3c.github.io/vc-jose-cose-test-suite/",
// errata: "https://w3c.github.io/vc-data-model/errata.html",
// if there is a previously published draft, uncomment this and
// set its YYYY-MM-DD date and its maturity status
previousPublishDate: "2024-11-05",
previousMaturity: "CR",
// extend the bibliography entries localBiblio: vcwg.localBiblio,
doJsonLd: true,
// Uncomment these to use the respec extension that generates a
// list of normative statements: preProcess: [], postProcess:
// [],
github: "https://github.com/w3c/vc-jose-cose/",
includePermalinks: false,
// if there a publicly available Editor's Draft, this is the link
edDraftURI: "https://w3c.github.io/vc-jose-cose/",
// editors, add as many as you like only "name" is required
editors: [
{
name: "Michael Jones",
url: "https://self-issued.info/",
company: "Self-Issued Consulting",
w3cid: 38745,
},
{
name: "Michael Prorock",
company: "Mesur.io", companyURL: "https://mesur.io/",
w3cid: 130636
},
{
name: "Gabe Cohen",
url: "https://github.com/decentralgabe",
company: "Invited Expert",
w3cid: 116851
}
],
// authors, add as many as you like. This is optional, uncomment
// if you have authors as well as editors. only "name" is
// required. Same format as editors.
authors: [],
formerEditors: [],
maxTocLevel: 3,
inlineCSS: true,
postProcess: [window.respecVc.createVcExamples],
license: "w3c-software-doc",
xref: ["INFRA", "VC-DATA-MODEL-2.0", "CONTROLLER-DOCUMENT"],
otherLinks: [{
key: "Related Documents",
data: [{
value: "Verifiable Credentials Data Model v2.0",
href: "https://www.w3.org/TR/vc-data-model-2.0/"
}, {
value: "Controlled Identifier Document 1.0",
href: "https://www.w3.org/TR/controller-document/"
}]
}],
localBiblio: {
"SD-JWT": {
title: "Selective Disclosure for JWTs (SD-JWT)",
href: "https://datatracker.ietf.org/doc/html/draft-ietf-oauth-selective-disclosure-jwt",
authors: ["Daniel Fett", "Kristina Yasuda", "Brian Campbell"],
status: "Internet-Draft",
publisher: "IETF"
},
"SD-JWT-VC": {
title: "SD-JWT-based Verifiable Credentials (SD-JWT VC)",
href: "https://datatracker.ietf.org/doc/html/draft-ietf-oauth-sd-jwt-vc",
authors: ["Oliver Terbu", "Daniel Fett", "Brian Campbell"],
status: "Internet-Draft",
publisher: "IETF"
},
"JOSE-REGISTRIES": {
title: "The JSON Object Signing and Encryption (JOSE) Registries",
href: "https://www.iana.org/assignments/jose",
authors: ["The Internet Assigned Numbers Authority"],
status: "REC",
publisher: "The Internet Assigned Numbers Authority"
},
"SP-800-122": {
title: "Guide to Protecting the Confidentiality of Personally Identifiable Information (PII)",
href: "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-122.pdf",
authors: ["Erika McCallister", "Tim Grance", "Karen Scarfone"],
status: "Special Publication 800-122",
publisher: "NIST"
},
}
};
</script>
</head>
<body>
<section id="abstract">
<p>
This specification defines how to secure credentials and presentations
conforming to the Verifiable Credential data model [[VC-DATA-MODEL-2.0]]
with JSON Object Signing and Encryption
(<a href="https://datatracker.ietf.org/wg/jose/about/">JOSE</a>),
Selective Disclosure for JWTs [[SD-JWT]],
and CBOR Object Signing and Encryption (COSE) [[RFC9052]].
This enables the Verifiable Credential data model [[VC-DATA-MODEL-2.0]]
to be implemented with standards for signing and encryption that are
widely adopted.
</p>
</section>
<section id="sotd">
<p>
The Working Group is actively seeking implementation feedback for this
specification. In order to exit the Candidate Recommendation phase, the
Working Group has set the requirement of at least two independent
implementations for each mandatory feature in the specification. For
details on the conformance testing process, see the test suite listed in
the <a href="https://w3c.github.io/vc-jose-cose-test-suite/">
implementation report</a>.
</p>
</section>
<section id="introduction">
<h2 id="section-introduction">Introduction</h2>
<p>
This specification defines how to secure media types expressing
Verifiable Credentials and Verifiable Presentations as described in
[[VC-DATA-MODEL-2.0]] using approaches defined by the JOSE, OAuth, and
COSE working groups at the IETF. This includes JSON Web Signature (JWS)
[[RFC7515]], Selective Disclosure for JWTs [[SD-JWT]],
and CBOR Object Signing and Encryption (COSE) [[RFC9052]].
It uses content types [[RFC6838]] to distinguish between the data types
of unsecured documents conforming to [[VC-DATA-MODEL-2.0]] and the data
types of secured documents conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
JSON Web Signature (JWS) [[RFC7515]] defines a standard means of
digitally signing documents, including JSON documents, using JSON-based
data structures. It provides a means to ensure the integrity,
authenticity, and non-repudiation of the information contained in the
document. Selective Disclosure for JWTs (SD-JWT) [[SD-JWT]] builds on
JWS by also providing a mechanism enabling selective disclosure of
document elements. These properties make JWS and SD-JWT especially
well-suited to securing documents conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
CBOR Object Signing and Encryption (COSE) [[RFC9052]] defines a standard
means of representing digitally signed data structures using
Concise Binary Object Representation (CBOR) [[RFC8949]]. Like JWS, COSE
provides a standardized way to secure the integrity, authenticity, and
confidentiality of information. It offers a flexible and extensible set
of cryptographic options, allowing for a wide range of algorithms
to be used for signing and encryption.
</p>
<p>
COSE supports two main operations: signing and encryption. For signing,
COSE allows the creation of digital signatures over CBOR data using
various algorithms such as RSA, ECDSA, and EdDSA. These signatures
provide assurance of data integrity and authenticity. COSE also supports
encryption, enabling the confidentiality of CBOR data by encrypting it
with symmetric or asymmetric encryption algorithms.
</p>
<section id="conformance">
<section>
<h2 id="conformance-classes">Conformance Classes</h2>
<p>
A <dfn>conforming JWS document</dfn> is one that conforms to all of
the "MUST" statements in Section <a href="#secure-with-jose"></a>.
</p>
<p>
A <dfn>conforming JWS issuer implementation</dfn> produces
[=conforming JWS documents=] and MUST secure them as described in
Section <a href="#secure-with-jose"></a>.
<p>
A <dfn>conforming JWS verifier implementation</dfn> verifies
[=conforming JWS documents=] as described in Section
<a href="#secure-with-jose"></a>.
</p>
<p>
A <dfn>conforming SD-JWT document</dfn> is one that conforms to all
of the "MUST" statements in Section <a href="#secure-with-sd-jwt"></a>.
</p>
<p>
A <dfn>conforming SD-JWT issuer implementation</dfn> produces
[=conforming SD-JWT documents=] and MUST secure them as described
in Section <a href="#secure-with-sd-jwt"></a>.
<p>
A <dfn>conforming SD-JWT verifier implementation</dfn> verifies
[=conforming SD-JWT documents=] as described in Section
<a href="#secure-with-sd-jwt"></a>.
</p>
<p>
A <dfn>conforming COSE document</dfn> is one that conforms to all
of the "MUST" statements in Section <a href="#secure-with-cose"></a>.
</p>
<p>
A <dfn>conforming COSE issuer implementation</dfn> produces
[=conforming COSE documents=] and MUST secure them as described in
Section <a href="#secure-with-cose"></a>.
</p>
<p>
A <dfn>conforming COSE verifier implementation</dfn> verifies
[=conforming COSE documents=] as described in Section
<a href="#secure-with-cose"></a>.
</p>
</section>
<section>
<h2 id="securing-verifiable-credentials">Securing Verifiable Credentials</h2>
<p>
The <a data-cite="VC-DATA-MODEL-2.0#securing-mechanism-specifications"></a>
describes the approach taken by this specification to secure JSON
and CBOR claims by <i>applying an <code>enveloping proof</code></i>.
</p>
<p>
This specification defines how to secure different data structures
using various <code>enveloping proof</code> mechanisms:
</p>
<dl>
<dt>JSON Web Token (JWT):</dt>
<dd>A JWT secures a JWT Claims Set, in its entirety. A JWT Claims Set
is a JSON object containing one or more claims about an entity
(typically the subject of the JWT). If any part of the
JWT Claims Set is to be revealed, all claims in that set must be
revealed; there is no option to reveal (or conceal) <i>some</i> of
the claims while concealing (or revealing) the others.
</dd>
<dt>Selective Disclosure JSON Web Token (SD-JWT):</dt>
<dd>
An SD-JWT secures a JWT Claims Set, similar to a JWT securing
a JWT Claims Set, but with the added capabilities of selectively
revealing or withholding parts of the JWT Claims Set.
A JWT Claims Set is one or more claims about an entity
(typically the subject of the SD-JWT).
</dd>
<dt>CBOR Object Signing and Encryption (COSE):</dt>
<dd>
COSE secures CBOR (Concise Binary Object Representation) data structures.
CBOR is a binary data format that is more compact than JSON and is
designed for constrained environments.
</dd>
</dl>
<p>In the context of Verifiable Credentials:</p>
<ul>
<li>
When using JWTs,
the Verifiable Credential or Presentation is encoded as a JWT Claims Set.
</li>
<li>
When using SD-JWTs,
the Verifiable Credential or Presentation is encoded as a JWT Claims Set with Selective Disclosure features.
</li>
<li>
When using COSE,
the Verifiable Credential or Presentation is encoded as a CBOR data structure.
</li>
</ul>
<p>
In all cases, the underlying data model of the Verifiable Credential
or Presentation remains consistent with the [[VC-DATA-MODEL-2.0]],
but the encoding and security mechanisms differ.
</p>
<p>
The normative statements in <a data-cite="VC-DATA-MODEL-2.0#securing-mechanisms">
Securing Mechanisms</a> apply to securing
<code>application/vc+jwt</code> and
<code>application/vp+jwt</code>,
<code>application/vc+sd-jwt</code> and
<code>application/vp+sd-jwt</code>,
<code>application/vc+cose</code> and
<code>application/vp+cose</code>.
</p>
<section>
<h2>JWT Format and Requirements</h2>
<p>
JSON Web Token implementers are advised to review
<a data-cite="RFC7519#section-8">Implementation Requirements</a>.
</p>
<p>
Issuers, Holders, and Verifiers of JWTs MUST understand the effect
of the JSON Web Token header parameter setting of
<code>"alg": "none"</code> when using JSON Web Tokens to secure
[[VC-DATA-MODEL-2.0]]. When content types from the
[[VC-DATA-MODEL-2.0]] are secured using JSON Web Tokens, the
header parameter setting of <code>"alg": "none"</code>
is used to communicate that a Verifiable Credential or
Verifiable Presentation encoded as a JWT Claims Set has no
integrity protection.
</p>
<p>
Issuers, Holders, and Verifiers MUST ignore all JWT Claims Sets
that have no integrity protection.
</p>
<p>
The JWT Claim Names <code>vc</code> and <code>vp</code>
MUST NOT be present in any JWT Claims Set that comprises a
[=verifiable credential=] or a [=verifiable presentation=].
</p>
</section>
<section>
<h2>SD-JWT Format and Requirements</h2>
<p>
This specification uses Selective Disclosure for JWTs (SD-JWT) as
defined in the IETF draft [[SD-JWT]]. Implementers SHOULD refer to
this draft for the full details of the SD-JWT format and
processing requirements.
</p>
<ul>
<li>An SD-JWT consists of three main parts: the
SD-JWT itself, optional disclosures, and an optional KB-JWT (Key
Binding JWT). These parts are separated by tilde (~) characters.
</li>
<li>If the KB-JWT is not present, the SD-JWT must end with a
tilde (~) character. This is crucial for correct parsing and
processing of the SD-JWT.
</li>
<li>Selective disclosure is achieved through the use of
disclosure objects. These are base64url-encoded JSON arrays
containing the digest of the disclosed claim, the claim name,
and the claim value.
</li>
<li>Each disclosable claim is combined with a salt value
before hashing to prevent dictionary attacks.
</li>
</ul>
</section>
</section>
</section>
</section>
<section>
<h3 id="terminology">Terminology</h3>
<p>
This section defines the terms used in this specification. A link to
these terms is included whenever they appear in this specification.
</p>
<dl class="termlist">
<dt><dfn>public key</dfn></dt>
<dd>
Cryptographic material that can be used to verify digital proofs
created with a corresponding <a>private key</a>.
</dd>
<dt><dfn>private key</dfn></dt>
<dd>
Cryptographic material that can be used to generate digital proofs.
</dd>
<dt><dfn data-lt="verifiable credentials">verifiable credential</dfn></dt>
<dd>
A standard data model and representation format for expressing
cryptographically-verifiable digital credentials, as defined by the W3C
Verifiable Credentials specification [[VC-DATA-MODEL-2.0]].
</dd>
<dt><dfn>controlled identifier document</dfn></dt>
<dd>
A document that contains public cryptographic material as defined in
the [[[CONTROLLER-DOCUMENT]]] specification.
</dd>
</dl>
</section>
<section>
<h2 id="securing-the-vc-data-model">Securing the VC Data Model</h2>
<p>
This section outlines how to secure documents conforming
to [[VC-DATA-MODEL-2.0]] using JOSE, SD-JWT, and COSE.
</p>
<p>
Documents conforming to [[VC-DATA-MODEL-2.0]],
and their associated media types, rely on
JSON-LD, which is an extensible format for describing
linked data; see
<a data-cite="JSON-LD11#relationship-to-rdf">JSON-LD Relationship to RDF</a>.
</p>
<p>
A benefit to this approach is that payloads can be made to conform
directly to [[VC-DATA-MODEL-2.0]] without any mappings or
transformation, while at the same time supporting registered
header parameters and claims that are understood in the context of JOSE,
SD-JWT, and COSE.
</p>
<p>
It is RECOMMENDED that media types be used to distinguish
<a data-cite="VC-DATA-MODEL-2.0#credentials">verifiable credentials</a>
and <a data-cite="VC-DATA-MODEL-2.0#presentations">verifiable presentations</a>
from other kinds of secured JSON or CBOR.
</p>
<p>
The most specific media type (or subtype) available SHOULD be used,
instead of more generic media types (or supertypes). For example, rather
than the general <code>application/sd-jwt</code>,
<code>application/vc+sd-jwt</code> SHOULD be used, unless there is a
more specific media type that would even better identify the secured
envelope format.
</p>
<p>
If implementations do not know which media type to use, media types
defined in this specification MUST be used.
</p>
<section id="secure-with-jose">
<h2 id="with-jose">With JOSE</h2>
<section>
<h2 id="securing-with-jose">Securing JSON-LD Verifiable Credentials
with JOSE</h2>
<p>
This section details how to use JOSE to secure
[=verifiable credentials=] conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
A [=conforming JWS issuer implementation=] MUST use [[RFC7515]] to
secure this media type. The unsecured [=verifiable credential=] is
the unencoded JWS payload.
</p>
<p>
The <code>typ</code> header parameter SHOULD be <code>vc+jwt</code>.
When present, the <code>cty</code> header parameter SHOULD be
<code>vc</code>.
The <code>cty</code> header parameter value can be used to differentiate
between secured content of different types when using <code>vc+jwt</code>.
The <code>content type</code> header parameter is optional, and can be used
to express a more specific media type than <code>application/vc</code> when one is available.
See <a data-cite="RFC7515#section-4.1">Registered Header Parameter Names</a>
for additional details regarding usage of <code>typ</code> and <code>cty</code>.
</p>
<p>
A [=conforming JWS verifier implementation=] MUST use [[RFC7515]] to
verify [=conforming JWS documents=] that use this media type.
</p>
<p>
To encrypt a secured [=verifiable credential=] when transmitting
over an insecure channel, implementers MAY use
JSON Web Encryption (JWE) [[RFC7516]] by nesting the secured
[=verifiable credential=] as the plaintext payload of a JWE, per the
description of Nested JWTs in [[RFC7519]].
</p>
<pre class="example nohighlight vc" data-vc-tabs="jose" title="A simple example of a verifiable credential secured with JOSE">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"id": "http://university.example/credentials/3732",
"type": ["VerifiableCredential", "ExampleDegreeCredential", "ExamplePersonCredential"],
"issuer": "https://university.example/issuers/14",
"validFrom": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "ExampleBachelorDegree",
"name": "Bachelor of Science and Arts"
},
"alumniOf": {
"name": "Example University"
}
},
"credentialSchema": [{
"id": "https://example.org/examples/degree.json",
"type": "JsonSchema"
},
{
"id": "https://example.org/examples/alumni.json",
"type": "JsonSchema"
}]
}
</pre>
<p>
See <a
data-cite="VC-DATA-MODEL-2.0#example-using-the-credentialschema-property-to-perform-json-schema-validation"></a>
for more details regarding this example.
</p>
</section>
<section>
<h2 id="securing-vps-with-jose">Securing JSON-LD
Verifiable Presentations with JOSE</h2>
<p>
This section details how to use JOSE to secure
[=verifiable presentations=] conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
A [=conforming JWS issuer implementation=] MUST use [[RFC7515]] to
secure this media type. The unsecured [=verifiable presentation=] is
the unencoded JWS payload.
</p>
<p>
The <code>typ</code> header parameter SHOULD be <code>vp+jwt</code>.
When present, the <code>cty</code> header parameter SHOULD be
<code>vp</code>.
The <code>cty</code> header parameter value can be used to differentiate
between secured content of different types when using <code>vp+jwt</code>.
The <code>content type</code> header parameter is optional, and can be used
to express a more specific media type than <code>application/vc</code> when one is available.
See <a data-cite="RFC7515#section-4.1">Registered Header Parameter Names</a>
for additional details regarding usage of <code>typ</code> and <code>cty</code>.
</p>
<p>
A [=conforming JWS verifier implementation=] MUST use [[RFC7515]] to
verify [=conforming JWS documents=] that use this media type.
</p>
<p>
Verifiable Credentials secured in
<a data-cite="VC-DATA-MODEL-2.0/#verifiable-presentations">verifiable presentations</a>
MUST use the
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiableCredential">Enveloped Verifiable Credential</a>
type defined by the [[VC-DATA-MODEL-2.0]].
</p>
<p>
Verifiable Presentations in
<a data-cite="VC-DATA-MODEL-2.0/#verifiable-presentations">verifiable presentations</a>
MUST use the
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiablePresentation">Enveloped Verifiable Presentation</a>
type defined by the [[VC-DATA-MODEL-2.0]].
</p>
<p>
Credentials in [=verifiable presentations=] MUST be secured.
In this case, these [=credentials=] are secured using JWS.
<p>
<p>
To encrypt a secured [=verifiable presentation=] when transmitting
over an insecure channel, implementers MAY use
JSON Web Encryption (JWE) [[RFC7516]] by nesting the secured
[=verifiable presentation=] as the plaintext payload of a JWE,
per the description of Nested JWTs in [[RFC7519]].
</p>
<pre class="example nohighlight vc" data-vc-tabs="jose" title="A simple example of a verifiable presentation secured with JOSE with the EnvelopedVerifiableCredential type">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"type": "VerifiablePresentation",
"verifiableCredential": [{
"@context": ["https://www.w3.org/ns/credentials/v2"],
"type": ["EnvelopedVerifiableCredential"],
"id": "data:application/vc+jwt,eyJraWQiOiJFeEhrQk1XOWZtYmt2VjI2Nm1ScHVQMnNVWV9OX0VXSU4xbGFwVXpPOHJvIiwiYWxnIjoiRVMzODQifQ.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiaWQiOiJodHRwOi8vdW5pdmVyc2l0eS5leGFtcGxlL2NyZWRlbnRpYWxzLzE4NzIiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiRXhhbXBsZUFsdW1uaUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiaHR0cHM6Ly91bml2ZXJzaXR5LmV4YW1wbGUvaXNzdWVycy81NjUwNDkiLCJ2YWxpZEZyb20iOiIyMDEwLTAxLTAxVDE5OjIzOjI0WiIsImNyZWRlbnRpYWxTY2hlbWEiOnsiaWQiOiJodHRwczovL2V4YW1wbGUub3JnL2V4YW1wbGVzL2RlZ3JlZS5qc29uIiwidHlwZSI6Ikpzb25TY2hlbWEifSwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZXhhbXBsZToxMjMiLCJkZWdyZWUiOnsidHlwZSI6IkJhY2hlbG9yRGVncmVlIiwibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgYW5kIEFydHMifX19.d2k4O3FytQJf83kLh-HsXuPvh6yeOlhJELVo5TF71gu7elslQyOf2ZItAXrtbXF4Kz9WivNdztOayz4VUQ0Mwa8yCDZkP9B2pH-9S_tcAFxeoeJ6Z4XnFuL_DOfkR1fP"
}]
}
</pre>
<p>
See <a data-cite="VC-DATA-MODEL-2.0#enveloped-verifiable-credentials"></a> for more
details regarding this example.
</p>
<pre class="example nohighlight vc" data-vc-tabs="jose" title="A simple example of a verifiable presentation secured with JOSE with the EnvelopedVerifiablePresentation type">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"type": "EnvelopedVerifiablePresentation",
"id": "data:application/vp+jwt,eyJraWQiOiJFeEhrQk1XOWZtYmt2VjI2Nm1ScHVQMnNVWV9OX0VXSU4xbGFwVXpPOHJvIiwiYWxnIjoiRVMzODQifQ.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiaWQiOiJodHRwOi8vdW5pdmVyc2l0eS5leGFtcGxlL2NyZWRlbnRpYWxzLzE4NzIiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiRXhhbXBsZUFsdW1uaUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiaHR0cHM6Ly91bml2ZXJzaXR5LmV4YW1wbGUvaXNzdWVycy81NjUwNDkiLCJ2YWxpZEZyb20iOiIyMDEwLTAxLTAxVDE5OjIzOjI0WiIsImNyZWRlbnRpYWxTY2hlbWEiOnsiaWQiOiJodHRwczovL2V4YW1wbGUub3JnL2V4YW1wbGVzL2RlZ3JlZS5qc29uIiwidHlwZSI6Ikpzb25TY2hlbWEifSwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZXhhbXBsZToxMjMiLCJkZWdyZWUiOnsidHlwZSI6IkJhY2hlbG9yRGVncmVlIiwibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgYW5kIEFydHMifX19.d2k4O3FytQJf83kLh-HsXuPvh6yeOlhJELVo5TF71gu7elslQyOf2ZItAXrtbXF4Kz9WivNdztOayz4VUQ0Mwa8yCDZkP9B2pH-9S_tcAFxeoeJ6Z4XnFuL_DOfkR1fP"
}
</pre>
<p>
See <a data-cite="VC-DATA-MODEL-2.0#enveloped-verifiable-presentations"></a>
for more details regarding this example.
</p>
<p>
Implementations MUST support the JWS compact serialization.
Use of the JWS JSON serialization is NOT RECOMMENDED.
</p>
</section>
<section class="appendix informative">
<h2 id="jose-header-parameters-jwt-claims">JOSE Header Parameters and
JWT Claims</h2>
<p>
When present in the <a data-cite="RFC7515#section-4">JOSE Header</a>
or the
<a data-cite="RFC7519#section-4">JWT Claims Set</a>, members
registered in the IANA
<a href="https://www.iana.org/assignments/jwt/jwt.xhtml">JSON Web Token Claims</a>
registry or the IANA
<a href="https://www.iana.org/assignments/jose/jose.xhtml">JSON Web Signature and Encryption Header Parameters</a>
registry are to be interpreted as defined by the specifications
referenced in the registries.
</p>
<p>
The normative statements in
<a data-cite="RFC7515#section-4.1">Registered Header Parameter Names</a>,
<a data-cite="RFC7519#section-5">JOSE Header</a>, and
<a data-cite="RFC7519#section-5.3">Replicating Claims as Header Parameters</a>
apply to securing [=credentials=] and [=presentations=].
</p>
<p>
The unencoded JOSE Header is JSON (`application/json`), not JSON-LD
(`application/ld+json`).
</p>
<p>
It is RECOMMENDED to use the IANA
<a href="https://www.iana.org/assignments/jwt/jwt.xhtml">JSON Web Token Claims</a>
registry and the IANA
<a href="https://www.iana.org/assignments/jose/jose.xhtml">JSON Web Signature and Encryption Header Parameters</a>
registry to identify any claims and header parameters that might be
confused with members defined by [[VC-DATA-MODEL-2.0]].
These include but are not limited to: <code>iss</code>,
<code>kid</code>, <code>alg</code>, <code>iat</code>,
<code>exp</code>, and <code>cnf</code>.
</p>
<p>
When the <code>iat</code> (Issued At) and/or
<code>exp</code> (Expiration Time) JWT claims are present, they
represent the issuance and expiration time of the signature,
respectively.
Note that these are different from the <code>validFrom</code> and
<code>validUntil</code> properties defined in
<a data-cite="VC-DATA-MODEL-2.0#validity-period">Validity Period</a>,
which represent the validity of the data that is being secured.
Use of the <code>nbf</code> (Not Before) claim is NOT RECOMMENDED,
as it makes little sense to attempt to assign a future date to
a signature.
</p>
<p>
The claims and security provided by this specification are
independent of the data secured and semantics provided by the
[[VC-DATA-MODEL-2.0]].
This means that while the security features
of this specification ensure data integrity and authenticity,
they do not dictate the interpretation of claim data.
</p>
<p>
Implementers SHOULD avoid setting JWT claims to values that conflict
with the values of [=verifiable credential=] properties when a
claim and property pair refer to the same conceptual entity,
especially with pairs such as `iss` and `issuer`, `jti` and `id`,
and `sub` and `credentialSubject.id`.
For example, JWK claim `iss` SHOULD NOT be set to a value which
conflicts with the value of [=verifiable credential=] property
`issuer`.
</p>
<p>
The JWT Claim Names <code>vc</code> and <code>vp</code> MUST NOT be present.
</p>
<p>
Additional members may be present as header parameters and claims.
If they are not understood, they MUST be ignored.
</p>
</section>
</section>
<section id="secure-with-sd-jwt">
<h2 id="with-sd-jwt">With SD-JWT</h2>
<p class="issue" title="(AT RISK) Feature depends on completion of an IETF specification currently in Working Group Last Call">
The normative statements in this section depend on the IETF OAuth working group
draft [[SD-JWT]]. Features related to [[SD-JWT]] are at risk and will be removed
from the specification if the IETF standardization process occurs after this
specification's timeline for reaching a Proposed Recommendation, and if at least
two independent, interoperable implementations are not demonstrated.
</p>
<section>
<h2 id="securing-with-sd-jwt">Securing JSON-LD Verifiable Credentials with SD-JWT</h2>
<p>
This section details how to use JOSE to secure
[=verifiable credentials=] conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
A [=conforming SD-JWT issuer implementation=] MUST use [[SD-JWT]]
to secure this media type.
The unsecured [=verifiable credential=] is the input JWT Claims Set.
The Issuer then converts the input JWT Claims Set (i.e., the
unsecured [=verifiable credential=]) into an [[SD-JWT]] payload
according to
<a data-cite="SD-JWT#section-6.1">SD-JWT issuance instructions</a>.
</p>
<p>
The <code>typ</code> header parameter SHOULD be <code>vc+sd-jwt</code>.
When present, the <code>cty</code> header parameter SHOULD be <code>vc</code>.
The <code>cty</code> header parameter value can be used to differentiate
between secured content of different types when using <code>vc+sd-jwt</code>.
The <code>content type</code> header parameter is optional, and can be used
to express a more specific media type than <code>application/vc</code> when one is available.
See <a data-cite="RFC7515#section-4.1">Registered Header Parameter Names</a>
for additional details regarding usage of <code>typ</code> and <code>cty</code>.
</p>
<p>
A [=conforming SD-JWT verifier implementation=] MUST use [[SD-JWT]]
to verify [=conforming JWS documents=] that use this media type.
</p>
<p>
When securing [=verifiable credentials=] with [[SD-JWT]],
implementers SHOULD ensure that properties necessary for the
validation and verification of a credential are NOT selectively
disclosable (i.e., such properties SHOULD be disclosed).
These properties can include but are not limited to
<a data-cite="VC-DATA-MODEL-2.0#contexts"><code>@context</code></a>,
<a data-cite="VC-DATA-MODEL-2.0#types"><code>type</code></a>,
<a data-cite="VC-DATA-MODEL-2.0#status"><code>credentialStatus</code></a>,
<a data-cite="VC-DATA-MODEL-2.0#data-schemas"><code>credentialSchema</code></a>,
and <a data-cite="VC-DATA-MODEL-2.0#integrity-of-related-resources"><code>relatedResource</code></a>.
</p>
<p>
To encrypt a secured [=verifiable credential=] when transmitting
over an insecure channel, implementers MAY use
JSON Web Encryption (JWE) [[RFC7516]] by nesting the secured
[=verifiable credential=] as the plaintext payload of a JWE,
per the instructions in Section 11.2 of [[SD-JWT]].
</p>
<pre class="example nohighlight vc" data-vc-tabs="sd-jwt" title="A simple example of a verifiable credential secured with SD-JWT">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"id": "http://university.example/credentials/3732",
"type": ["VerifiableCredential", "ExampleDegreeCredential", "ExamplePersonCredential"],
"issuer": "https://university.example/issuers/14",
"validFrom": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "ExampleBachelorDegree",
"name": "Bachelor of Science and Arts"
},
"alumniOf": {
"name": "Example University"
}
},
"credentialSchema": [{
"id": "https://example.org/examples/degree.json",
"type": "JsonSchema"
},
{
"id": "https://example.org/examples/alumni.json",
"type": "JsonSchema"
}]
}
</pre>
<p>
See <a data-cite="VC-DATA-MODEL-2.0#example-using-the-credentialschema-property-to-perform-json-schema-validation"></a>
for more details regarding this example.
</p>
</section>
<section>
<h2 id="securing-vps-sd-jwt">Securing JSON-LD Verifiable Presentations with SD-JWT</h2>
<p>
This section details how to use [[SD-JWT]] to secure
[=verifiable presentations=] conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
A [=conforming SD-JWT issuer implementation=] MUST use [[SD-JWT]] to secure this media type.
The unsecured [=verifiable presentation=] is the unencoded [[SD-JWT]] payload.
</p>
<p>
The <code>typ</code> header parameter SHOULD be <code>vp+sd-jwt</code>.
When present, the <code>cty</code> header parameter SHOULD be <code>vp</code>.
The <code>cty</code> header parameter value can be used to differentiate
between secured content of different types when using <code>vp+sd-jwt</code>.
The <code>content type</code> header parameter is optional, and can be used
to express a more specific media type than <code>application/vc</code> when one is available.
See <a data-cite="RFC7515#section-4.1">Registered Header Parameter Names</a>
for additional details regarding usage of <code>typ</code> and <code>cty</code>.
</p>
<p>
A [=conforming SD-JWT verifier implementation=] MUST use [[SD-JWT]]
to verify [=conforming JWS documents=] that use this media type.
</p>
<p>
Verifiable Credentials secured in
<a data-cite="VC-DATA-MODEL-2.0/#verifiable-presentations">verifiable presentations</a>
MUST use the
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiableCredential">Enveloped Verifiable Credential</a>
type defined by the [[VC-DATA-MODEL-2.0]].
</p>
<p>
Verifiable Presentations in
<a data-cite="VC-DATA-MODEL-2.0/#verifiable-presentations">verifiable presentations</a>
MUST use the
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiablePresentation">Enveloped Verifiable Presentation</a>
type defined by the [[VC-DATA-MODEL-2.0]].
</p>
<p>
Credentials in [=verifiable presentations=] MUST be secured.
These [=credentials=] are secured using SD-JWT in this case.
<p>
<p>
When securing [=verifiable presentations=] with [[SD-JWT]]
implementers SHOULD ensure that properties necessary for the
validation and verification of a credential are NOT selectively
disclosable (i.e., such properties SHOULD be disclosed).
These properties can include but are not limited to
<a data-cite="VC-DATA-MODEL-2.0#contexts"><code>@context</code></a>,
<a data-cite="VC-DATA-MODEL-2.0#types"><code>type</code></a>,
<a data-cite="VC-DATA-MODEL-2.0#status"><code>credentialStatus</code></a>,
<a data-cite="VC-DATA-MODEL-2.0#data-schemas"><code>credentialSchema</code></a>,
and <a data-cite="VC-DATA-MODEL-2.0#integrity-of-related-resources"><code>relatedResource</code></a>.
</p>
<p>
To encrypt a secured [=verifiable presentation=] when transmitting
over an insecure channel, implementers MAY use
JSON Web Encryption (JWE) [[RFC7516]] by nesting the secured
[=verifiable presentation=] as the plaintext payload of a JWE,
per the instructions in Section 11.2 of [[SD-JWT]].
</p>
<pre class="example nohighlight vc" data-vc-tabs="sd-jwt" title="A simple example of a verifiable presentation secured with SD-JWT using the EnvelopedVerifiableCredential type">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"type": "VerifiablePresentation",
"verifiableCredential": [{
"@context": "https://www.w3.org/ns/credentials/v2",
"type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Y1QwUlNfd01nIiwgImlkIiwgImh0dHA6Ly91bml2ZXJzaXR5LmV4YW1wbGUvY3JlZGVudGlhbHMvMTg3MiJd~WyJTclNWMS01SjR6cWhOU3N3STIwaHdRIiwgInR5cGUiLCBbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwgIkV4YW1wbGVBbHVtbmlDcmVkZW50aWFsIl1d~WyJKX294dDhtUGUtaDl4MkQzc29uT1N3IiwgImlkIiwgImh0dHBzOi8vZXhhbXBsZS5vcmcvZXhhbXBsZXMvZGVncmVlLmpzb24iXQ~WyJDMlpWektmZ185RUh1ajB2S1ExdWJnIiwgInR5cGUiLCAiSnNvblNjaGVtYSJd~WyJ6Szd5QlFPbFhfX2Q0X0VoYUc0Y0pRIiwgImlkIiwgImRpZDpleGFtcGxlOjEyMyJd~WyJ6b1pzRzMzeXBMeVRGMm9aS3ZmMVFnIiwgInR5cGUiLCAiQmFjaGVsb3JEZWdyZWUiXQ~"
}]
}
</pre>
<p>
See <a data-cite="VC-DATA-MODEL-2.0#enveloped-verifiable-credentials"></a>
for more details regarding this example.
</p>
<pre class="example nohighlight vc" data-vc-tabs="sd-jwt" title="A simple example of a verifiable presentation secured with SD-JWT using the EnvelopedVerifiablePresentation type">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"type": "EnvelopedVerifiablePresentation",
"id": "data:application/vp+sd-jwt,eyJhbGciOiJFUzM4NCIsImtpZCI6IlVRTV9fblE0UzZCTzhuUTRuT05YeHB4aHRob3lOeGI1M0xZZ1l6LTJBQnMiLCJ0eXAiOiJ2cCtsZCtqc29uK3NkLWp3dCIsImN0eSI6InZwK2xkK2pzb24ifQ.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwidmVyaWZpYWJsZUNyZWRlbnRpYWw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a3rXZQhQLdB1BgaoO8zgQ-c3B41fxaXMnLHYV9-B20uboSpJP0B-2Vre917eQt1cSDswDGA_Ytvn4BSqYVBB2J~WyJFMkFsRzhsY2p0QVFrcllIbjlIbnVRIiwgInR5cGUiLCAiVmVyaWZpYWJsZVByZXNlbnRhdGlvbiJd~WyI5NldYMDRneno4cVZzOVZLU2wwYTVnIiwgImlkIiwgImh0dHA6Ly91bml2ZXJzaXR5LmV4YW1wbGUvY3JlZGVudGlhbHMvMTg3MiJd~WyJaekU2VFVaamtHMW1DWXBKMEhnc0l3IiwgInR5cGUiLCBbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwgIkV4YW1wbGVBbHVtbmlDcmVkZW50aWFsIl1d~WyItQ3NsS25GZGFYb2JiQWsyU0JBVGR3IiwgImlkIiwgImRpZDpleGFtcGxlOmViZmViMWY3MTJlYmM2ZjFjMjc2ZTEyZWMyMSJd~WyJuRm1OWl9IczB3WWNoOFdkeTdnQUNRIiwgImlkIiwgImRpZDpleGFtcGxlOmMyNzZlMTJlYzIxZWJmZWIxZjcxMmViYzZmMSJd~"
}
</pre>
<p>
See <a data-cite="VC-DATA-MODEL-2.0#enveloped-verifiable-presentations"></a>
for more details regarding this example.
</p>
<p>
Implementations MUST support the compact serialization
(<code>application/sd-jwt</code>) and MAY support the JSON
serialization (<code>application/sd-jwt+json</code>).
If the JSON serialization is used, it is RECOMMENDED that a profile
be defined to ensure any additional JSON members are understood consistently.
</p>
</section>
</section>
<section id="secure-with-cose">
<h2 id="securing-with-cose">With COSE</h2>
<p>
COSE [[RFC9052]] is a common approach to encoding and securing
information using CBOR [[RFC8949]].
Verifiable credentials MAY be secured using COSE [[RFC9052]] and
SHOULD be identified through use of content types as outlined in this section.
</p>
<section>
<h2 id="securing-vcs-with-cose">Securing JSON-LD
Verifiable Credentials with COSE</h2>
<p>
This section details how to use COSE to secure
[=verifiable credentials=] conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
A [=conforming COSE issuer implementation=] MUST use COSE_Sign1 as
specified in [[RFC9052]] to secure this media type.
The unsecured [=verifiable credential=] is the unencoded COSE_Sign1 payload.
</p>
<p>
The <code>typ (16)</code> header parameter, as described in
<a data-cite="RFC9596#section-2">COSE "typ" (type) Header Parameter</a>,
SHOULD be <code>application/vc+cose</code>.
The <code>content type (3)</code> header parameter SHOULD be <code>application/vc</code>.
The <code>content type (3)</code> header parameter is optional, and can be used
to express a more specific media type than <code>application/vc</code> when one is available.
See <a data-cite="RFC9052#section-3.1">Common COSE Header Parameters</a>
for additional details.
</p>
<p>
A [=conforming COSE verifier implementation=] MUST use COSE_Sign1 as
specified in [[RFC9052]] to verify [=conforming COSE documents=]
that use this media type.
</p>
<p>
When including [=verifiable credentials=] secured with COSE in
[=verifiable presentations=] as
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiableCredential">Enveloped Verifiable Credentials</a>,
the credentials MUST be encoded using base64 as specified in [[RFC2397]].
</p>
<p>
To encrypt a secured [=verifiable credential=] when transmitting
over an insecure channel, implementers MAY use COSE encryption,
as defined in Section 5 of [[RFC9052]], by nesting the secured
[=verifiable credential=] as the plaintext payload of an encrypted
COSE object.
</p>
<pre class="example nohighlight vc" data-vc-tabs="cose" title="A simple example of a verifiable credential secured with COSE">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"id": "http://university.example/credentials/3732",
"type": ["VerifiableCredential", "ExampleDegreeCredential", "ExamplePersonCredential"],
"issuer": "https://university.example/issuers/14",
"validFrom": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "ExampleBachelorDegree",
"name": "Bachelor of Science and Arts"
},
"alumniOf": {
"name": "Example University"
}
},
"credentialSchema": [{
"id": "https://example.org/examples/degree.json",
"type": "JsonSchema"
},
{
"id": "https://example.org/examples/alumni.json",
"type": "JsonSchema"
}]
}
</pre>
<p>
See <a data-cite="VC-DATA-MODEL-2.0#example-using-the-credentialschema-property-to-perform-json-schema-validation"></a>
for more details regarding this example.
</p>
</section>
<section>
<h2 id="securing-vps-with-cose">Securing JSON-LD Verifiable Presentations with COSE</h2>
<p>
This section details how to use COSE to secure
[=verifiable presentations=] conforming to [[VC-DATA-MODEL-2.0]].
</p>
<p>
A [=conforming COSE issuer implementation=] MUST use COSE_Sign1 as
specified in [[RFC9052]] to secure this media type.
The unsecured [=verifiable presentation=] is the unencoded COSE_Sign1 payload.
</p>
<p>
The <code>typ (16)</code> header parameter, as described in
<a data-cite="RFC9596#section-2">COSE "typ" (type) Header Parameter</a>,
SHOULD be <code>application/vp+cose</code>.
The <code>content type (3)</code> header parameter SHOULD be <code>application/vp</code>.
The <code>content type (3)</code> header parameter is optional, and can be used
to express a more specific media type than <code>application/vp</code> when one is available.
See <a data-cite="RFC9052#section-3.1">Common COSE Header Parameters</a>
for additional details.
</p>
<p>
A [=conforming COSE verifier implementation=] MUST use COSE_Sign1 as
specified in [[RFC9052]] to verify [=conforming COSE documents=]
that use this media type.
</p>
<p>
Verifiable Credentials secured in
<a data-cite="VC-DATA-MODEL-2.0/#verifiable-presentations">verifiable presentations</a>
MUST use the
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiableCredential">Enveloped Verifiable Credential</a>
type defined by the [[VC-DATA-MODEL-2.0]].
</p>
<p>
Verifiable Presentations in
<a data-cite="VC-DATA-MODEL-2.0/#verifiable-presentations">verifiable presentations</a>
MUST use the
<a data-cite="VC-DATA-MODEL-2.0/#defn-EnvelopedVerifiablePresentation">Enveloped Verifiable Presentation</a>
type defined by the [[VC-DATA-MODEL-2.0]].
</p>
<p>
Credentials in [=verifiable presentations=] MUST be secured.
These [=credentials=] are secured using COSE in this case.
<p>
<p>
To encrypt a secured [=verifiable presentation=] when transmitting
over an insecure channel, implementers MAY use COSE encryption,
as defined in Section 5 of [[RFC9052]], by nesting the secured
[=verifiable presentation=] as the plaintext payload of an encrypted
COSE object.
</p>
<pre class="example nohighlight vc" data-vc-tabs="cose" title="A simple example of a verifiable presentation secured withCOSE using the EnvelopedVerifiableCredential type">
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"type": "VerifiablePresentation",
"verifiableCredential": [{
"@context": "https://www.w3.org/ns/credentials/v2",
"type": "EnvelopedVerifiableCredential",
"id": "data:application/vc+sd-jwt,eyJraWQiOiJFeEhrQk1XOWZtYmt2VjI2Nm1ScHVQMnNVWV9OX0VXSU4xbGFwVXpPOHJvIiwiYWxnIjoiRVMyNTYifQ.eyJfc2RfYWxnIjoic2hhLTI1NiIsIkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy9ucy9jcmVkZW50aWFscy92MiIsImh0dHBzOi8vd3d3LnczLm9yZy9ucy9jcmVkZW50aWFscy9leGFtcGxlcy92MiJdLCJpc3N1ZXIiOiJodHRwczovL3VuaXZlcnNpdHkuZXhhbXBsZS9pc3N1ZXJzLzU2NTA0OSIsInZhbGlkRnJvbSI6IjIwMTAtMDEtMDFUMTk6MjM6MjRaIiwiY3JlZGVudGlhbFNjaGVtYSI6eyJfc2QiOlsiNWJBeDMteHBmQWxVS0ZJOXNuM2hWQ21wR2trcUlzWmMzLUxiMzNmWmpiayIsIlpjQXZIMDhsdEJySUpmSWh0OF9tS1BfYzNscG5YMWNHclltVG8wZ1lCeTgiXX0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImRlZ3JlZSI6eyJuYW1lIjoiQmFjaGVsb3Igb2YgU2NpZW5jZSBhbmQgQXJ0cyIsIl9zZCI6WyJST1Q3MUl0dTNMNlVXWFVqby1oWVdJQjY3bHVPTkVEUlNCaGxEVENxVU9RIl19LCJfc2QiOlsiTUVuZXNnMlhPUk5jY3NCTWVaXzE2MDJneTQwUi00WUJ2VlIweFE4b0Y4YyJdfSwiX3NkIjpbIkVlc2Jiay1mcGZwd2ZMOXdOczFxcjZ0aU43ZnEtSXQzWVM2V3ZCbl9iWG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