@twin.org/identity-models 0.0.1-next.8 → 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/IIdentityProfileGetPublicResponse.md +2 -2
- 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
|
@@ -16,7 +16,9 @@ Create a new document.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### controller
|
|
20
|
+
|
|
21
|
+
`string`
|
|
20
22
|
|
|
21
23
|
The controller of the identity who can make changes.
|
|
22
24
|
|
|
@@ -28,51 +30,63 @@ The created document.
|
|
|
28
30
|
|
|
29
31
|
***
|
|
30
32
|
|
|
31
|
-
###
|
|
33
|
+
### removeDocument()
|
|
32
34
|
|
|
33
|
-
> **
|
|
35
|
+
> **removeDocument**(`controller`, `documentId`): `Promise`\<`void`\>
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
Remove a document.
|
|
36
38
|
|
|
37
39
|
#### Parameters
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
##### controller
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
`string`
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
The controller of the identity who can make changes.
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
##### documentId
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
`string`
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
The id of the document to remove.
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`Promise`\<`void`\>
|
|
56
|
+
|
|
57
|
+
Nothing.
|
|
52
58
|
|
|
53
59
|
***
|
|
54
60
|
|
|
55
61
|
### addVerificationMethod()
|
|
56
62
|
|
|
57
|
-
> **addVerificationMethod**(`controller`, `documentId`, `verificationMethodType`, `verificationMethodId
|
|
63
|
+
> **addVerificationMethod**(`controller`, `documentId`, `verificationMethodType`, `verificationMethodId?`): `Promise`\<`IDidDocumentVerificationMethod`\>
|
|
58
64
|
|
|
59
65
|
Add a verification method to the document in JSON Web key Format.
|
|
60
66
|
|
|
61
67
|
#### Parameters
|
|
62
68
|
|
|
63
|
-
|
|
69
|
+
##### controller
|
|
70
|
+
|
|
71
|
+
`string`
|
|
64
72
|
|
|
65
73
|
The controller of the identity who can make changes.
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
##### documentId
|
|
76
|
+
|
|
77
|
+
`string`
|
|
68
78
|
|
|
69
79
|
The id of the document to add the verification method to.
|
|
70
80
|
|
|
71
|
-
|
|
81
|
+
##### verificationMethodType
|
|
82
|
+
|
|
83
|
+
`DidVerificationMethodType`
|
|
72
84
|
|
|
73
85
|
The type of the verification method to add.
|
|
74
86
|
|
|
75
|
-
|
|
87
|
+
##### verificationMethodId?
|
|
88
|
+
|
|
89
|
+
`string`
|
|
76
90
|
|
|
77
91
|
The id of the verification method, if undefined uses the kid of the generated JWK.
|
|
78
92
|
|
|
@@ -100,11 +114,15 @@ Remove a verification method from the document.
|
|
|
100
114
|
|
|
101
115
|
#### Parameters
|
|
102
116
|
|
|
103
|
-
|
|
117
|
+
##### controller
|
|
118
|
+
|
|
119
|
+
`string`
|
|
104
120
|
|
|
105
121
|
The controller of the identity who can make changes.
|
|
106
122
|
|
|
107
|
-
|
|
123
|
+
##### verificationMethodId
|
|
124
|
+
|
|
125
|
+
`string`
|
|
108
126
|
|
|
109
127
|
The id of the verification method.
|
|
110
128
|
|
|
@@ -132,26 +150,36 @@ Add a service to the document.
|
|
|
132
150
|
|
|
133
151
|
#### Parameters
|
|
134
152
|
|
|
135
|
-
|
|
153
|
+
##### controller
|
|
154
|
+
|
|
155
|
+
`string`
|
|
136
156
|
|
|
137
157
|
The controller of the identity who can make changes.
|
|
138
158
|
|
|
139
|
-
|
|
159
|
+
##### documentId
|
|
160
|
+
|
|
161
|
+
`string`
|
|
140
162
|
|
|
141
163
|
The id of the document to add the service to.
|
|
142
164
|
|
|
143
|
-
|
|
165
|
+
##### serviceId
|
|
166
|
+
|
|
167
|
+
`string`
|
|
144
168
|
|
|
145
169
|
The id of the service.
|
|
146
170
|
|
|
147
|
-
|
|
171
|
+
##### serviceType
|
|
148
172
|
|
|
149
173
|
The type of the service.
|
|
150
174
|
|
|
151
|
-
|
|
175
|
+
`string` | `string`[]
|
|
176
|
+
|
|
177
|
+
##### serviceEndpoint
|
|
152
178
|
|
|
153
179
|
The endpoint for the service.
|
|
154
180
|
|
|
181
|
+
`string` | `string`[]
|
|
182
|
+
|
|
155
183
|
#### Returns
|
|
156
184
|
|
|
157
185
|
`Promise`\<`IDidService`\>
|
|
@@ -172,11 +200,15 @@ Remove a service from the document.
|
|
|
172
200
|
|
|
173
201
|
#### Parameters
|
|
174
202
|
|
|
175
|
-
|
|
203
|
+
##### controller
|
|
204
|
+
|
|
205
|
+
`string`
|
|
176
206
|
|
|
177
207
|
The controller of the identity who can make changes.
|
|
178
208
|
|
|
179
|
-
|
|
209
|
+
##### serviceId
|
|
210
|
+
|
|
211
|
+
`string`
|
|
180
212
|
|
|
181
213
|
The id of the service.
|
|
182
214
|
|
|
@@ -194,49 +226,47 @@ NotFoundError if the id can not be resolved.
|
|
|
194
226
|
|
|
195
227
|
### createVerifiableCredential()
|
|
196
228
|
|
|
197
|
-
> **createVerifiableCredential
|
|
229
|
+
> **createVerifiableCredential**(`controller`, `verificationMethodId`, `id`, `subject`, `revocationIndex?`): `Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
198
230
|
|
|
199
231
|
Create a verifiable credential for a verification method.
|
|
200
232
|
|
|
201
|
-
#### Type Parameters
|
|
202
|
-
|
|
203
|
-
• **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
|
|
204
|
-
|
|
205
233
|
#### Parameters
|
|
206
234
|
|
|
207
|
-
|
|
235
|
+
##### controller
|
|
236
|
+
|
|
237
|
+
`string`
|
|
208
238
|
|
|
209
239
|
The controller of the identity who can make changes.
|
|
210
240
|
|
|
211
|
-
|
|
241
|
+
##### verificationMethodId
|
|
242
|
+
|
|
243
|
+
`string`
|
|
212
244
|
|
|
213
245
|
The verification method id to use.
|
|
214
246
|
|
|
215
|
-
|
|
247
|
+
##### id
|
|
216
248
|
|
|
217
249
|
The id of the credential.
|
|
218
250
|
|
|
219
|
-
|
|
251
|
+
`undefined` | `string`
|
|
220
252
|
|
|
221
|
-
|
|
253
|
+
##### subject
|
|
222
254
|
|
|
223
|
-
|
|
255
|
+
`IJsonLdNodeObject`
|
|
224
256
|
|
|
225
|
-
The
|
|
257
|
+
The credential subject to store in the verifiable credential.
|
|
226
258
|
|
|
227
|
-
|
|
259
|
+
##### revocationIndex?
|
|
228
260
|
|
|
229
|
-
`
|
|
261
|
+
`number`
|
|
230
262
|
|
|
231
|
-
The
|
|
232
|
-
|
|
233
|
-
##### verifiableCredential
|
|
263
|
+
The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
234
264
|
|
|
235
|
-
|
|
265
|
+
#### Returns
|
|
236
266
|
|
|
237
|
-
|
|
267
|
+
`Promise`\<\{ `verifiableCredential`: `IDidVerifiableCredential`; `jwt`: `string`; \}\>
|
|
238
268
|
|
|
239
|
-
|
|
269
|
+
The created verifiable credential and its token.
|
|
240
270
|
|
|
241
271
|
#### Throws
|
|
242
272
|
|
|
@@ -246,34 +276,24 @@ NotFoundError if the id can not be resolved.
|
|
|
246
276
|
|
|
247
277
|
### checkVerifiableCredential()
|
|
248
278
|
|
|
249
|
-
> **checkVerifiableCredential
|
|
279
|
+
> **checkVerifiableCredential**(`credentialJwt`): `Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
250
280
|
|
|
251
281
|
Check a verifiable credential is valid.
|
|
252
282
|
|
|
253
|
-
#### Type Parameters
|
|
254
|
-
|
|
255
|
-
• **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
|
|
256
|
-
|
|
257
283
|
#### Parameters
|
|
258
284
|
|
|
259
|
-
|
|
285
|
+
##### credentialJwt
|
|
286
|
+
|
|
287
|
+
`string`
|
|
260
288
|
|
|
261
289
|
The credential to verify.
|
|
262
290
|
|
|
263
291
|
#### Returns
|
|
264
292
|
|
|
265
|
-
`Promise
|
|
293
|
+
`Promise`\<\{ `revoked`: `boolean`; `verifiableCredential?`: `IDidVerifiableCredential`; \}\>
|
|
266
294
|
|
|
267
295
|
The credential stored in the jwt and the revocation status.
|
|
268
296
|
|
|
269
|
-
##### revoked
|
|
270
|
-
|
|
271
|
-
> **revoked**: `boolean`
|
|
272
|
-
|
|
273
|
-
##### verifiableCredential?
|
|
274
|
-
|
|
275
|
-
> `optional` **verifiableCredential**: `IDidVerifiableCredential`\<`T`\>
|
|
276
|
-
|
|
277
297
|
***
|
|
278
298
|
|
|
279
299
|
### revokeVerifiableCredentials()
|
|
@@ -284,15 +304,21 @@ Revoke verifiable credential(s).
|
|
|
284
304
|
|
|
285
305
|
#### Parameters
|
|
286
306
|
|
|
287
|
-
|
|
307
|
+
##### controller
|
|
308
|
+
|
|
309
|
+
`string`
|
|
288
310
|
|
|
289
311
|
The controller of the identity who can make changes.
|
|
290
312
|
|
|
291
|
-
|
|
313
|
+
##### issuerDocumentId
|
|
314
|
+
|
|
315
|
+
`string`
|
|
292
316
|
|
|
293
317
|
The id of the document to update the revocation list for.
|
|
294
318
|
|
|
295
|
-
|
|
319
|
+
##### credentialIndices
|
|
320
|
+
|
|
321
|
+
`number`[]
|
|
296
322
|
|
|
297
323
|
The revocation bitmap index or indices to revoke.
|
|
298
324
|
|
|
@@ -312,15 +338,21 @@ Unrevoke verifiable credential(s).
|
|
|
312
338
|
|
|
313
339
|
#### Parameters
|
|
314
340
|
|
|
315
|
-
|
|
341
|
+
##### controller
|
|
342
|
+
|
|
343
|
+
`string`
|
|
316
344
|
|
|
317
345
|
The controller of the identity who can make changes.
|
|
318
346
|
|
|
319
|
-
|
|
347
|
+
##### issuerDocumentId
|
|
348
|
+
|
|
349
|
+
`string`
|
|
320
350
|
|
|
321
351
|
The id of the document to update the revocation list for.
|
|
322
352
|
|
|
323
|
-
|
|
353
|
+
##### credentialIndices
|
|
354
|
+
|
|
355
|
+
`number`[]
|
|
324
356
|
|
|
325
357
|
The revocation bitmap index or indices to un revoke.
|
|
326
358
|
|
|
@@ -334,58 +366,60 @@ Nothing.
|
|
|
334
366
|
|
|
335
367
|
### createVerifiablePresentation()
|
|
336
368
|
|
|
337
|
-
> **createVerifiablePresentation
|
|
369
|
+
> **createVerifiablePresentation**(`controller`, `verificationMethodId`, `presentationId`, `contexts`, `types`, `verifiableCredentials`, `expiresInMinutes?`): `Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
338
370
|
|
|
339
371
|
Create a verifiable presentation from the supplied verifiable credentials.
|
|
340
372
|
|
|
341
|
-
#### Type Parameters
|
|
342
|
-
|
|
343
|
-
• **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
|
|
344
|
-
|
|
345
373
|
#### Parameters
|
|
346
374
|
|
|
347
|
-
|
|
375
|
+
##### controller
|
|
376
|
+
|
|
377
|
+
`string`
|
|
348
378
|
|
|
349
379
|
The controller of the identity who can make changes.
|
|
350
380
|
|
|
351
|
-
|
|
381
|
+
##### verificationMethodId
|
|
382
|
+
|
|
383
|
+
`string`
|
|
352
384
|
|
|
353
385
|
The method to associate with the presentation.
|
|
354
386
|
|
|
355
|
-
|
|
387
|
+
##### presentationId
|
|
356
388
|
|
|
357
389
|
The id of the presentation.
|
|
358
390
|
|
|
359
|
-
|
|
391
|
+
`undefined` | `string`
|
|
392
|
+
|
|
393
|
+
##### contexts
|
|
360
394
|
|
|
361
395
|
The contexts for the data stored in the verifiable credential.
|
|
362
396
|
|
|
363
|
-
|
|
397
|
+
`undefined` | `IJsonLdContextDefinitionRoot`
|
|
398
|
+
|
|
399
|
+
##### types
|
|
364
400
|
|
|
365
401
|
The types for the data stored in the verifiable credential.
|
|
366
402
|
|
|
367
|
-
|
|
403
|
+
`undefined` | `string` | `string`[]
|
|
404
|
+
|
|
405
|
+
##### verifiableCredentials
|
|
406
|
+
|
|
407
|
+
(`string` \| `IDidVerifiableCredential`)[]
|
|
368
408
|
|
|
369
409
|
The credentials to use for creating the presentation in jwt format.
|
|
370
410
|
|
|
371
|
-
|
|
411
|
+
##### expiresInMinutes?
|
|
412
|
+
|
|
413
|
+
`number`
|
|
372
414
|
|
|
373
415
|
The time in minutes for the presentation to expire.
|
|
374
416
|
|
|
375
417
|
#### Returns
|
|
376
418
|
|
|
377
|
-
`Promise
|
|
419
|
+
`Promise`\<\{ `verifiablePresentation`: `IDidVerifiablePresentation`; `jwt`: `string`; \}\>
|
|
378
420
|
|
|
379
421
|
The created verifiable presentation and its token.
|
|
380
422
|
|
|
381
|
-
##### verifiablePresentation
|
|
382
|
-
|
|
383
|
-
> **verifiablePresentation**: `IDidVerifiablePresentation`\<`T`\>
|
|
384
|
-
|
|
385
|
-
##### jwt
|
|
386
|
-
|
|
387
|
-
> **jwt**: `string`
|
|
388
|
-
|
|
389
423
|
#### Throws
|
|
390
424
|
|
|
391
425
|
NotFoundError if the id can not be resolved.
|
|
@@ -394,102 +428,88 @@ NotFoundError if the id can not be resolved.
|
|
|
394
428
|
|
|
395
429
|
### checkVerifiablePresentation()
|
|
396
430
|
|
|
397
|
-
> **checkVerifiablePresentation
|
|
431
|
+
> **checkVerifiablePresentation**(`presentationJwt`): `Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
398
432
|
|
|
399
433
|
Check a verifiable presentation is valid.
|
|
400
434
|
|
|
401
|
-
#### Type Parameters
|
|
402
|
-
|
|
403
|
-
• **T** *extends* `IJsonLdNodeObject` = `IJsonLdNodeObject`
|
|
404
|
-
|
|
405
435
|
#### Parameters
|
|
406
436
|
|
|
407
|
-
|
|
437
|
+
##### presentationJwt
|
|
438
|
+
|
|
439
|
+
`string`
|
|
408
440
|
|
|
409
441
|
The presentation to verify.
|
|
410
442
|
|
|
411
443
|
#### Returns
|
|
412
444
|
|
|
413
|
-
`Promise
|
|
445
|
+
`Promise`\<\{ `revoked`: `boolean`; `verifiablePresentation?`: `IDidVerifiablePresentation`; `issuers?`: `IDidDocument`[]; \}\>
|
|
414
446
|
|
|
415
447
|
The presentation stored in the jwt and the revocation status.
|
|
416
448
|
|
|
417
|
-
##### revoked
|
|
418
|
-
|
|
419
|
-
> **revoked**: `boolean`
|
|
420
|
-
|
|
421
|
-
##### verifiablePresentation?
|
|
422
|
-
|
|
423
|
-
> `optional` **verifiablePresentation**: `IDidVerifiablePresentation`\<`T`\>
|
|
424
|
-
|
|
425
|
-
##### issuers?
|
|
426
|
-
|
|
427
|
-
> `optional` **issuers**: `IDidDocument`[]
|
|
428
|
-
|
|
429
449
|
***
|
|
430
450
|
|
|
431
451
|
### createProof()
|
|
432
452
|
|
|
433
|
-
> **createProof**(`controller`, `verificationMethodId`, `
|
|
453
|
+
> **createProof**(`controller`, `verificationMethodId`, `proofType`, `unsecureDocument`): `Promise`\<`IProof`\>
|
|
434
454
|
|
|
435
455
|
Create a proof for arbitrary data with the specified verification method.
|
|
436
456
|
|
|
437
457
|
#### Parameters
|
|
438
458
|
|
|
439
|
-
|
|
459
|
+
##### controller
|
|
460
|
+
|
|
461
|
+
`string`
|
|
440
462
|
|
|
441
463
|
The controller of the identity who can make changes.
|
|
442
464
|
|
|
443
|
-
|
|
465
|
+
##### verificationMethodId
|
|
466
|
+
|
|
467
|
+
`string`
|
|
444
468
|
|
|
445
469
|
The verification method id to use.
|
|
446
470
|
|
|
447
|
-
|
|
471
|
+
##### proofType
|
|
448
472
|
|
|
449
|
-
|
|
473
|
+
`ProofTypes`
|
|
450
474
|
|
|
451
|
-
|
|
475
|
+
The type of proof to create.
|
|
452
476
|
|
|
453
|
-
|
|
477
|
+
##### unsecureDocument
|
|
454
478
|
|
|
455
|
-
|
|
479
|
+
`IJsonLdNodeObject`
|
|
456
480
|
|
|
457
|
-
|
|
481
|
+
The unsecure document to create the proof for.
|
|
458
482
|
|
|
459
|
-
|
|
483
|
+
#### Returns
|
|
460
484
|
|
|
461
|
-
|
|
485
|
+
`Promise`\<`IProof`\>
|
|
462
486
|
|
|
463
|
-
|
|
487
|
+
The proof.
|
|
464
488
|
|
|
465
489
|
***
|
|
466
490
|
|
|
467
491
|
### verifyProof()
|
|
468
492
|
|
|
469
|
-
> **verifyProof**(`
|
|
493
|
+
> **verifyProof**(`document`, `proof`): `Promise`\<`boolean`\>
|
|
470
494
|
|
|
471
495
|
Verify proof for arbitrary data with the specified verification method.
|
|
472
496
|
|
|
473
497
|
#### Parameters
|
|
474
498
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
The verification method id to use.
|
|
478
|
-
|
|
479
|
-
• **bytes**: `Uint8Array`
|
|
499
|
+
##### document
|
|
480
500
|
|
|
481
|
-
|
|
501
|
+
`IJsonLdNodeObject`
|
|
482
502
|
|
|
483
|
-
|
|
503
|
+
The document to verify.
|
|
484
504
|
|
|
485
|
-
|
|
505
|
+
##### proof
|
|
486
506
|
|
|
487
|
-
|
|
507
|
+
`IProof`
|
|
488
508
|
|
|
489
|
-
The
|
|
509
|
+
The proof to verify.
|
|
490
510
|
|
|
491
511
|
#### Returns
|
|
492
512
|
|
|
493
513
|
`Promise`\<`boolean`\>
|
|
494
514
|
|
|
495
|
-
True if the
|
|
515
|
+
True if the proof is verified.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IIdentityCreateRequest
|
|
2
|
+
|
|
3
|
+
Request to create an identity.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### body?
|
|
8
|
+
|
|
9
|
+
> `optional` **body**: `object`
|
|
10
|
+
|
|
11
|
+
The data for the request.
|
|
12
|
+
|
|
13
|
+
#### namespace?
|
|
14
|
+
|
|
15
|
+
> `optional` **namespace**: `string`
|
|
16
|
+
|
|
17
|
+
The optional namespace to create the identity in.
|