@twin.org/identity-models 0.0.1-next.13 → 0.0.1-next.14
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IComponent } from "@twin.org/core";
|
|
2
2
|
import type { IJsonLdContextDefinitionRoot, IJsonLdObject } from "@twin.org/data-json-ld";
|
|
3
|
-
import type { DidVerificationMethodType, IDidDocument, IDidDocumentVerificationMethod, IDidService, IDidVerifiableCredential, IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
|
|
3
|
+
import type { DidVerificationMethodType, IDidDocument, IDidDocumentVerificationMethod, IDidProof, IDidService, IDidVerifiableCredential, IDidVerifiablePresentation } from "@twin.org/standards-w3c-did";
|
|
4
4
|
/**
|
|
5
5
|
* Interface describing an identity connector.
|
|
6
6
|
*/
|
|
@@ -127,19 +127,14 @@ export interface IIdentityConnector extends IComponent {
|
|
|
127
127
|
* @param controller The controller of the identity who can make changes.
|
|
128
128
|
* @param verificationMethodId The verification method id to use.
|
|
129
129
|
* @param bytes The data bytes to sign.
|
|
130
|
-
* @returns The proof
|
|
130
|
+
* @returns The proof.
|
|
131
131
|
*/
|
|
132
|
-
createProof(controller: string, verificationMethodId: string, bytes: Uint8Array): Promise<
|
|
133
|
-
type: string;
|
|
134
|
-
value: Uint8Array;
|
|
135
|
-
}>;
|
|
132
|
+
createProof(controller: string, verificationMethodId: string, bytes: Uint8Array): Promise<IDidProof>;
|
|
136
133
|
/**
|
|
137
134
|
* Verify proof for arbitrary data with the specified verification method.
|
|
138
|
-
* @param verificationMethodId The verification method id to use.
|
|
139
135
|
* @param bytes The data bytes to verify.
|
|
140
|
-
* @param
|
|
141
|
-
* @
|
|
142
|
-
* @returns True if the signature is valid.
|
|
136
|
+
* @param proof The proof to verify.
|
|
137
|
+
* @returns True if the proof is verified.
|
|
143
138
|
*/
|
|
144
|
-
verifyProof(
|
|
139
|
+
verifyProof(bytes: Uint8Array, proof: IDidProof): Promise<boolean>;
|
|
145
140
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -430,7 +430,7 @@ The presentation stored in the jwt and the revocation status.
|
|
|
430
430
|
|
|
431
431
|
### createProof()
|
|
432
432
|
|
|
433
|
-
> **createProof**(`controller`, `verificationMethodId`, `bytes`): `Promise`\<`
|
|
433
|
+
> **createProof**(`controller`, `verificationMethodId`, `bytes`): `Promise`\<`IDidProof`\>
|
|
434
434
|
|
|
435
435
|
Create a proof for arbitrary data with the specified verification method.
|
|
436
436
|
|
|
@@ -450,46 +450,30 @@ The data bytes to sign.
|
|
|
450
450
|
|
|
451
451
|
#### Returns
|
|
452
452
|
|
|
453
|
-
`Promise`\<`
|
|
454
|
-
|
|
455
|
-
The proof signature type and value.
|
|
456
|
-
|
|
457
|
-
##### type
|
|
453
|
+
`Promise`\<`IDidProof`\>
|
|
458
454
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
##### value
|
|
462
|
-
|
|
463
|
-
> **value**: `Uint8Array`
|
|
455
|
+
The proof.
|
|
464
456
|
|
|
465
457
|
***
|
|
466
458
|
|
|
467
459
|
### verifyProof()
|
|
468
460
|
|
|
469
|
-
> **verifyProof**(`
|
|
461
|
+
> **verifyProof**(`bytes`, `proof`): `Promise`\<`boolean`\>
|
|
470
462
|
|
|
471
463
|
Verify proof for arbitrary data with the specified verification method.
|
|
472
464
|
|
|
473
465
|
#### Parameters
|
|
474
466
|
|
|
475
|
-
• **verificationMethodId**: `string`
|
|
476
|
-
|
|
477
|
-
The verification method id to use.
|
|
478
|
-
|
|
479
467
|
• **bytes**: `Uint8Array`
|
|
480
468
|
|
|
481
469
|
The data bytes to verify.
|
|
482
470
|
|
|
483
|
-
• **
|
|
484
|
-
|
|
485
|
-
The type of the signature for the proof.
|
|
486
|
-
|
|
487
|
-
• **signatureValue**: `Uint8Array`
|
|
471
|
+
• **proof**: `IDidProof`
|
|
488
472
|
|
|
489
|
-
The
|
|
473
|
+
The proof to verify.
|
|
490
474
|
|
|
491
475
|
#### Returns
|
|
492
476
|
|
|
493
477
|
`Promise`\<`boolean`\>
|
|
494
478
|
|
|
495
|
-
True if the
|
|
479
|
+
True if the proof is verified.
|