@sovrahq/waci 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +21 -0
  3. package/.prettierrc +4 -0
  4. package/LICENSE +201 -0
  5. package/dist/callbacks/index.d.ts +108 -0
  6. package/dist/callbacks/index.js +9 -0
  7. package/dist/callbacks/index.js.map +1 -0
  8. package/dist/constants/index.d.ts +1 -0
  9. package/dist/constants/index.js +5 -0
  10. package/dist/constants/index.js.map +1 -0
  11. package/dist/handlers/common/problem-report.handler.d.ts +4 -0
  12. package/dist/handlers/common/problem-report.handler.js +72 -0
  13. package/dist/handlers/common/problem-report.handler.js.map +1 -0
  14. package/dist/handlers/common/step-2-oob-invitation.handler.d.ts +4 -0
  15. package/dist/handlers/common/step-2-oob-invitation.handler.js +93 -0
  16. package/dist/handlers/common/step-2-oob-invitation.handler.js.map +1 -0
  17. package/dist/handlers/decorators/register-handler.decorator.d.ts +2 -0
  18. package/dist/handlers/decorators/register-handler.decorator.js +13 -0
  19. package/dist/handlers/decorators/register-handler.decorator.js.map +1 -0
  20. package/dist/handlers/index.d.ts +6 -0
  21. package/dist/handlers/index.js +11 -0
  22. package/dist/handlers/index.js.map +1 -0
  23. package/dist/handlers/issuance/step-3-propose-credential.handler.d.ts +32 -0
  24. package/dist/handlers/issuance/step-3-propose-credential.handler.js +180 -0
  25. package/dist/handlers/issuance/step-3-propose-credential.handler.js.map +1 -0
  26. package/dist/handlers/issuance/step-4-1-offer-credential-proceed.handler.d.ts +5 -0
  27. package/dist/handlers/issuance/step-4-1-offer-credential-proceed.handler.js +152 -0
  28. package/dist/handlers/issuance/step-4-1-offer-credential-proceed.handler.js.map +1 -0
  29. package/dist/handlers/issuance/step-4-offer-credential.handler.d.ts +5 -0
  30. package/dist/handlers/issuance/step-4-offer-credential.handler.js +169 -0
  31. package/dist/handlers/issuance/step-4-offer-credential.handler.js.map +1 -0
  32. package/dist/handlers/issuance/step-5-request-credential.handler.d.ts +4 -0
  33. package/dist/handlers/issuance/step-5-request-credential.handler.js +275 -0
  34. package/dist/handlers/issuance/step-5-request-credential.handler.js.map +1 -0
  35. package/dist/handlers/issuance/step-6-issue-credential.handler.d.ts +4 -0
  36. package/dist/handlers/issuance/step-6-issue-credential.handler.js +106 -0
  37. package/dist/handlers/issuance/step-6-issue-credential.handler.js.map +1 -0
  38. package/dist/handlers/issuance/step-7-ack-message.handler.d.ts +4 -0
  39. package/dist/handlers/issuance/step-7-ack-message.handler.js +78 -0
  40. package/dist/handlers/issuance/step-7-ack-message.handler.js.map +1 -0
  41. package/dist/handlers/presentation/step-3-propose-presentation.handler.d.ts +5 -0
  42. package/dist/handlers/presentation/step-3-propose-presentation.handler.js +107 -0
  43. package/dist/handlers/presentation/step-3-propose-presentation.handler.js.map +1 -0
  44. package/dist/handlers/presentation/step-4-1-presentation-proceed.handler.d.ts +5 -0
  45. package/dist/handlers/presentation/step-4-1-presentation-proceed.handler.js +130 -0
  46. package/dist/handlers/presentation/step-4-1-presentation-proceed.handler.js.map +1 -0
  47. package/dist/handlers/presentation/step-4-request-presentation.handler.d.ts +5 -0
  48. package/dist/handlers/presentation/step-4-request-presentation.handler.js +151 -0
  49. package/dist/handlers/presentation/step-4-request-presentation.handler.js.map +1 -0
  50. package/dist/handlers/presentation/step-5-present-proof.handler.d.ts +4 -0
  51. package/dist/handlers/presentation/step-5-present-proof.handler.js +211 -0
  52. package/dist/handlers/presentation/step-5-present-proof.handler.js.map +1 -0
  53. package/dist/handlers/presentation/step-6-ack-message.handler.d.ts +4 -0
  54. package/dist/handlers/presentation/step-6-ack-message.handler.js +72 -0
  55. package/dist/handlers/presentation/step-6-ack-message.handler.js.map +1 -0
  56. package/dist/index.d.ts +17 -0
  57. package/dist/index.js +37 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/services/waci-interpreter.d.ts +17 -0
  60. package/dist/services/waci-interpreter.js +222 -0
  61. package/dist/services/waci-interpreter.js.map +1 -0
  62. package/dist/types/actor.d.ts +5 -0
  63. package/dist/types/actor.js +10 -0
  64. package/dist/types/actor.js.map +1 -0
  65. package/dist/types/credential-application.d.ts +36 -0
  66. package/dist/types/credential-application.js +3 -0
  67. package/dist/types/credential-application.js.map +1 -0
  68. package/dist/types/credential-manifest.d.ts +173 -0
  69. package/dist/types/credential-manifest.js +3 -0
  70. package/dist/types/credential-manifest.js.map +1 -0
  71. package/dist/types/index.d.ts +4 -0
  72. package/dist/types/index.js +21 -0
  73. package/dist/types/index.js.map +1 -0
  74. package/dist/types/problem-report.d.ts +13 -0
  75. package/dist/types/problem-report.js +18 -0
  76. package/dist/types/problem-report.js.map +1 -0
  77. package/dist/types/waci-message.d.ts +106 -0
  78. package/dist/types/waci-message.js +106 -0
  79. package/dist/types/waci-message.js.map +1 -0
  80. package/dist/utils/erros.d.ts +15 -0
  81. package/dist/utils/erros.js +42 -0
  82. package/dist/utils/erros.js.map +1 -0
  83. package/dist/utils/index.d.ts +22 -0
  84. package/dist/utils/index.js +356 -0
  85. package/dist/utils/index.js.map +1 -0
  86. package/jest.config.json +17 -0
  87. package/package.json +39 -0
  88. package/readme.md +1 -0
  89. package/src/callbacks/index.ts +75 -0
  90. package/src/constants/index.ts +1 -0
  91. package/src/handlers/common/problem-report.handler.ts +15 -0
  92. package/src/handlers/common/step-2-oob-invitation.handler.ts +45 -0
  93. package/src/handlers/decorators/register-handler.decorator.ts +10 -0
  94. package/src/handlers/index.ts +7 -0
  95. package/src/handlers/issuance/step-3-propose-credential.handler.ts +186 -0
  96. package/src/handlers/issuance/step-4-1-offer-credential-proceed.handler.ts +129 -0
  97. package/src/handlers/issuance/step-4-offer-credential.handler.ts +137 -0
  98. package/src/handlers/issuance/step-5-request-credential.handler.ts +205 -0
  99. package/src/handlers/issuance/step-6-issue-credential.handler.ts +63 -0
  100. package/src/handlers/issuance/step-7-ack-message.handler.ts +21 -0
  101. package/src/handlers/presentation/step-3-propose-presentation.handler.ts +67 -0
  102. package/src/handlers/presentation/step-4-1-presentation-proceed.handler.ts +100 -0
  103. package/src/handlers/presentation/step-4-request-presentation.handler.ts +115 -0
  104. package/src/handlers/presentation/step-5-present-proof.handler.ts +159 -0
  105. package/src/handlers/presentation/step-6-ack-message.handler.ts +15 -0
  106. package/src/index.ts +18 -0
  107. package/src/services/waci-interpreter.ts +161 -0
  108. package/src/types/actor.ts +5 -0
  109. package/src/types/credential-application.ts +38 -0
  110. package/src/types/credential-manifest.ts +184 -0
  111. package/src/types/index.ts +4 -0
  112. package/src/types/problem-report.ts +29 -0
  113. package/src/types/waci-message.ts +148 -0
  114. package/src/utils/erros.ts +21 -0
  115. package/src/utils/index.ts +272 -0
  116. package/test/handlers/issuance/step-3-propose-credential.handler.spec.ts +43 -0
  117. package/test/handlers/issuance/step-4-offer-credential.handler.spec.ts +53 -0
  118. package/test/handlers/issuance/step-5-request-credential.handler.spec.ts +102 -0
  119. package/test/handlers/presentation/step-5-present-proof.handler.spec.ts +142 -0
  120. package/test/handlers/shared/step-2-oob-invitation.handler.spec.ts +55 -0
  121. package/test/stubs/index.ts +842 -0
  122. package/test/waci-interpreter.spec.ts +113 -0
  123. package/tsconfig.build.json +9 -0
  124. package/tsconfig.json +20 -0
@@ -0,0 +1,842 @@
1
+ import { WACIMessage, WACIMessageType } from '../../src';
2
+ import { OfferCredentialMessageParams } from '../../src/handlers/issuance/step-3-propose-credential.handler';
3
+
4
+ export const credentialManifestParamsStub: OfferCredentialMessageParams = {
5
+ issuerDid: 'did:test:123',
6
+ issuerName: 'testing',
7
+ issuerStyles: {},
8
+ output: [
9
+ {
10
+ format: 'ldp_vc',
11
+ outputDescriptor: {
12
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
13
+ schema: '',
14
+ display: {
15
+ title: {
16
+ path: ['$.name', '$.vc.name'],
17
+ fallback: 'vc_test_1',
18
+ },
19
+ subtitle: {
20
+ path: ['$.class', '$.vc.class'],
21
+ fallback: 'Verifiable Credential',
22
+ },
23
+ description: {
24
+ text: 'vc_test_1',
25
+ },
26
+ },
27
+ styles: {
28
+ background: {
29
+ color: 'black',
30
+ },
31
+ thumbnail: {
32
+ uri: 'uri',
33
+ alt: 'alt',
34
+ },
35
+ hero: {
36
+ uri: 'uri',
37
+ alt: 'alt',
38
+ },
39
+ text: {
40
+ color: 'black',
41
+ },
42
+ },
43
+ },
44
+
45
+ verifiableCredential: {
46
+ '@context': [
47
+ 'https://www.w3.org/2018/credentials/v1',
48
+ 'https://w3id.org/citizenship/v1',
49
+ 'https://w3id.org/security/bbs/v1',
50
+ ],
51
+ id: 'urn:uvci:af5vshde843jf831j128fj',
52
+ type: [
53
+ 'VerifiableCredential',
54
+ 'VaccinationCertificate',
55
+ 'PermanentResidentCard',
56
+ ],
57
+ name: 'Permanent Resident Card',
58
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
59
+ expirationDate: '2029-12-03T12:19:52Z',
60
+ issuanceDate: '2019-12-03T12:19:52Z',
61
+ issuer: 'did:example:456',
62
+ credentialSubject: {
63
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
64
+ givenName: 'Louis',
65
+ familyName: 'Pasteur',
66
+ birthCountry: 'Bahamas',
67
+ birthDate: '1958-07-17',
68
+ },
69
+ },
70
+ },
71
+ ],
72
+ };
73
+
74
+ export const offerCredentialMessageAttachmentsStub1 = [
75
+ {
76
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
77
+ media_type: 'application/json',
78
+ format: 'dif/credential-manifest/manifest@v1.0',
79
+ data: {
80
+ json: {
81
+ options: {
82
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
83
+ },
84
+ credential_manifest: {
85
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
86
+ version: '0.1.0',
87
+ issuer: {
88
+ id: 'did:test:123',
89
+ name: 'testing',
90
+ },
91
+ output_descriptors: [
92
+ {
93
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
94
+ schema: '',
95
+ display: {
96
+ title: {
97
+ path: ['$.name', '$.vc.name'],
98
+ fallback: 'vc_test_1',
99
+ },
100
+ subtitle: {
101
+ path: ['$.class', '$.vc.class'],
102
+ fallback: 'Verifiable Credential',
103
+ },
104
+ description: {
105
+ text: 'vc_test_1',
106
+ },
107
+ },
108
+ styles: {
109
+ background: {
110
+ color: 'black',
111
+ },
112
+ thumbnail: {
113
+ uri: 'uri',
114
+ alt: 'alt',
115
+ },
116
+ hero: {
117
+ uri: 'uri',
118
+ alt: 'alt',
119
+ },
120
+ text: {
121
+ color: 'black',
122
+ },
123
+ },
124
+ },
125
+ ],
126
+ },
127
+ },
128
+ },
129
+ },
130
+ {
131
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
132
+ media_type: 'application/json',
133
+ format: 'dif/credential-manifest/fulfillment@v1.0',
134
+ data: {
135
+ json: {
136
+ '@context': [
137
+ 'https://www.w3.org/2018/credentials/v1',
138
+ 'https://identity.foundation/credential-manifest/fulfillment/v1',
139
+ ],
140
+ type: ['VerifiablePresentation', 'CredentialFulfillment'],
141
+ credential_fulfillment: {
142
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
143
+ manifest_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
144
+ descriptor_map: [
145
+ {
146
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
147
+ format: 'ldp_vc',
148
+ path: '$.verifiableCredential[0]',
149
+ },
150
+ ],
151
+ },
152
+ verifiableCredential: [
153
+ {
154
+ '@context': [
155
+ 'https://www.w3.org/2018/credentials/v1',
156
+ 'https://w3id.org/citizenship/v1',
157
+ 'https://w3id.org/security/bbs/v1',
158
+ ],
159
+ id: 'urn:uvci:af5vshde843jf831j128fj',
160
+ type: [
161
+ 'VerifiableCredential',
162
+ 'VaccinationCertificate',
163
+ 'PermanentResidentCard',
164
+ ],
165
+ name: 'Permanent Resident Card',
166
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
167
+ expirationDate: '2029-12-03T12:19:52Z',
168
+ issuanceDate: '2019-12-03T12:19:52Z',
169
+ issuer: 'did:example:456',
170
+ credentialSubject: {
171
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
172
+ givenName: 'Louis',
173
+ familyName: 'Pasteur',
174
+ birthCountry: 'Bahamas',
175
+ birthDate: '1958-07-17',
176
+ },
177
+ },
178
+ ],
179
+ },
180
+ },
181
+ },
182
+ ];
183
+
184
+ export const offerCredentialMessageAttachmentsStub2 = [
185
+ {
186
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
187
+ media_type: 'application/json',
188
+ format: 'dif/credential-manifest/manifest@v1.0',
189
+ data: {
190
+ json: {
191
+ options: {
192
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
193
+ },
194
+ credential_manifest: {
195
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
196
+ version: '0.1.0',
197
+ issuer: {
198
+ id: 'did:test:123',
199
+ name: 'testing',
200
+ },
201
+ presentation_definition: {
202
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
203
+ frame: {
204
+ '@context': [
205
+ 'https://www.w3.org/2018/credentials/v1',
206
+ 'https://w3id.org/citizenship/v1',
207
+ 'https://w3id.org/security/suites/bls12381-2020/v1',
208
+ ],
209
+ type: ['VerifiableCredential', 'PermanentResidentCard'],
210
+ credentialSubject: {
211
+ '@explicit': true,
212
+ type: ['PermanentResident'],
213
+ givenName: {},
214
+ familyName: {},
215
+ birthCountry: {},
216
+ birthDate: {},
217
+ },
218
+ },
219
+ input_descriptors: [
220
+ {
221
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
222
+ name: 'Permanent Resident Card',
223
+ purpose: 'We need PRC to verify your status.',
224
+ constraints: {
225
+ fields: [
226
+ {
227
+ path: ['$.credentialSubject.givenName'],
228
+ filter: {
229
+ type: 'string',
230
+ },
231
+ },
232
+ {
233
+ path: ['$.credentialSubject.familyName'],
234
+ filter: {
235
+ type: 'string',
236
+ },
237
+ },
238
+ {
239
+ path: ['$.credentialSubject.birthCountry'],
240
+ filter: {
241
+ type: 'string',
242
+ },
243
+ },
244
+ {
245
+ path: ['$.credentialSubject.birthDate'],
246
+ filter: {
247
+ type: 'string',
248
+ },
249
+ },
250
+ ],
251
+ },
252
+ },
253
+ ],
254
+ },
255
+ output_descriptors: [
256
+ {
257
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
258
+ schema: '',
259
+ display: {
260
+ title: {
261
+ path: ['$.name', '$.vc.name'],
262
+ fallback: 'vc_test_1',
263
+ },
264
+ subtitle: {
265
+ path: ['$.class', '$.vc.class'],
266
+ fallback: 'Verifiable Credential',
267
+ },
268
+ description: {
269
+ text: 'vc_test_1',
270
+ },
271
+ },
272
+ },
273
+ ],
274
+ },
275
+ },
276
+ },
277
+ },
278
+ {
279
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
280
+ media_type: 'application/json',
281
+ format: 'dif/credential-manifest/fulfillment@v1.0',
282
+ data: {
283
+ json: {
284
+ '@context': [
285
+ 'https://www.w3.org/2018/credentials/v1',
286
+ 'https://identity.foundation/credential-manifest/fulfillment/v1',
287
+ ],
288
+ type: ['VerifiablePresentation', 'CredentialFulfillment'],
289
+ credential_fulfillment: {
290
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
291
+ manifest_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
292
+ descriptor_map: [
293
+ {
294
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
295
+ format: 'ldp_vc',
296
+ path: '$.verifiableCredential[0]',
297
+ },
298
+ ],
299
+ },
300
+ verifiableCredential: [
301
+ {
302
+ '@context': [
303
+ 'https://www.w3.org/2018/credentials/v1',
304
+ 'https://w3id.org/citizenship/v1',
305
+ 'https://w3id.org/security/bbs/v1',
306
+ ],
307
+ id: 'urn:uvci:af5vshde843jf831j128fj',
308
+ type: [
309
+ 'VerifiableCredential',
310
+ 'VaccinationCertificate',
311
+ 'PermanentResidentCard',
312
+ ],
313
+ name: 'Permanent Resident Card',
314
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
315
+ expirationDate: '2029-12-03T12:19:52Z',
316
+ issuanceDate: '2019-12-03T12:19:52Z',
317
+ issuer: 'did:example:456',
318
+ credentialSubject: {
319
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
320
+ givenName: 'Louis',
321
+ familyName: 'Pasteur',
322
+ birthCountry: 'Bahamas',
323
+ birthDate: '1958-07-17',
324
+ },
325
+ },
326
+ ],
327
+ },
328
+ },
329
+ },
330
+ ];
331
+
332
+ export const credentialsToPresentStub = [
333
+ {
334
+ '@context': [
335
+ 'https://www.w3.org/2018/credentials/v1',
336
+ 'https://w3id.org/citizenship/v1',
337
+ 'https://w3id.org/security/bbs/v1',
338
+ ],
339
+ id: 'urn:uvci:af5vshde843jf831j128fj',
340
+ type: [
341
+ 'VerifiableCredential',
342
+ 'VaccinationCertificate',
343
+ 'PermanentResidentCard',
344
+ ],
345
+ name: 'Permanent Resident Card',
346
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
347
+ expirationDate: '2029-12-03T12:19:52Z',
348
+ issuanceDate: '2019-12-03T12:19:52Z',
349
+ issuer: 'did:example:456',
350
+ credentialSubject: {
351
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
352
+ givenName: 'Louis',
353
+ familyName: 'Pasteur',
354
+ birthCountry: 'Bahamas',
355
+ birthDate: '1958-07-17',
356
+ },
357
+ proof: {
358
+ type: 'BbsBlsSignatureProof2020',
359
+ created: '2021-02-18T23:04:28Z',
360
+ nonce:
361
+ 'JNGovx4GGoi341v/YCTcZq7aLWtBtz8UhoxEeCxZFevEGzfh94WUSg8Ly/q+2jLqzzY=',
362
+ proofPurpose: 'assertionMethod',
363
+ proofValue:
364
+ 'AB0GQA//jbDwMgaIIJeqP3fRyMYi6WDGhk0JlGJc/sk4ycuYGmyN7CbO4bA7yhIW/YQbHEkOgeMy0QM+usBgZad8x5FRePxfo4v1dSzAbJwWjx87G9F1lAIRgijlD4sYni1LhSo6svptDUmIrCAOwS2raV3G02mVejbwltMOo4+cyKcGlj9CzfjCgCuS1SqAxveDiMKGAAAAdJJF1pO6hBUGkebu/SMmiFafVdLvFgpMFUFEHTvElUQhwNSp6vxJp6Rs7pOVc9zHqAAAAAI7TJuDCf7ramzTo+syb7Njf6ExD11UKNcChaeblzegRBIkg3HoWgwR0hhd4z4D5/obSjGPKpGuD+1DoyTZhC/wqOjUZ03J1EtryZrC+y1DD14b4+khQVLgOBJ9+uvshrGDbu8+7anGezOa+qWT0FopAAAAEG6p07ghODpi8DVeDQyPwMY/iu2Lh7x3JShWniQrewY2GbsACBYOPlkNNm/qSExPRMe2X7UPpdsxpUDwqbObye4EXfAabgKd9gCmj2PNdvcOQAi5rIuJSGa4Vj7AtKoW/2vpmboPoOu4IEM1YviupomCKOzhjEuOof2/y5Adfb8JUVidWqf9Ye/HtxnzTu0HbaXL7jbwsMNn5wYfZuzpmVQgEXss2KePMSkHcfScAQNglnI90YgugHGuU+/DQcfMoA0+JviFcJy13yERAueVuzrDemzc+wJaEuNDn8UiTjAdVhLcgnHqUai+4F6ONbCfH2B3ohB3hSiGB6C7hDnEyXFOO9BijCTHrxPv3yKWNkks+3JfY28m+3NO0e2tlyH71yDX0+F6U388/bvWod/u5s3MpaCibTZEYoAc4sm4jW03HFYMmvYBuWOY6rGGOgIrXxQjx98D0macJJR7Hkh7KJhMkwvtyI4MaTPJsdJGfv8I+RFROxtRM7RcFpa4J5wF/wQnpyorqchwo6xAOKYFqCqKvI9B6Y7Da7/0iOiWsjs8a4zDiYynfYavnz6SdxCMpHLgplEQlnntqCb8C3qly2s5Ko3PGWu4M8Dlfcn4TT8YenkJDJicA91nlLaE8TJbBgsvgyT+zlTsRSXlFzQc+3KfWoODKZIZqTBaRZMft3S/',
365
+ verificationMethod: 'did:example:123#key-1',
366
+ },
367
+ },
368
+ ];
369
+
370
+ export const credentialApplicationStub = {
371
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
372
+ media_type: 'application/json',
373
+ format: 'dif/credential-manifest/application@v1.0',
374
+ data: {
375
+ json: {
376
+ '@context': [
377
+ 'https://www.w3.org/2018/credentials/v1',
378
+ 'https://identity.foundation/credential-manifest/application/v1',
379
+ ],
380
+ type: ['VerifiablePresentation', 'CredentialApplication'],
381
+ credential_application: {
382
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
383
+ manifest_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
384
+ format: {
385
+ ldp_vc: {
386
+ proof_type: ['JsonWebSignature2020', 'EcdsaSecp256k1Signature2019'],
387
+ },
388
+ },
389
+ },
390
+ presentation_submission: {
391
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
392
+ definition_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
393
+ descriptor_map: [
394
+ {
395
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
396
+ format: 'ldp_vp',
397
+ path: '$.verifiableCredential[0]',
398
+ },
399
+ ],
400
+ },
401
+ verifiableCredential: [
402
+ {
403
+ '@context': [
404
+ 'https://www.w3.org/2018/credentials/v1',
405
+ 'https://w3id.org/citizenship/v1',
406
+ 'https://w3id.org/security/bbs/v1',
407
+ ],
408
+ id: 'urn:uvci:af5vshde843jf831j128fj',
409
+ type: [
410
+ 'VerifiableCredential',
411
+ 'VaccinationCertificate',
412
+ 'PermanentResidentCard',
413
+ ],
414
+ name: 'Permanent Resident Card',
415
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
416
+ expirationDate: '2029-12-03T12:19:52Z',
417
+ issuanceDate: '2019-12-03T12:19:52Z',
418
+ issuer: 'did:example:456',
419
+ credentialSubject: {
420
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
421
+ givenName: 'Louis',
422
+ familyName: 'Pasteur',
423
+ birthCountry: 'Bahamas',
424
+ birthDate: '1958-07-17',
425
+ },
426
+ proof: {
427
+ type: 'BbsBlsSignatureProof2020',
428
+ created: '2021-02-18T23:04:28Z',
429
+ nonce:
430
+ 'JNGovx4GGoi341v/YCTcZq7aLWtBtz8UhoxEeCxZFevEGzfh94WUSg8Ly/q+2jLqzzY=',
431
+ proofPurpose: 'assertionMethod',
432
+ proofValue:
433
+ 'AB0GQA//jbDwMgaIIJeqP3fRyMYi6WDGhk0JlGJc/sk4ycuYGmyN7CbO4bA7yhIW/YQbHEkOgeMy0QM+usBgZad8x5FRePxfo4v1dSzAbJwWjx87G9F1lAIRgijlD4sYni1LhSo6svptDUmIrCAOwS2raV3G02mVejbwltMOo4+cyKcGlj9CzfjCgCuS1SqAxveDiMKGAAAAdJJF1pO6hBUGkebu/SMmiFafVdLvFgpMFUFEHTvElUQhwNSp6vxJp6Rs7pOVc9zHqAAAAAI7TJuDCf7ramzTo+syb7Njf6ExD11UKNcChaeblzegRBIkg3HoWgwR0hhd4z4D5/obSjGPKpGuD+1DoyTZhC/wqOjUZ03J1EtryZrC+y1DD14b4+khQVLgOBJ9+uvshrGDbu8+7anGezOa+qWT0FopAAAAEG6p07ghODpi8DVeDQyPwMY/iu2Lh7x3JShWniQrewY2GbsACBYOPlkNNm/qSExPRMe2X7UPpdsxpUDwqbObye4EXfAabgKd9gCmj2PNdvcOQAi5rIuJSGa4Vj7AtKoW/2vpmboPoOu4IEM1YviupomCKOzhjEuOof2/y5Adfb8JUVidWqf9Ye/HtxnzTu0HbaXL7jbwsMNn5wYfZuzpmVQgEXss2KePMSkHcfScAQNglnI90YgugHGuU+/DQcfMoA0+JviFcJy13yERAueVuzrDemzc+wJaEuNDn8UiTjAdVhLcgnHqUai+4F6ONbCfH2B3ohB3hSiGB6C7hDnEyXFOO9BijCTHrxPv3yKWNkks+3JfY28m+3NO0e2tlyH71yDX0+F6U388/bvWod/u5s3MpaCibTZEYoAc4sm4jW03HFYMmvYBuWOY6rGGOgIrXxQjx98D0macJJR7Hkh7KJhMkwvtyI4MaTPJsdJGfv8I+RFROxtRM7RcFpa4J5wF/wQnpyorqchwo6xAOKYFqCqKvI9B6Y7Da7/0iOiWsjs8a4zDiYynfYavnz6SdxCMpHLgplEQlnntqCb8C3qly2s5Ko3PGWu4M8Dlfcn4TT8YenkJDJicA91nlLaE8TJbBgsvgyT+zlTsRSXlFzQc+3KfWoODKZIZqTBaRZMft3S/',
434
+ verificationMethod: 'did:example:123#key-1',
435
+ },
436
+ },
437
+ ],
438
+ proof: {
439
+ type: 'Ed25519Signature2018',
440
+ verificationMethod: 'did:example:123#key-0',
441
+ created: '2021-05-14T20:16:29.565377',
442
+ proofPurpose: 'authentication',
443
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
444
+ jws: 'eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0IjogWyJiNjQiXX0..7M9LwdJR1_SQayHIWVHF5eSSRhbVsrjQHKUrfRhRRrlbuKlggm8mm_4EI_kTPeBpalQWiGiyCb_0OWFPtn2wAQ',
445
+ },
446
+ },
447
+ },
448
+ };
449
+
450
+ export const credentialSignatureStub = {
451
+ created: '2021-06-07T20:02:44.730614315Z',
452
+ jws: 'eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..NVum9BeYkhzwslZXm2cDOveQB9njlrCRSrdMZgwV3zZfLRXmZQ1AXdKLLmo4ClTYXFX_TWNyB8aFt9cN6sSvCg',
453
+ proofPurpose: 'assertionMethod',
454
+ type: 'Ed25519Signature2018',
455
+ verificationMethod:
456
+ 'did:orb:EiA3Xmv8A8vUH5lRRZeKakd-cjAxGC2A4aoPDjLysjghow#tMIstfHSzXfBUF7O0m2FiBEfTb93_j_4ron47IXPgEo',
457
+ };
458
+
459
+ export const signedCredentialStub = {
460
+ '@context': [
461
+ 'https://www.w3.org/2018/credentials/v1',
462
+ 'https://w3id.org/citizenship/v1',
463
+ 'https://w3id.org/security/bbs/v1',
464
+ ],
465
+ id: 'urn:uvci:af5vshde843jf831j128fj',
466
+ type: [
467
+ 'VerifiableCredential',
468
+ 'VaccinationCertificate',
469
+ 'PermanentResidentCard',
470
+ ],
471
+ name: 'Permanent Resident Card',
472
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
473
+ expirationDate: '2029-12-03T12:19:52Z',
474
+ issuanceDate: '2019-12-03T12:19:52Z',
475
+ issuer: 'did:example:456',
476
+ credentialSubject: {
477
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
478
+ givenName: 'Louis',
479
+ familyName: 'Pasteur',
480
+ birthCountry: 'Bahamas',
481
+ birthDate: '1958-07-17',
482
+ },
483
+ proof: credentialSignatureStub,
484
+ };
485
+
486
+ export const credentialFulfillmentStub = {
487
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
488
+ media_type: 'application/json',
489
+ format: 'dif/credential-manifest/fulfillment@v1.0',
490
+ data: {
491
+ json: {
492
+ '@context': [
493
+ 'https://www.w3.org/2018/credentials/v1',
494
+ 'https://identity.foundation/credential-manifest/fulfillment/v1',
495
+ ],
496
+ type: ['VerifiablePresentation', 'CredentialFulfillment'],
497
+ credential_fulfillment: {
498
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
499
+ manifest_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
500
+ descriptor_map: [
501
+ {
502
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
503
+ format: 'ldp_vc',
504
+ path: '$.verifiableCredential[0]',
505
+ },
506
+ ],
507
+ },
508
+ verifiableCredential: [signedCredentialStub],
509
+ // proof: {
510
+ // created: '2021-06-07T20:02:44.730614315Z',
511
+ // jws: 'eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..NVum9BeYkhzwslZXm2cDOveQB9njlrCRSrdMZgwV3zZfLRXmZQ1AXdKLLmo4ClTYXFX_TWNyB8aFt9cN6sSvCg',
512
+ // proofPurpose: 'authentication',
513
+ // type: 'Ed25519Signature2018',
514
+ // verificationMethod:
515
+ // 'did:orb:EiA3Xmv8A8vUH5lRRZeKakd-cjAxGC2A4aoPDjLysjghow#tMIstfHSzXfBUF7O0m2FiBEfTb93_j_4ron47IXPgEo',
516
+ // },
517
+ },
518
+ },
519
+ };
520
+
521
+ export const badCredentialApplicationStub = {
522
+ id: 'e00e11d4-906d-4c88-ba72-7c66c7113a78',
523
+ media_type: 'application/json',
524
+ format: 'dif/credential-manifest/application@v1.0',
525
+ data: {
526
+ json: {
527
+ '@context': [
528
+ 'https://www.w3.org/2018/credentials/v1',
529
+ 'https://identity.foundation/credential-manifest/application/v1',
530
+ ],
531
+ type: ['VerifiablePresentation', 'CredentialApplication'],
532
+ credential_application: {
533
+ id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
534
+ manifest_id: 'dcc75a16-19f5-4273-84ce-4da69ee2b7fe',
535
+ format: {
536
+ ldp_vc: {
537
+ proof_type: ['JsonWebSignature2020', 'EcdsaSecp256k1Signature2019'],
538
+ },
539
+ },
540
+ },
541
+ presentation_submission: {
542
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
543
+ definition_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
544
+ descriptor_map: [
545
+ {
546
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
547
+ format: 'ldp_vp',
548
+ path: '$.verifiableCredential[0]',
549
+ },
550
+ ],
551
+ },
552
+ verifiableCredential: [
553
+ {
554
+ '@context': [
555
+ 'https://www.w3.org/2018/credentials/v1',
556
+ 'https://w3id.org/citizenship/v1',
557
+ 'https://w3id.org/security/bbs/v1',
558
+ ],
559
+ id: 'urn:uvci:af5vshde843jf831j128fj',
560
+ type: [
561
+ 'VerifiableCredential',
562
+ 'VaccinationCertificate',
563
+ 'PermanentResidentCard',
564
+ ],
565
+ name: 'Permanent Resident Card',
566
+ description: 'Permanent Resident Card of Mr.Louis Pasteu',
567
+ expirationDate: '2029-12-03T12:19:52Z',
568
+ issuanceDate: '2019-12-03T12:19:52Z',
569
+ issuer: 'did:example:456',
570
+ credentialSubject: {
571
+ id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
572
+ givenName: 123,
573
+ birthDate: '1958-07-17',
574
+ },
575
+ proof: {
576
+ type: 'BbsBlsSignatureProof2020',
577
+ created: '2021-02-18T23:04:28Z',
578
+ nonce:
579
+ 'JNGovx4GGoi341v/YCTcZq7aLWtBtz8UhoxEeCxZFevEGzfh94WUSg8Ly/q+2jLqzzY=',
580
+ proofPurpose: 'assertionMethod',
581
+ proofValue:
582
+ 'AB0GQA//jbDwMgaIIJeqP3fRyMYi6WDGhk0JlGJc/sk4ycuYGmyN7CbO4bA7yhIW/YQbHEkOgeMy0QM+usBgZad8x5FRePxfo4v1dSzAbJwWjx87G9F1lAIRgijlD4sYni1LhSo6svptDUmIrCAOwS2raV3G02mVejbwltMOo4+cyKcGlj9CzfjCgCuS1SqAxveDiMKGAAAAdJJF1pO6hBUGkebu/SMmiFafVdLvFgpMFUFEHTvElUQhwNSp6vxJp6Rs7pOVc9zHqAAAAAI7TJuDCf7ramzTo+syb7Njf6ExD11UKNcChaeblzegRBIkg3HoWgwR0hhd4z4D5/obSjGPKpGuD+1DoyTZhC/wqOjUZ03J1EtryZrC+y1DD14b4+khQVLgOBJ9+uvshrGDbu8+7anGezOa+qWT0FopAAAAEG6p07ghODpi8DVeDQyPwMY/iu2Lh7x3JShWniQrewY2GbsACBYOPlkNNm/qSExPRMe2X7UPpdsxpUDwqbObye4EXfAabgKd9gCmj2PNdvcOQAi5rIuJSGa4Vj7AtKoW/2vpmboPoOu4IEM1YviupomCKOzhjEuOof2/y5Adfb8JUVidWqf9Ye/HtxnzTu0HbaXL7jbwsMNn5wYfZuzpmVQgEXss2KePMSkHcfScAQNglnI90YgugHGuU+/DQcfMoA0+JviFcJy13yERAueVuzrDemzc+wJaEuNDn8UiTjAdVhLcgnHqUai+4F6ONbCfH2B3ohB3hSiGB6C7hDnEyXFOO9BijCTHrxPv3yKWNkks+3JfY28m+3NO0e2tlyH71yDX0+F6U388/bvWod/u5s3MpaCibTZEYoAc4sm4jW03HFYMmvYBuWOY6rGGOgIrXxQjx98D0macJJR7Hkh7KJhMkwvtyI4MaTPJsdJGfv8I+RFROxtRM7RcFpa4J5wF/wQnpyorqchwo6xAOKYFqCqKvI9B6Y7Da7/0iOiWsjs8a4zDiYynfYavnz6SdxCMpHLgplEQlnntqCb8C3qly2s5Ko3PGWu4M8Dlfcn4TT8YenkJDJicA91nlLaE8TJbBgsvgyT+zlTsRSXlFzQc+3KfWoODKZIZqTBaRZMft3S/',
583
+ verificationMethod: 'did:example:123#key-1',
584
+ },
585
+ },
586
+ ],
587
+ proof: {
588
+ type: 'Ed25519Signature2018',
589
+ verificationMethod: 'did:example:123#key-0',
590
+ created: '2021-05-14T20:16:29.565377',
591
+ proofPurpose: 'authentication',
592
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
593
+ jws: 'eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0IjogWyJiNjQiXX0..7M9LwdJR1_SQayHIWVHF5eSSRhbVsrjQHKUrfRhRRrlbuKlggm8mm_4EI_kTPeBpalQWiGiyCb_0OWFPtn2wAQ',
594
+ },
595
+ },
596
+ },
597
+ };
598
+
599
+ export const requestPresentationStub = {
600
+ id: 'ed7d9b1f-9eed-4bde-b81c-3aa7485cf947',
601
+ media_type: 'application/json',
602
+ format: 'dif/presentation-exchange/definitions@v1.0',
603
+ data: {
604
+ json: {
605
+ options: {
606
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
607
+ },
608
+ presentation_definition: {
609
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
610
+ frame: {
611
+ '@context': [
612
+ 'https://www.w3.org/2018/credentials/v1',
613
+ 'https://w3id.org/vaccination/v1',
614
+ 'https://w3id.org/security/suites/bls12381-2020/v1',
615
+ ],
616
+ type: ['VerifiableCredential', 'VaccinationCertificate'],
617
+ credentialSubject: {
618
+ '@explicit': true,
619
+ type: ['VaccinationEvent'],
620
+ batchNumber: {},
621
+ countryOfVaccination: {},
622
+ },
623
+ },
624
+ input_descriptors: [
625
+ {
626
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
627
+ name: 'Vaccination Certificate',
628
+ constraints: {
629
+ fields: [
630
+ {
631
+ path: ['$.credentialSubject.batchNumber'],
632
+ filter: {
633
+ type: 'string',
634
+ },
635
+ },
636
+ {
637
+ path: ['$.credentialSubject.countryOfVaccination'],
638
+ filter: {
639
+ type: 'string',
640
+ },
641
+ },
642
+ ],
643
+ },
644
+ },
645
+ ],
646
+ },
647
+ },
648
+ },
649
+ };
650
+
651
+ export const presentProofStub = {
652
+ id: '2a3f1c4c-623c-44e6-b159-179048c51260',
653
+ media_type: 'application/ld+json',
654
+ format: 'dif/presentation-exchange/submission@v1.0',
655
+ data: {
656
+ json: {
657
+ '@context': [
658
+ 'https://www.w3.org/2018/credentials/v1',
659
+ 'https://identity.foundation/presentation-exchange/submission/v1',
660
+ ],
661
+ type: ['VerifiablePresentation', 'PresentationSubmission'],
662
+ holder: 'did:example:123',
663
+ verifiableCredential: [
664
+ {
665
+ '@context': [
666
+ 'https://www.w3.org/2018/credentials/v1',
667
+ 'https://w3id.org/vaccination/v1',
668
+ 'https://w3id.org/security/bbs/v1',
669
+ ],
670
+ id: 'urn:uvci:af5vshde843jf831j128fj',
671
+ type: ['VerifiableCredential', 'VaccinationCertificate'],
672
+ description: 'COVID-19 Vaccination Certificate',
673
+ name: 'COVID-19 Vaccination Certificate',
674
+ expirationDate: '2029-12-03T12:19:52Z',
675
+ issuanceDate: '2019-12-03T12:19:52Z',
676
+ issuer: 'did:example:456',
677
+ credentialSubject: {
678
+ id: 'urn:bnid:_:c14n2',
679
+ type: 'VaccinationEvent',
680
+ batchNumber: '1183738569',
681
+ countryOfVaccination: 'NZ',
682
+ },
683
+ proof: {
684
+ type: 'BbsBlsSignatureProof2020',
685
+ created: '2021-02-18T23:04:28Z',
686
+ nonce:
687
+ 'JNGovx4GGoi341v/YCTcZq7aLWtBtz8UhoxEeCxZFevEGzfh94WUSg8Ly/q+2jLqzzY=',
688
+ proofPurpose: 'assertionMethod',
689
+ proofValue:
690
+ 'AB0GQA//jbDwMgaIIJeqP3fRyMYi6WDGhk0JlGJc/sk4ycuYGmyN7CbO4bA7yhIW/YQbHEkOgeMy0QM+usBgZad8x5FRePxfo4v1dSzAbJwWjx87G9F1lAIRgijlD4sYni1LhSo6svptDUmIrCAOwS2raV3G02mVejbwltMOo4+cyKcGlj9CzfjCgCuS1SqAxveDiMKGAAAAdJJF1pO6hBUGkebu/SMmiFafVdLvFgpMFUFEHTvElUQhwNSp6vxJp6Rs7pOVc9zHqAAAAAI7TJuDCf7ramzTo+syb7Njf6ExD11UKNcChaeblzegRBIkg3HoWgwR0hhd4z4D5/obSjGPKpGuD+1DoyTZhC/wqOjUZ03J1EtryZrC+y1DD14b4+khQVLgOBJ9+uvshrGDbu8+7anGezOa+qWT0FopAAAAEG6p07ghODpi8DVeDQyPwMY/iu2Lh7x3JShWniQrewY2GbsACBYOPlkNNm/qSExPRMe2X7UPpdsxpUDwqbObye4EXfAabgKd9gCmj2PNdvcOQAi5rIuJSGa4Vj7AtKoW/2vpmboPoOu4IEM1YviupomCKOzhjEuOof2/y5Adfb8JUVidWqf9Ye/HtxnzTu0HbaXL7jbwsMNn5wYfZuzpmVQgEXss2KePMSkHcfScAQNglnI90YgugHGuU+/DQcfMoA0+JviFcJy13yERAueVuzrDemzc+wJaEuNDn8UiTjAdVhLcgnHqUai+4F6ONbCfH2B3ohB3hSiGB6C7hDnEyXFOO9BijCTHrxPv3yKWNkks+3JfY28m+3NO0e2tlyH71yDX0+F6U388/bvWod/u5s3MpaCibTZEYoAc4sm4jW03HFYMmvYBuWOY6rGGOgIrXxQjx98D0macJJR7Hkh7KJhMkwvtyI4MaTPJsdJGfv8I+RFROxtRM7RcFpa4J5wF/wQnpyorqchwo6xAOKYFqCqKvI9B6Y7Da7/0iOiWsjs8a4zDiYynfYavnz6SdxCMpHLgplEQlnntqCb8C3qly2s5Ko3PGWu4M8Dlfcn4TT8YenkJDJicA91nlLaE8TJbBgsvgyT+zlTsRSXlFzQc+3KfWoODKZIZqTBaRZMft3S/',
691
+ verificationMethod: 'did:example:123#key-1',
692
+ },
693
+ },
694
+ ],
695
+ presentation_submission: {
696
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
697
+ definition_id: 'f137e0db-db7b-4776-9530-83c808a34a42',
698
+ descriptor_map: [
699
+ {
700
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
701
+ format: 'ldp_vp',
702
+ path: '$.verifiableCredential[0]',
703
+ },
704
+ ],
705
+ },
706
+ proof: {
707
+ type: 'Ed25519Signature2018',
708
+ verificationMethod: 'did:example:123#key-0',
709
+ created: '2021-05-14T20:16:29.565377',
710
+ proofPurpose: 'authentication',
711
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
712
+ jws: 'eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0IjogWyJiNjQiXX0..7M9LwdJR1_SQayHIWVHF5eSSRhbVsrjQHKUrfRhRRrlbuKlggm8mm_4EI_kTPeBpalQWiGiyCb_0OWFPtn2wAQ',
713
+ },
714
+ },
715
+ },
716
+ };
717
+
718
+ export const badPresentProofStub = {
719
+ id: '2a3f1c4c-623c-44e6-b159-179048c51260',
720
+ media_type: 'application/ld+json',
721
+ format: 'dif/presentation-exchange/submission@v1.0',
722
+ data: {
723
+ json: {
724
+ '@context': [
725
+ 'https://www.w3.org/2018/credentials/v1',
726
+ 'https://identity.foundation/presentation-exchange/submission/v1',
727
+ ],
728
+ type: ['VerifiablePresentation', 'PresentationSubmission'],
729
+ holder: 'did:example:123',
730
+ verifiableCredential: [
731
+ {
732
+ '@context': [
733
+ 'https://www.w3.org/2018/credentials/v1',
734
+ 'https://w3id.org/vaccination/v1',
735
+ 'https://w3id.org/security/bbs/v1',
736
+ ],
737
+ id: 'urn:uvci:af5vshde843jf831j128fj',
738
+ type: ['VerifiableCredential', 'VaccinationCertificate'],
739
+ description: 'COVID-19 Vaccination Certificate',
740
+ name: 'COVID-19 Vaccination Certificate',
741
+ expirationDate: '2029-12-03T12:19:52Z',
742
+ issuanceDate: '2019-12-03T12:19:52Z',
743
+ issuer: 'did:example:456',
744
+ credentialSubject: {
745
+ id: 'urn:bnid:_:c14n2',
746
+ type: 'VaccinationEvent',
747
+ countryOfVaccination: 'NZ',
748
+ },
749
+ proof: {
750
+ type: 'BbsBlsSignatureProof2020',
751
+ created: '2021-02-18T23:04:28Z',
752
+ nonce:
753
+ 'JNGovx4GGoi341v/YCTcZq7aLWtBtz8UhoxEeCxZFevEGzfh94WUSg8Ly/q+2jLqzzY=',
754
+ proofPurpose: 'assertionMethod',
755
+ proofValue:
756
+ 'AB0GQA//jbDwMgaIIJeqP3fRyMYi6WDGhk0JlGJc/sk4ycuYGmyN7CbO4bA7yhIW/YQbHEkOgeMy0QM+usBgZad8x5FRePxfo4v1dSzAbJwWjx87G9F1lAIRgijlD4sYni1LhSo6svptDUmIrCAOwS2raV3G02mVejbwltMOo4+cyKcGlj9CzfjCgCuS1SqAxveDiMKGAAAAdJJF1pO6hBUGkebu/SMmiFafVdLvFgpMFUFEHTvElUQhwNSp6vxJp6Rs7pOVc9zHqAAAAAI7TJuDCf7ramzTo+syb7Njf6ExD11UKNcChaeblzegRBIkg3HoWgwR0hhd4z4D5/obSjGPKpGuD+1DoyTZhC/wqOjUZ03J1EtryZrC+y1DD14b4+khQVLgOBJ9+uvshrGDbu8+7anGezOa+qWT0FopAAAAEG6p07ghODpi8DVeDQyPwMY/iu2Lh7x3JShWniQrewY2GbsACBYOPlkNNm/qSExPRMe2X7UPpdsxpUDwqbObye4EXfAabgKd9gCmj2PNdvcOQAi5rIuJSGa4Vj7AtKoW/2vpmboPoOu4IEM1YviupomCKOzhjEuOof2/y5Adfb8JUVidWqf9Ye/HtxnzTu0HbaXL7jbwsMNn5wYfZuzpmVQgEXss2KePMSkHcfScAQNglnI90YgugHGuU+/DQcfMoA0+JviFcJy13yERAueVuzrDemzc+wJaEuNDn8UiTjAdVhLcgnHqUai+4F6ONbCfH2B3ohB3hSiGB6C7hDnEyXFOO9BijCTHrxPv3yKWNkks+3JfY28m+3NO0e2tlyH71yDX0+F6U388/bvWod/u5s3MpaCibTZEYoAc4sm4jW03HFYMmvYBuWOY6rGGOgIrXxQjx98D0macJJR7Hkh7KJhMkwvtyI4MaTPJsdJGfv8I+RFROxtRM7RcFpa4J5wF/wQnpyorqchwo6xAOKYFqCqKvI9B6Y7Da7/0iOiWsjs8a4zDiYynfYavnz6SdxCMpHLgplEQlnntqCb8C3qly2s5Ko3PGWu4M8Dlfcn4TT8YenkJDJicA91nlLaE8TJbBgsvgyT+zlTsRSXlFzQc+3KfWoODKZIZqTBaRZMft3S/',
757
+ verificationMethod: 'did:example:123#key-1',
758
+ },
759
+ },
760
+ ],
761
+ presentation_submission: {
762
+ id: '1d257c50-454f-4c96-a273-c5368e01fe63',
763
+ definition_id: '32f54163-7166-48f1-93d8-ff217bdb0654',
764
+ descriptor_map: [
765
+ {
766
+ id: 'vaccination_input',
767
+ format: 'ldp_vp',
768
+ path: '$.verifiableCredential[0]',
769
+ },
770
+ ],
771
+ },
772
+ proof: {
773
+ type: 'Ed25519Signature2018',
774
+ verificationMethod: 'did:example:123#key-0',
775
+ created: '2021-05-14T20:16:29.565377',
776
+ proofPurpose: 'authentication',
777
+ challenge: 'f137e0db-db7b-4776-9530-83c808a34a42',
778
+ jws: 'eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0IjogWyJiNjQiXX0..7M9LwdJR1_SQayHIWVHF5eSSRhbVsrjQHKUrfRhRRrlbuKlggm8mm_4EI_kTPeBpalQWiGiyCb_0OWFPtn2wAQ',
779
+ },
780
+ },
781
+ },
782
+ };
783
+
784
+ export const offerCredentialMessageStub1: WACIMessage = {
785
+ type: WACIMessageType.OfferCredential,
786
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
787
+ thid: 'f137e0db-db7b-4776-9530-83c808a34a42',
788
+ from: 'did:example:issuer',
789
+ to: ['did:example:holder'],
790
+ body: {},
791
+ attachments: offerCredentialMessageAttachmentsStub1,
792
+ };
793
+
794
+ export const offerCredentialMessageStub2: WACIMessage = {
795
+ type: WACIMessageType.OfferCredential,
796
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
797
+ thid: 'f137e0db-db7b-4776-9530-83c808a34a42',
798
+ from: 'did:example:issuer',
799
+ to: ['did:example:holder'],
800
+ body: {},
801
+ attachments: offerCredentialMessageAttachmentsStub2,
802
+ };
803
+
804
+ export const requestCredentialMessageStub: WACIMessage = {
805
+ type: WACIMessageType.RequestCredential,
806
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
807
+ thid: 'f137e0db-db7b-4776-9530-83c808a34a42',
808
+ from: 'did:example:holder',
809
+ to: ['did:example:issuer'],
810
+ body: {},
811
+ attachments: [credentialApplicationStub],
812
+ };
813
+
814
+ export const requestPresentationMessageStub: WACIMessage = {
815
+ type: WACIMessageType.RequestPresentation,
816
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
817
+ thid: 'f137e0db-db7b-4776-9530-83c808a34a42',
818
+ from: 'did:example:issuer',
819
+ to: ['did:example:holder'],
820
+ body: {},
821
+ attachments: [requestPresentationStub],
822
+ };
823
+
824
+ export const presentProofMessageStub: WACIMessage = {
825
+ type: WACIMessageType.PresentProof,
826
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
827
+ thid: 'f137e0db-db7b-4776-9530-83c808a34a42',
828
+ from: 'did:example:holder',
829
+ to: ['did:example:issuer'],
830
+ body: {},
831
+ attachments: [presentProofStub],
832
+ };
833
+
834
+ export const badPresentProofMessageStub: WACIMessage = {
835
+ type: WACIMessageType.PresentProof,
836
+ id: 'f137e0db-db7b-4776-9530-83c808a34a42',
837
+ thid: 'f137e0db-db7b-4776-9530-83c808a34a42',
838
+ from: 'did:example:holder',
839
+ to: ['did:example:issuer'],
840
+ body: {},
841
+ attachments: [badPresentProofStub],
842
+ };