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