@twin.org/identity-models 0.0.1-next.9 → 0.0.1
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.
- package/dist/cjs/index.cjs +150 -21
- package/dist/esm/index.mjs +150 -22
- package/dist/types/factories/identityResolverConnectorFactory.d.ts +6 -0
- package/dist/types/index.d.ts +37 -11
- package/dist/types/models/IIdentityComponent.d.ts +134 -5
- package/dist/types/models/IIdentityConnector.d.ts +25 -29
- package/dist/types/models/IIdentityResolverComponent.d.ts +13 -0
- package/dist/types/models/IIdentityResolverConnector.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityCreateRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityProofCreateRequest.d.ts +33 -0
- package/dist/types/models/api/identity/IIdentityProofCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityProofVerifyRequest.d.ts +20 -0
- package/dist/types/models/api/identity/IIdentityProofVerifyResponse.d.ts +11 -0
- package/dist/types/models/api/identity/IIdentityRemoveRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityServiceCreateRequest.d.ts +31 -0
- package/dist/types/models/api/identity/IIdentityServiceCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityServiceRemoveRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateRequest.d.ts +36 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateResponse.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.d.ts +18 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyResponse.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateRequest.d.ts +45 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateResponse.d.ts +19 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyRequest.d.ts +14 -0
- package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyResponse.d.ts +23 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodCreateRequest.d.ts +28 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodCreateResponse.d.ts +10 -0
- package/dist/types/models/api/identity/IIdentityVerificationMethodRemoveRequest.d.ts +18 -0
- package/dist/types/models/api/{IIdentityProfileListRequest.d.ts → profile/IIdentityProfileListRequest.d.ts} +1 -1
- package/dist/types/models/api/{IIdentityResolveRequest.d.ts → resolver/IIdentityResolveRequest.d.ts} +2 -2
- package/dist/types/utils/documentHelper.d.ts +33 -2
- package/dist/types/utils/verificationHelper.d.ts +29 -0
- package/docs/changelog.md +152 -1
- package/docs/reference/classes/DocumentHelper.md +122 -8
- package/docs/reference/classes/VerificationHelper.md +87 -0
- package/docs/reference/index.md +27 -5
- package/docs/reference/interfaces/IIdentityComponent.md +500 -6
- package/docs/reference/interfaces/IIdentityConnector.md +150 -130
- package/docs/reference/interfaces/IIdentityCreateRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityProfileComponent.md +62 -50
- package/docs/reference/interfaces/IIdentityProfileConnector.md +60 -44
- package/docs/reference/interfaces/IIdentityProfileListRequest.md +1 -1
- package/docs/reference/interfaces/IIdentityProofCreateRequest.md +43 -0
- package/docs/reference/interfaces/IIdentityProofCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityProofVerifyRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityProofVerifyResponse.md +15 -0
- package/docs/reference/interfaces/IIdentityRemoveRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityResolveRequest.md +3 -3
- package/docs/reference/interfaces/IIdentityResolverComponent.md +29 -0
- package/docs/reference/interfaces/IIdentityResolverConnector.md +33 -0
- package/docs/reference/interfaces/IIdentityServiceCreateRequest.md +43 -0
- package/docs/reference/interfaces/IIdentityServiceCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityServiceRemoveRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +49 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialRevokeRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateRequest.md +61 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateResponse.md +23 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyRequest.md +17 -0
- package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyResponse.md +29 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateRequest.md +37 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodCreateResponse.md +11 -0
- package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +23 -0
- package/docs/reference/variables/IdentityResolverConnectorFactory.md +5 -0
- package/locales/en.json +10 -4
- package/package.json +10 -10
- package/dist/types/models/identityRole.d.ts +0 -21
- package/docs/reference/type-aliases/IdentityRole.md +0 -5
- package/docs/reference/variables/IdentityRole.md +0 -25
- /package/dist/types/models/api/{IIdentityProfileCreateRequest.d.ts → profile/IIdentityProfileCreateRequest.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityProfileGetPublicRequest.d.ts → profile/IIdentityProfileGetPublicRequest.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityProfileGetPublicResponse.d.ts → profile/IIdentityProfileGetPublicResponse.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityProfileGetRequest.d.ts → profile/IIdentityProfileGetRequest.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityProfileGetResponse.d.ts → profile/IIdentityProfileGetResponse.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityProfileListResponse.d.ts → profile/IIdentityProfileListResponse.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityProfileUpdateRequest.d.ts → profile/IIdentityProfileUpdateRequest.d.ts} +0 -0
- /package/dist/types/models/api/{IIdentityResolveResponse.d.ts → resolver/IIdentityResolveResponse.d.ts} +0 -0
|
@@ -8,20 +8,514 @@ Interface describing a contract which provides identity operations.
|
|
|
8
8
|
|
|
9
9
|
## Methods
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### identityCreate()
|
|
12
12
|
|
|
13
|
-
> **
|
|
13
|
+
> **identityCreate**(`namespace?`, `controller?`): `Promise`\<`IDidDocument`\>
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Create a new identity.
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### namespace?
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
`string`
|
|
22
|
+
|
|
23
|
+
The namespace of the connector to use for the identity, defaults to service configured namespace.
|
|
24
|
+
|
|
25
|
+
##### controller?
|
|
26
|
+
|
|
27
|
+
`string`
|
|
28
|
+
|
|
29
|
+
The controller of the identity who can make changes.
|
|
22
30
|
|
|
23
31
|
#### Returns
|
|
24
32
|
|
|
25
33
|
`Promise`\<`IDidDocument`\>
|
|
26
34
|
|
|
27
|
-
The
|
|
35
|
+
The created identity document.
|
|
36
|
+
|
|
37
|
+
***
|
|
38
|
+
|
|
39
|
+
### identityRemove()
|
|
40
|
+
|
|
41
|
+
> **identityRemove**(`identity`, `controller?`): `Promise`\<`void`\>
|
|
42
|
+
|
|
43
|
+
Remove an identity.
|
|
44
|
+
|
|
45
|
+
#### Parameters
|
|
46
|
+
|
|
47
|
+
##### identity
|
|
48
|
+
|
|
49
|
+
`string`
|
|
50
|
+
|
|
51
|
+
The id of the document to remove.
|
|
52
|
+
|
|
53
|
+
##### controller?
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The controller of the identity who can make changes.
|
|
58
|
+
|
|
59
|
+
#### Returns
|
|
60
|
+
|
|
61
|
+
`Promise`\<`void`\>
|
|
62
|
+
|
|
63
|
+
Nothing.
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### verificationMethodCreate()
|
|
68
|
+
|
|
69
|
+
> **verificationMethodCreate**(`identity`, `verificationMethodType`, `verificationMethodId?`, `controller?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
70
|
+
|
|
71
|
+
Add a verification method to the document in JSON Web key Format.
|
|
72
|
+
|
|
73
|
+
#### Parameters
|
|
74
|
+
|
|
75
|
+
##### identity
|
|
76
|
+
|
|
77
|
+
`string`
|
|
78
|
+
|
|
79
|
+
The id of the document to add the verification method to.
|
|
80
|
+
|
|
81
|
+
##### verificationMethodType
|
|
82
|
+
|
|
83
|
+
`DidVerificationMethodType`
|
|
84
|
+
|
|
85
|
+
The type of the verification method to add.
|
|
86
|
+
|
|
87
|
+
##### verificationMethodId?
|
|
88
|
+
|
|
89
|
+
`string`
|
|
90
|
+
|
|
91
|
+
The id of the verification method, if undefined uses the kid of the generated JWK.
|
|
92
|
+
|
|
93
|
+
##### controller?
|
|
94
|
+
|
|
95
|
+
`string`
|
|
96
|
+
|
|
97
|
+
The controller of the identity who can make changes.
|
|
98
|
+
|
|
99
|
+
#### Returns
|
|
100
|
+
|
|
101
|
+
`Promise`\<`IDidDocumentVerificationMethod`\>
|
|
102
|
+
|
|
103
|
+
The verification method.
|
|
104
|
+
|
|
105
|
+
#### Throws
|
|
106
|
+
|
|
107
|
+
NotFoundError if the id can not be resolved.
|
|
108
|
+
|
|
109
|
+
#### Throws
|
|
110
|
+
|
|
111
|
+
NotSupportedError if the platform does not support multiple keys.
|
|
112
|
+
|
|
113
|
+
***
|
|
114
|
+
|
|
115
|
+
### verificationMethodRemove()
|
|
116
|
+
|
|
117
|
+
> **verificationMethodRemove**(`verificationMethodId`, `controller?`): `Promise`\<`void`\>
|
|
118
|
+
|
|
119
|
+
Remove a verification method from the document.
|
|
120
|
+
|
|
121
|
+
#### Parameters
|
|
122
|
+
|
|
123
|
+
##### verificationMethodId
|
|
124
|
+
|
|
125
|
+
`string`
|
|
126
|
+
|
|
127
|
+
The id of the verification method.
|
|
128
|
+
|
|
129
|
+
##### controller?
|
|
130
|
+
|
|
131
|
+
`string`
|
|
132
|
+
|
|
133
|
+
The controller of the identity who can make changes.
|
|
134
|
+
|
|
135
|
+
#### Returns
|
|
136
|
+
|
|
137
|
+
`Promise`\<`void`\>
|
|
138
|
+
|
|
139
|
+
Nothing.
|
|
140
|
+
|
|
141
|
+
#### Throws
|
|
142
|
+
|
|
143
|
+
NotFoundError if the id can not be resolved.
|
|
144
|
+
|
|
145
|
+
#### Throws
|
|
146
|
+
|
|
147
|
+
NotSupportedError if the platform does not support multiple revocable keys.
|
|
148
|
+
|
|
149
|
+
***
|
|
150
|
+
|
|
151
|
+
### serviceCreate()
|
|
152
|
+
|
|
153
|
+
> **serviceCreate**(`identity`, `serviceId`, `serviceType`, `serviceEndpoint`, `controller?`): `Promise`\<`IDidService`\>
|
|
154
|
+
|
|
155
|
+
Add a service to the document.
|
|
156
|
+
|
|
157
|
+
#### Parameters
|
|
158
|
+
|
|
159
|
+
##### identity
|
|
160
|
+
|
|
161
|
+
`string`
|
|
162
|
+
|
|
163
|
+
The id of the document to add the service to.
|
|
164
|
+
|
|
165
|
+
##### serviceId
|
|
166
|
+
|
|
167
|
+
`string`
|
|
168
|
+
|
|
169
|
+
The id of the service.
|
|
170
|
+
|
|
171
|
+
##### serviceType
|
|
172
|
+
|
|
173
|
+
The type of the service.
|
|
174
|
+
|
|
175
|
+
`string` | `string`[]
|
|
176
|
+
|
|
177
|
+
##### serviceEndpoint
|
|
178
|
+
|
|
179
|
+
The endpoint for the service.
|
|
180
|
+
|
|
181
|
+
`string` | `string`[]
|
|
182
|
+
|
|
183
|
+
##### controller?
|
|
184
|
+
|
|
185
|
+
`string`
|
|
186
|
+
|
|
187
|
+
The controller of the identity who can make changes.
|
|
188
|
+
|
|
189
|
+
#### Returns
|
|
190
|
+
|
|
191
|
+
`Promise`\<`IDidService`\>
|
|
192
|
+
|
|
193
|
+
The service.
|
|
194
|
+
|
|
195
|
+
#### Throws
|
|
196
|
+
|
|
197
|
+
NotFoundError if the id can not be resolved.
|
|
198
|
+
|
|
199
|
+
***
|
|
200
|
+
|
|
201
|
+
### serviceRemove()
|
|
202
|
+
|
|
203
|
+
> **serviceRemove**(`serviceId`, `controller?`): `Promise`\<`void`\>
|
|
204
|
+
|
|
205
|
+
Remove a service from the document.
|
|
206
|
+
|
|
207
|
+
#### Parameters
|
|
208
|
+
|
|
209
|
+
##### serviceId
|
|
210
|
+
|
|
211
|
+
`string`
|
|
212
|
+
|
|
213
|
+
The id of the service.
|
|
214
|
+
|
|
215
|
+
##### controller?
|
|
216
|
+
|
|
217
|
+
`string`
|
|
218
|
+
|
|
219
|
+
The controller of the identity who can make changes.
|
|
220
|
+
|
|
221
|
+
#### Returns
|
|
222
|
+
|
|
223
|
+
`Promise`\<`void`\>
|
|
224
|
+
|
|
225
|
+
Nothing.
|
|
226
|
+
|
|
227
|
+
#### Throws
|
|
228
|
+
|
|
229
|
+
NotFoundError if the id can not be resolved.
|
|
230
|
+
|
|
231
|
+
***
|
|
232
|
+
|
|
233
|
+
### verifiableCredentialCreate()
|
|
234
|
+
|
|
235
|
+
> **verifiableCredentialCreate**(`verificationMethodId`, `id`, `subject`, `revocationIndex?`, `controller?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
236
|
+
|
|
237
|
+
Create a verifiable credential for a verification method.
|
|
238
|
+
|
|
239
|
+
#### Parameters
|
|
240
|
+
|
|
241
|
+
##### verificationMethodId
|
|
242
|
+
|
|
243
|
+
`string`
|
|
244
|
+
|
|
245
|
+
The verification method id to use.
|
|
246
|
+
|
|
247
|
+
##### id
|
|
248
|
+
|
|
249
|
+
The id of the credential.
|
|
250
|
+
|
|
251
|
+
`undefined` | `string`
|
|
252
|
+
|
|
253
|
+
##### subject
|
|
254
|
+
|
|
255
|
+
`IJsonLdNodeObject`
|
|
256
|
+
|
|
257
|
+
The credential subject to store in the verifiable credential.
|
|
258
|
+
|
|
259
|
+
##### revocationIndex?
|
|
260
|
+
|
|
261
|
+
`number`
|
|
262
|
+
|
|
263
|
+
The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
264
|
+
|
|
265
|
+
##### controller?
|
|
266
|
+
|
|
267
|
+
`string`
|
|
268
|
+
|
|
269
|
+
The controller of the identity who can make changes.
|
|
270
|
+
|
|
271
|
+
#### Returns
|
|
272
|
+
|
|
273
|
+
`Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
274
|
+
|
|
275
|
+
The created verifiable credential and its token.
|
|
276
|
+
|
|
277
|
+
#### Throws
|
|
278
|
+
|
|
279
|
+
NotFoundError if the id can not be resolved.
|
|
280
|
+
|
|
281
|
+
***
|
|
282
|
+
|
|
283
|
+
### verifiableCredentialVerify()
|
|
284
|
+
|
|
285
|
+
> **verifiableCredentialVerify**(`credentialJwt`): `Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
286
|
+
|
|
287
|
+
Verify a verifiable credential is valid.
|
|
288
|
+
|
|
289
|
+
#### Parameters
|
|
290
|
+
|
|
291
|
+
##### credentialJwt
|
|
292
|
+
|
|
293
|
+
`string`
|
|
294
|
+
|
|
295
|
+
The credential to verify.
|
|
296
|
+
|
|
297
|
+
#### Returns
|
|
298
|
+
|
|
299
|
+
`Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
300
|
+
|
|
301
|
+
The credential stored in the jwt and the revocation status.
|
|
302
|
+
|
|
303
|
+
***
|
|
304
|
+
|
|
305
|
+
### verifiableCredentialRevoke()
|
|
306
|
+
|
|
307
|
+
> **verifiableCredentialRevoke**(`issuerId`, `credentialIndex`, `controller?`): `Promise`\<`void`\>
|
|
308
|
+
|
|
309
|
+
Revoke verifiable credential.
|
|
310
|
+
|
|
311
|
+
#### Parameters
|
|
312
|
+
|
|
313
|
+
##### issuerId
|
|
314
|
+
|
|
315
|
+
`string`
|
|
316
|
+
|
|
317
|
+
The id of the document to update the revocation list for.
|
|
318
|
+
|
|
319
|
+
##### credentialIndex
|
|
320
|
+
|
|
321
|
+
`number`
|
|
322
|
+
|
|
323
|
+
The revocation bitmap index revoke.
|
|
324
|
+
|
|
325
|
+
##### controller?
|
|
326
|
+
|
|
327
|
+
`string`
|
|
328
|
+
|
|
329
|
+
The controller of the identity who can make changes.
|
|
330
|
+
|
|
331
|
+
#### Returns
|
|
332
|
+
|
|
333
|
+
`Promise`\<`void`\>
|
|
334
|
+
|
|
335
|
+
Nothing.
|
|
336
|
+
|
|
337
|
+
***
|
|
338
|
+
|
|
339
|
+
### verifiableCredentialUnrevoke()
|
|
340
|
+
|
|
341
|
+
> **verifiableCredentialUnrevoke**(`issuerId`, `credentialIndex`, `controller?`): `Promise`\<`void`\>
|
|
342
|
+
|
|
343
|
+
Unrevoke verifiable credential.
|
|
344
|
+
|
|
345
|
+
#### Parameters
|
|
346
|
+
|
|
347
|
+
##### issuerId
|
|
348
|
+
|
|
349
|
+
`string`
|
|
350
|
+
|
|
351
|
+
The id of the document to update the revocation list for.
|
|
352
|
+
|
|
353
|
+
##### credentialIndex
|
|
354
|
+
|
|
355
|
+
`number`
|
|
356
|
+
|
|
357
|
+
The revocation bitmap index to un revoke.
|
|
358
|
+
|
|
359
|
+
##### controller?
|
|
360
|
+
|
|
361
|
+
`string`
|
|
362
|
+
|
|
363
|
+
The controller of the identity who can make changes.
|
|
364
|
+
|
|
365
|
+
#### Returns
|
|
366
|
+
|
|
367
|
+
`Promise`\<`void`\>
|
|
368
|
+
|
|
369
|
+
Nothing.
|
|
370
|
+
|
|
371
|
+
***
|
|
372
|
+
|
|
373
|
+
### verifiablePresentationCreate()
|
|
374
|
+
|
|
375
|
+
> **verifiablePresentationCreate**(`verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes?`, `controller?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
376
|
+
|
|
377
|
+
Create a verifiable presentation from the supplied verifiable credentials.
|
|
378
|
+
|
|
379
|
+
#### Parameters
|
|
380
|
+
|
|
381
|
+
##### verificationMethodId
|
|
382
|
+
|
|
383
|
+
`string`
|
|
384
|
+
|
|
385
|
+
The method to associate with the presentation.
|
|
386
|
+
|
|
387
|
+
##### presentationId
|
|
388
|
+
|
|
389
|
+
The id of the presentation.
|
|
390
|
+
|
|
391
|
+
`undefined` | `string`
|
|
392
|
+
|
|
393
|
+
##### contexts
|
|
394
|
+
|
|
395
|
+
The contexts for the data stored in the verifiable credential.
|
|
396
|
+
|
|
397
|
+
`undefined` | `IJsonLdContextDefinitionRoot`
|
|
398
|
+
|
|
399
|
+
##### types
|
|
400
|
+
|
|
401
|
+
The types for the data stored in the verifiable credential.
|
|
402
|
+
|
|
403
|
+
`undefined` | `string` | `string`[]
|
|
404
|
+
|
|
405
|
+
##### verifiableCredentials
|
|
406
|
+
|
|
407
|
+
(`string` \| `IDidVerifiableCredential`)[]
|
|
408
|
+
|
|
409
|
+
The credentials to use for creating the presentation in jwt format.
|
|
410
|
+
|
|
411
|
+
##### expiresInMinutes?
|
|
412
|
+
|
|
413
|
+
`number`
|
|
414
|
+
|
|
415
|
+
The time in minutes for the presentation to expire.
|
|
416
|
+
|
|
417
|
+
##### controller?
|
|
418
|
+
|
|
419
|
+
`string`
|
|
420
|
+
|
|
421
|
+
The controller of the identity who can make changes.
|
|
422
|
+
|
|
423
|
+
#### Returns
|
|
424
|
+
|
|
425
|
+
`Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
426
|
+
|
|
427
|
+
The created verifiable presentation and its token.
|
|
428
|
+
|
|
429
|
+
#### Throws
|
|
430
|
+
|
|
431
|
+
NotFoundError if the id can not be resolved.
|
|
432
|
+
|
|
433
|
+
***
|
|
434
|
+
|
|
435
|
+
### verifiablePresentationVerify()
|
|
436
|
+
|
|
437
|
+
> **verifiablePresentationVerify**(`presentationJwt`): `Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
438
|
+
|
|
439
|
+
Verify a verifiable presentation is valid.
|
|
440
|
+
|
|
441
|
+
#### Parameters
|
|
442
|
+
|
|
443
|
+
##### presentationJwt
|
|
444
|
+
|
|
445
|
+
`string`
|
|
446
|
+
|
|
447
|
+
The presentation to verify.
|
|
448
|
+
|
|
449
|
+
#### Returns
|
|
450
|
+
|
|
451
|
+
`Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
452
|
+
|
|
453
|
+
The presentation stored in the jwt and the revocation status.
|
|
454
|
+
|
|
455
|
+
***
|
|
456
|
+
|
|
457
|
+
### proofCreate()
|
|
458
|
+
|
|
459
|
+
> **proofCreate**(`verificationMethodId`, `proofType`, `unsecureDocument`, `controller?`): `Promise`\<`IProof`\>
|
|
460
|
+
|
|
461
|
+
Create a proof for a document with the specified verification method.
|
|
462
|
+
|
|
463
|
+
#### Parameters
|
|
464
|
+
|
|
465
|
+
##### verificationMethodId
|
|
466
|
+
|
|
467
|
+
`string`
|
|
468
|
+
|
|
469
|
+
The verification method id to use.
|
|
470
|
+
|
|
471
|
+
##### proofType
|
|
472
|
+
|
|
473
|
+
`ProofTypes`
|
|
474
|
+
|
|
475
|
+
The type of proof to create.
|
|
476
|
+
|
|
477
|
+
##### unsecureDocument
|
|
478
|
+
|
|
479
|
+
`IJsonLdNodeObject`
|
|
480
|
+
|
|
481
|
+
The unsecure document to create the proof for.
|
|
482
|
+
|
|
483
|
+
##### controller?
|
|
484
|
+
|
|
485
|
+
`string`
|
|
486
|
+
|
|
487
|
+
The controller of the identity who can make changes.
|
|
488
|
+
|
|
489
|
+
#### Returns
|
|
490
|
+
|
|
491
|
+
`Promise`\<`IProof`\>
|
|
492
|
+
|
|
493
|
+
The proof.
|
|
494
|
+
|
|
495
|
+
***
|
|
496
|
+
|
|
497
|
+
### proofVerify()
|
|
498
|
+
|
|
499
|
+
> **proofVerify**(`document`, `proof`): `Promise`\<`boolean`\>
|
|
500
|
+
|
|
501
|
+
Verify proof for a document with the specified verification method.
|
|
502
|
+
|
|
503
|
+
#### Parameters
|
|
504
|
+
|
|
505
|
+
##### document
|
|
506
|
+
|
|
507
|
+
`IJsonLdNodeObject`
|
|
508
|
+
|
|
509
|
+
The document to verify.
|
|
510
|
+
|
|
511
|
+
##### proof
|
|
512
|
+
|
|
513
|
+
`IProof`
|
|
514
|
+
|
|
515
|
+
The proof to verify.
|
|
516
|
+
|
|
517
|
+
#### Returns
|
|
518
|
+
|
|
519
|
+
`Promise`\<`boolean`\>
|
|
520
|
+
|
|
521
|
+
True if the proof is verified.
|