@twin.org/standards-w3c-did 0.0.1-next.9 → 0.0.2-next.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 +459 -3
- package/dist/esm/index.mjs +454 -4
- package/dist/types/index.d.ts +13 -1
- package/dist/types/models/{IDidProof.d.ts → IDataIntegrityProof.d.ts} +18 -6
- package/dist/types/models/IDidCredentialSchema.d.ts +13 -0
- package/dist/types/models/IDidDocument.d.ts +6 -0
- package/dist/types/models/IDidDocumentVerificationMethod.d.ts +3 -2
- package/dist/types/models/IDidLabel.d.ts +17 -0
- package/dist/types/models/IDidVerifiableCredential.d.ts +41 -9
- package/dist/types/models/IDidVerifiablePresentation.d.ts +9 -8
- package/dist/types/models/IJsonWebSignature2020Proof.d.ts +33 -0
- package/dist/types/models/IMultikey.d.ts +41 -0
- package/dist/types/models/IProof.d.ts +6 -0
- package/dist/types/models/IProofSignerVerifier.d.ts +31 -0
- package/dist/types/models/didContexts.d.ts +26 -2
- package/dist/types/models/didCryptoSuites.d.ts +19 -0
- package/dist/types/models/didTypes.d.ts +16 -0
- package/dist/types/models/proofTypes.d.ts +17 -0
- package/dist/types/signerVerifiers/dataIntegrityProofSignerVerifier.d.ts +38 -0
- package/dist/types/signerVerifiers/jsonWebSignature2020SignerVerifier.d.ts +36 -0
- package/dist/types/utils/multikeyHelper.d.ts +37 -0
- package/dist/types/utils/proofHelper.d.ts +47 -0
- package/docs/changelog.md +134 -1
- package/docs/reference/classes/DataIntegrityProofSignerVerifier.md +134 -0
- package/docs/reference/classes/JsonWebSignature2020SignerVerifier.md +133 -0
- package/docs/reference/classes/MultikeyHelper.md +119 -0
- package/docs/reference/classes/ProofHelper.md +159 -0
- package/docs/reference/index.md +18 -1
- package/docs/reference/interfaces/{IDidProof.md → IDataIntegrityProof.md} +23 -7
- package/docs/reference/interfaces/IDidCredentialSchema.md +19 -0
- package/docs/reference/interfaces/IDidCredentialStatus.md +3 -1
- package/docs/reference/interfaces/IDidDocument.md +8 -0
- package/docs/reference/interfaces/IDidDocumentVerificationMethod.md +9 -1
- package/docs/reference/interfaces/IDidLabel.md +27 -0
- package/docs/reference/interfaces/IDidVerifiableCredential.md +57 -12
- package/docs/reference/interfaces/IDidVerifiablePresentation.md +7 -11
- package/docs/reference/interfaces/IJsonWebSignature2020Proof.md +52 -0
- package/docs/reference/interfaces/IMultikey.md +68 -0
- package/docs/reference/interfaces/IProofSignerVerifier.md +99 -0
- package/docs/reference/type-aliases/DidContexts.md +1 -1
- package/docs/reference/type-aliases/DidCryptoSuites.md +5 -0
- package/docs/reference/type-aliases/DidTypes.md +1 -1
- package/docs/reference/type-aliases/DidVerificationMethodType.md +1 -1
- package/docs/reference/type-aliases/IProof.md +5 -0
- package/docs/reference/type-aliases/ProofTypes.md +5 -0
- package/docs/reference/variables/DidContexts.md +40 -4
- package/docs/reference/variables/DidCryptoSuites.md +21 -0
- package/docs/reference/variables/DidTypes.md +24 -0
- package/docs/reference/variables/DidVerificationMethodType.md +1 -1
- package/docs/reference/variables/ProofTypes.md +19 -0
- package/locales/en.json +27 -1
- package/package.json +7 -4
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Class: DataIntegrityProofSignerVerifier
|
|
2
|
+
|
|
3
|
+
Helper methods for creating and verifying proofs.
|
|
4
|
+
https://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022
|
|
5
|
+
|
|
6
|
+
## Implements
|
|
7
|
+
|
|
8
|
+
- [`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md)
|
|
9
|
+
|
|
10
|
+
## Constructors
|
|
11
|
+
|
|
12
|
+
### Constructor
|
|
13
|
+
|
|
14
|
+
> **new DataIntegrityProofSignerVerifier**(): `DataIntegrityProofSignerVerifier`
|
|
15
|
+
|
|
16
|
+
#### Returns
|
|
17
|
+
|
|
18
|
+
`DataIntegrityProofSignerVerifier`
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
### CLASS\_NAME
|
|
23
|
+
|
|
24
|
+
> `readonly` **CLASS\_NAME**: `string`
|
|
25
|
+
|
|
26
|
+
Runtime name for the class.
|
|
27
|
+
|
|
28
|
+
## Methods
|
|
29
|
+
|
|
30
|
+
### createProof()
|
|
31
|
+
|
|
32
|
+
> **createProof**(`unsecuredDocument`, `unsignedProof`, `signKey`): `Promise`\<[`IProof`](../type-aliases/IProof.md)\>
|
|
33
|
+
|
|
34
|
+
Create a proof for the given data.
|
|
35
|
+
|
|
36
|
+
#### Parameters
|
|
37
|
+
|
|
38
|
+
##### unsecuredDocument
|
|
39
|
+
|
|
40
|
+
`IJsonLdNodeObject`
|
|
41
|
+
|
|
42
|
+
The data to create the proof for.
|
|
43
|
+
|
|
44
|
+
##### unsignedProof
|
|
45
|
+
|
|
46
|
+
[`IDataIntegrityProof`](../interfaces/IDataIntegrityProof.md)
|
|
47
|
+
|
|
48
|
+
The proof options.
|
|
49
|
+
|
|
50
|
+
##### signKey
|
|
51
|
+
|
|
52
|
+
`IJwk`
|
|
53
|
+
|
|
54
|
+
The key to sign the proof with.
|
|
55
|
+
|
|
56
|
+
#### Returns
|
|
57
|
+
|
|
58
|
+
`Promise`\<[`IProof`](../type-aliases/IProof.md)\>
|
|
59
|
+
|
|
60
|
+
The created proof.
|
|
61
|
+
|
|
62
|
+
#### Implementation of
|
|
63
|
+
|
|
64
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md).[`createProof`](../interfaces/IProofSignerVerifier.md#createproof)
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### verifyProof()
|
|
69
|
+
|
|
70
|
+
> **verifyProof**(`securedDocument`, `signedProof`, `verifyKey`): `Promise`\<`boolean`\>
|
|
71
|
+
|
|
72
|
+
Verify a proof for the given data in format.
|
|
73
|
+
|
|
74
|
+
#### Parameters
|
|
75
|
+
|
|
76
|
+
##### securedDocument
|
|
77
|
+
|
|
78
|
+
`IJsonLdNodeObject`
|
|
79
|
+
|
|
80
|
+
The credential to verify.
|
|
81
|
+
|
|
82
|
+
##### signedProof
|
|
83
|
+
|
|
84
|
+
[`IDataIntegrityProof`](../interfaces/IDataIntegrityProof.md)
|
|
85
|
+
|
|
86
|
+
The proof to verify.
|
|
87
|
+
|
|
88
|
+
##### verifyKey
|
|
89
|
+
|
|
90
|
+
`IJwk`
|
|
91
|
+
|
|
92
|
+
The public key to verify the proof with.
|
|
93
|
+
|
|
94
|
+
#### Returns
|
|
95
|
+
|
|
96
|
+
`Promise`\<`boolean`\>
|
|
97
|
+
|
|
98
|
+
True if the credential was verified.
|
|
99
|
+
|
|
100
|
+
#### Implementation of
|
|
101
|
+
|
|
102
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md).[`verifyProof`](../interfaces/IProofSignerVerifier.md#verifyproof)
|
|
103
|
+
|
|
104
|
+
***
|
|
105
|
+
|
|
106
|
+
### createHash()
|
|
107
|
+
|
|
108
|
+
> **createHash**(`unsecuredDocument`, `unsignedProof`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
109
|
+
|
|
110
|
+
Create a hash for the given data.
|
|
111
|
+
|
|
112
|
+
#### Parameters
|
|
113
|
+
|
|
114
|
+
##### unsecuredDocument
|
|
115
|
+
|
|
116
|
+
`IJsonLdNodeObject`
|
|
117
|
+
|
|
118
|
+
The data to create the proof for.
|
|
119
|
+
|
|
120
|
+
##### unsignedProof
|
|
121
|
+
|
|
122
|
+
[`IDataIntegrityProof`](../interfaces/IDataIntegrityProof.md)
|
|
123
|
+
|
|
124
|
+
The unsigned proof.
|
|
125
|
+
|
|
126
|
+
#### Returns
|
|
127
|
+
|
|
128
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
129
|
+
|
|
130
|
+
The created hash.
|
|
131
|
+
|
|
132
|
+
#### Implementation of
|
|
133
|
+
|
|
134
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md).[`createHash`](../interfaces/IProofSignerVerifier.md#createhash)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Class: JsonWebSignature2020SignerVerifier
|
|
2
|
+
|
|
3
|
+
Helper methods for creating and verifying proofs.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- [`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md)
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new JsonWebSignature2020SignerVerifier**(): `JsonWebSignature2020SignerVerifier`
|
|
14
|
+
|
|
15
|
+
#### Returns
|
|
16
|
+
|
|
17
|
+
`JsonWebSignature2020SignerVerifier`
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### CLASS\_NAME
|
|
22
|
+
|
|
23
|
+
> `readonly` **CLASS\_NAME**: `string`
|
|
24
|
+
|
|
25
|
+
Runtime name for the class.
|
|
26
|
+
|
|
27
|
+
## Methods
|
|
28
|
+
|
|
29
|
+
### createProof()
|
|
30
|
+
|
|
31
|
+
> **createProof**(`unsecuredDocument`, `unsignedProof`, `signKey`): `Promise`\<[`IJsonWebSignature2020Proof`](../interfaces/IJsonWebSignature2020Proof.md)\>
|
|
32
|
+
|
|
33
|
+
Create a proof for the given data.
|
|
34
|
+
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
##### unsecuredDocument
|
|
38
|
+
|
|
39
|
+
`IJsonLdNodeObject`
|
|
40
|
+
|
|
41
|
+
The data to create the proof for.
|
|
42
|
+
|
|
43
|
+
##### unsignedProof
|
|
44
|
+
|
|
45
|
+
[`IJsonWebSignature2020Proof`](../interfaces/IJsonWebSignature2020Proof.md)
|
|
46
|
+
|
|
47
|
+
The proof options.
|
|
48
|
+
|
|
49
|
+
##### signKey
|
|
50
|
+
|
|
51
|
+
`IJwk`
|
|
52
|
+
|
|
53
|
+
The key to sign the proof with.
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`Promise`\<[`IJsonWebSignature2020Proof`](../interfaces/IJsonWebSignature2020Proof.md)\>
|
|
58
|
+
|
|
59
|
+
The created proof.
|
|
60
|
+
|
|
61
|
+
#### Implementation of
|
|
62
|
+
|
|
63
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md).[`createProof`](../interfaces/IProofSignerVerifier.md#createproof)
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### verifyProof()
|
|
68
|
+
|
|
69
|
+
> **verifyProof**(`securedDocument`, `signedProof`, `verifyKey`): `Promise`\<`boolean`\>
|
|
70
|
+
|
|
71
|
+
Verify a proof for the given data in format.
|
|
72
|
+
|
|
73
|
+
#### Parameters
|
|
74
|
+
|
|
75
|
+
##### securedDocument
|
|
76
|
+
|
|
77
|
+
`IJsonLdNodeObject`
|
|
78
|
+
|
|
79
|
+
The credential to verify.
|
|
80
|
+
|
|
81
|
+
##### signedProof
|
|
82
|
+
|
|
83
|
+
[`IJsonWebSignature2020Proof`](../interfaces/IJsonWebSignature2020Proof.md)
|
|
84
|
+
|
|
85
|
+
The proof to verify.
|
|
86
|
+
|
|
87
|
+
##### verifyKey
|
|
88
|
+
|
|
89
|
+
`IJwk`
|
|
90
|
+
|
|
91
|
+
The public key to verify the proof with.
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`Promise`\<`boolean`\>
|
|
96
|
+
|
|
97
|
+
True if the credential was verified.
|
|
98
|
+
|
|
99
|
+
#### Implementation of
|
|
100
|
+
|
|
101
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md).[`verifyProof`](../interfaces/IProofSignerVerifier.md#verifyproof)
|
|
102
|
+
|
|
103
|
+
***
|
|
104
|
+
|
|
105
|
+
### createHash()
|
|
106
|
+
|
|
107
|
+
> **createHash**(`unsecuredDocument`, `unsignedProof`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
108
|
+
|
|
109
|
+
Create a hash for the given data.
|
|
110
|
+
|
|
111
|
+
#### Parameters
|
|
112
|
+
|
|
113
|
+
##### unsecuredDocument
|
|
114
|
+
|
|
115
|
+
`IJsonLdNodeObject`
|
|
116
|
+
|
|
117
|
+
The data to create the proof for.
|
|
118
|
+
|
|
119
|
+
##### unsignedProof
|
|
120
|
+
|
|
121
|
+
[`IJsonWebSignature2020Proof`](../interfaces/IJsonWebSignature2020Proof.md)
|
|
122
|
+
|
|
123
|
+
The unsigned proof.
|
|
124
|
+
|
|
125
|
+
#### Returns
|
|
126
|
+
|
|
127
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
128
|
+
|
|
129
|
+
The created hash.
|
|
130
|
+
|
|
131
|
+
#### Implementation of
|
|
132
|
+
|
|
133
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md).[`createHash`](../interfaces/IProofSignerVerifier.md#createhash)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Class: MultikeyHelper
|
|
2
|
+
|
|
3
|
+
Helper methods for multikey.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new MultikeyHelper**(): `MultikeyHelper`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`MultikeyHelper`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### toJwk()
|
|
26
|
+
|
|
27
|
+
> `static` **toJwk**(`multikey`): `IJwk`
|
|
28
|
+
|
|
29
|
+
Convert a multikey to a JWK.
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### multikey
|
|
34
|
+
|
|
35
|
+
[`IMultikey`](../interfaces/IMultikey.md)
|
|
36
|
+
|
|
37
|
+
The multikey to convert.
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
`IJwk`
|
|
42
|
+
|
|
43
|
+
The JWK.
|
|
44
|
+
|
|
45
|
+
#### Throws
|
|
46
|
+
|
|
47
|
+
GeneralError if the multikey is invalid.
|
|
48
|
+
|
|
49
|
+
***
|
|
50
|
+
|
|
51
|
+
### fromJwk()
|
|
52
|
+
|
|
53
|
+
> `static` **fromJwk**(`controller`, `id`, `jwk`): [`IMultikey`](../interfaces/IMultikey.md)
|
|
54
|
+
|
|
55
|
+
Convert a JWK to a Multikey.
|
|
56
|
+
|
|
57
|
+
#### Parameters
|
|
58
|
+
|
|
59
|
+
##### controller
|
|
60
|
+
|
|
61
|
+
`string`
|
|
62
|
+
|
|
63
|
+
The controller of the multikey.
|
|
64
|
+
|
|
65
|
+
##### id
|
|
66
|
+
|
|
67
|
+
`string`
|
|
68
|
+
|
|
69
|
+
The id of the multikey.
|
|
70
|
+
|
|
71
|
+
##### jwk
|
|
72
|
+
|
|
73
|
+
`IJwk`
|
|
74
|
+
|
|
75
|
+
The jwk to convert.
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
[`IMultikey`](../interfaces/IMultikey.md)
|
|
80
|
+
|
|
81
|
+
The multikey.
|
|
82
|
+
|
|
83
|
+
#### Throws
|
|
84
|
+
|
|
85
|
+
GeneralError if the jwk is invalid.
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### toRaw()
|
|
90
|
+
|
|
91
|
+
> `static` **toRaw**(`multikey`): `object`
|
|
92
|
+
|
|
93
|
+
Convert a multikey to raw keys.
|
|
94
|
+
|
|
95
|
+
#### Parameters
|
|
96
|
+
|
|
97
|
+
##### multikey
|
|
98
|
+
|
|
99
|
+
[`IMultikey`](../interfaces/IMultikey.md)
|
|
100
|
+
|
|
101
|
+
The multikey to convert.
|
|
102
|
+
|
|
103
|
+
#### Returns
|
|
104
|
+
|
|
105
|
+
`object`
|
|
106
|
+
|
|
107
|
+
The JWK.
|
|
108
|
+
|
|
109
|
+
##### publicKey
|
|
110
|
+
|
|
111
|
+
> **publicKey**: `Uint8Array`
|
|
112
|
+
|
|
113
|
+
##### privateKey
|
|
114
|
+
|
|
115
|
+
> **privateKey**: `Uint8Array`
|
|
116
|
+
|
|
117
|
+
#### Throws
|
|
118
|
+
|
|
119
|
+
GeneralError if the multikey is invalid.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Class: ProofHelper
|
|
2
|
+
|
|
3
|
+
Helper methods for creating and verifying proofs.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new ProofHelper**(): `ProofHelper`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`ProofHelper`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### createSignerVerifier()
|
|
26
|
+
|
|
27
|
+
> `static` **createSignerVerifier**(`proofType`): [`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md)
|
|
28
|
+
|
|
29
|
+
Create a signer verifier.
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### proofType
|
|
34
|
+
|
|
35
|
+
[`ProofTypes`](../type-aliases/ProofTypes.md)
|
|
36
|
+
|
|
37
|
+
The type of proof to create.
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
[`IProofSignerVerifier`](../interfaces/IProofSignerVerifier.md)
|
|
42
|
+
|
|
43
|
+
The created signer verifier.
|
|
44
|
+
|
|
45
|
+
#### Throws
|
|
46
|
+
|
|
47
|
+
GeneralError if the proof type is not supported.
|
|
48
|
+
|
|
49
|
+
***
|
|
50
|
+
|
|
51
|
+
### createProof()
|
|
52
|
+
|
|
53
|
+
> `static` **createProof**(`proofType`, `unsecuredDocument`, `unsignedProof`, `signKey`): `Promise`\<[`IProof`](../type-aliases/IProof.md)\>
|
|
54
|
+
|
|
55
|
+
Create a proof for the given data.
|
|
56
|
+
|
|
57
|
+
#### Parameters
|
|
58
|
+
|
|
59
|
+
##### proofType
|
|
60
|
+
|
|
61
|
+
[`ProofTypes`](../type-aliases/ProofTypes.md)
|
|
62
|
+
|
|
63
|
+
The type of proof to create.
|
|
64
|
+
|
|
65
|
+
##### unsecuredDocument
|
|
66
|
+
|
|
67
|
+
`IJsonLdNodeObject`
|
|
68
|
+
|
|
69
|
+
The data to create the proof for.
|
|
70
|
+
|
|
71
|
+
##### unsignedProof
|
|
72
|
+
|
|
73
|
+
[`IProof`](../type-aliases/IProof.md)
|
|
74
|
+
|
|
75
|
+
The proof options.
|
|
76
|
+
|
|
77
|
+
##### signKey
|
|
78
|
+
|
|
79
|
+
`IJwk`
|
|
80
|
+
|
|
81
|
+
The key to sign the proof with.
|
|
82
|
+
|
|
83
|
+
#### Returns
|
|
84
|
+
|
|
85
|
+
`Promise`\<[`IProof`](../type-aliases/IProof.md)\>
|
|
86
|
+
|
|
87
|
+
The created proof.
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### verifyProof()
|
|
92
|
+
|
|
93
|
+
> `static` **verifyProof**(`securedDocument`, `signedProof`, `verifyKey`): `Promise`\<`boolean`\>
|
|
94
|
+
|
|
95
|
+
Verify a proof for the given data.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
##### securedDocument
|
|
100
|
+
|
|
101
|
+
`IJsonLdNodeObject`
|
|
102
|
+
|
|
103
|
+
The credential to verify.
|
|
104
|
+
|
|
105
|
+
##### signedProof
|
|
106
|
+
|
|
107
|
+
[`IProof`](../type-aliases/IProof.md)
|
|
108
|
+
|
|
109
|
+
The proof to verify.
|
|
110
|
+
|
|
111
|
+
##### verifyKey
|
|
112
|
+
|
|
113
|
+
`IJwk`
|
|
114
|
+
|
|
115
|
+
The public key to verify the proof with.
|
|
116
|
+
|
|
117
|
+
#### Returns
|
|
118
|
+
|
|
119
|
+
`Promise`\<`boolean`\>
|
|
120
|
+
|
|
121
|
+
True if the credential was verified.
|
|
122
|
+
|
|
123
|
+
***
|
|
124
|
+
|
|
125
|
+
### createUnsignedProof()
|
|
126
|
+
|
|
127
|
+
> `static` **createUnsignedProof**(`proofType`, `verificationMethodId`, `otherParams?`): [`IProof`](../type-aliases/IProof.md)
|
|
128
|
+
|
|
129
|
+
Create an unsigned proof.
|
|
130
|
+
|
|
131
|
+
#### Parameters
|
|
132
|
+
|
|
133
|
+
##### proofType
|
|
134
|
+
|
|
135
|
+
[`ProofTypes`](../type-aliases/ProofTypes.md)
|
|
136
|
+
|
|
137
|
+
The type of proof to create.
|
|
138
|
+
|
|
139
|
+
##### verificationMethodId
|
|
140
|
+
|
|
141
|
+
`string`
|
|
142
|
+
|
|
143
|
+
The verification method id.
|
|
144
|
+
|
|
145
|
+
##### otherParams?
|
|
146
|
+
|
|
147
|
+
`any`
|
|
148
|
+
|
|
149
|
+
Other parameters for the proof.
|
|
150
|
+
|
|
151
|
+
#### Returns
|
|
152
|
+
|
|
153
|
+
[`IProof`](../type-aliases/IProof.md)
|
|
154
|
+
|
|
155
|
+
The created proof.
|
|
156
|
+
|
|
157
|
+
#### Throws
|
|
158
|
+
|
|
159
|
+
GeneralError if the proof type is not supported.
|
package/docs/reference/index.md
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
# @twin.org/standards-w3c-did
|
|
2
2
|
|
|
3
|
+
## Classes
|
|
4
|
+
|
|
5
|
+
- [DataIntegrityProofSignerVerifier](classes/DataIntegrityProofSignerVerifier.md)
|
|
6
|
+
- [JsonWebSignature2020SignerVerifier](classes/JsonWebSignature2020SignerVerifier.md)
|
|
7
|
+
- [MultikeyHelper](classes/MultikeyHelper.md)
|
|
8
|
+
- [ProofHelper](classes/ProofHelper.md)
|
|
9
|
+
|
|
3
10
|
## Interfaces
|
|
4
11
|
|
|
12
|
+
- [IDataIntegrityProof](interfaces/IDataIntegrityProof.md)
|
|
13
|
+
- [IDidCredentialSchema](interfaces/IDidCredentialSchema.md)
|
|
5
14
|
- [IDidCredentialStatus](interfaces/IDidCredentialStatus.md)
|
|
6
15
|
- [IDidDocument](interfaces/IDidDocument.md)
|
|
7
16
|
- [IDidDocumentVerificationMethod](interfaces/IDidDocumentVerificationMethod.md)
|
|
17
|
+
- [IDidLabel](interfaces/IDidLabel.md)
|
|
8
18
|
- [IDidPresentationVerification](interfaces/IDidPresentationVerification.md)
|
|
9
|
-
- [IDidProof](interfaces/IDidProof.md)
|
|
10
19
|
- [IDidService](interfaces/IDidService.md)
|
|
11
20
|
- [IDidVerifiableCredential](interfaces/IDidVerifiableCredential.md)
|
|
12
21
|
- [IDidVerifiablePresentation](interfaces/IDidVerifiablePresentation.md)
|
|
22
|
+
- [IJsonWebSignature2020Proof](interfaces/IJsonWebSignature2020Proof.md)
|
|
23
|
+
- [IMultikey](interfaces/IMultikey.md)
|
|
24
|
+
- [IProofSignerVerifier](interfaces/IProofSignerVerifier.md)
|
|
13
25
|
|
|
14
26
|
## Type Aliases
|
|
15
27
|
|
|
28
|
+
- [IProof](type-aliases/IProof.md)
|
|
16
29
|
- [DidContexts](type-aliases/DidContexts.md)
|
|
30
|
+
- [DidCryptoSuites](type-aliases/DidCryptoSuites.md)
|
|
17
31
|
- [DidTypes](type-aliases/DidTypes.md)
|
|
18
32
|
- [DidVerificationMethodType](type-aliases/DidVerificationMethodType.md)
|
|
33
|
+
- [ProofTypes](type-aliases/ProofTypes.md)
|
|
19
34
|
|
|
20
35
|
## Variables
|
|
21
36
|
|
|
22
37
|
- [DidContexts](variables/DidContexts.md)
|
|
38
|
+
- [DidCryptoSuites](variables/DidCryptoSuites.md)
|
|
23
39
|
- [DidTypes](variables/DidTypes.md)
|
|
24
40
|
- [DidVerificationMethodType](variables/DidVerificationMethodType.md)
|
|
41
|
+
- [ProofTypes](variables/ProofTypes.md)
|
|
@@ -1,23 +1,39 @@
|
|
|
1
|
-
# Interface:
|
|
1
|
+
# Interface: IDataIntegrityProof
|
|
2
2
|
|
|
3
3
|
Interface describing a did proof.
|
|
4
4
|
https://www.w3.org/TR/vc-data-integrity/
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
|
-
###
|
|
8
|
+
### @context?
|
|
9
9
|
|
|
10
|
-
> `optional`
|
|
10
|
+
> `optional` **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
JSON-LD Context.
|
|
13
13
|
|
|
14
14
|
***
|
|
15
15
|
|
|
16
16
|
### type
|
|
17
17
|
|
|
18
|
-
> **type**: `
|
|
18
|
+
> **type**: `"DataIntegrityProof"`
|
|
19
|
+
|
|
20
|
+
JSON-LD Type.
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
### cryptosuite
|
|
25
|
+
|
|
26
|
+
> **cryptosuite**: `string`
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
An identifier for the cryptographic suite that can be used to verify the proof.
|
|
29
|
+
|
|
30
|
+
***
|
|
31
|
+
|
|
32
|
+
### id?
|
|
33
|
+
|
|
34
|
+
> `optional` **id**: `string`
|
|
35
|
+
|
|
36
|
+
The id of the proof.
|
|
21
37
|
|
|
22
38
|
***
|
|
23
39
|
|
|
@@ -25,7 +41,7 @@ The type of the proof.
|
|
|
25
41
|
|
|
26
42
|
> **proofPurpose**: `string`
|
|
27
43
|
|
|
28
|
-
The
|
|
44
|
+
The reason the proof was created.
|
|
29
45
|
|
|
30
46
|
***
|
|
31
47
|
|
|
@@ -5,6 +5,14 @@ Spec https://www.w3.org/TR/did-core/#did-document-properties.
|
|
|
5
5
|
|
|
6
6
|
## Properties
|
|
7
7
|
|
|
8
|
+
### @context
|
|
9
|
+
|
|
10
|
+
> **@context**: `"https://www.w3.org/ns/did/v1"` \| \[`"https://www.w3.org/ns/did/v1"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
11
|
+
|
|
12
|
+
The context for the document.
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
8
16
|
### id
|
|
9
17
|
|
|
10
18
|
> **id**: `string`
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Interface describing a DID document verification method.
|
|
4
4
|
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `IJsonLdNodeObject`
|
|
8
|
+
|
|
9
|
+
## Indexable
|
|
10
|
+
|
|
11
|
+
\[`key`: `string`\]: `undefined` \| `null` \| `string` \| `number` \| `boolean` \| `IJsonLdNodeObject` \| `IJsonLdGraphObject` \| `object` & `object` \| `object` & `object` \| `object` & `object` \| `IJsonLdListObject` \| `IJsonLdSetObject` \| `IJsonLdNodePrimitive`[] \| `IJsonLdLanguageMap` \| `IJsonLdIndexMap` \| `IJsonLdNodeObject`[] \| `IJsonLdIdMap` \| `IJsonLdTypeMap` \| `IJsonLdContextDefinition` \| `IJsonLdContextDefinitionElement`[] \| `string`[] \| `IJsonLdJsonObject` \| `IJsonLdJsonObject`[] \| \{[`key`: `string`]: `string`; \}
|
|
12
|
+
|
|
5
13
|
## Properties
|
|
6
14
|
|
|
7
15
|
### id
|
|
@@ -39,7 +47,7 @@ Spec https://datatracker.ietf.org/doc/html/draft-multiformats-multibase-03 .
|
|
|
39
47
|
|
|
40
48
|
### publicKeyJwk?
|
|
41
49
|
|
|
42
|
-
> `optional` **publicKeyJwk**: `IJwk`
|
|
50
|
+
> `optional` **publicKeyJwk**: `IJwk` & `IJsonLdNodeObject`
|
|
43
51
|
|
|
44
52
|
The public key for the entry as a JWK.
|
|
45
53
|
Spec https://datatracker.ietf.org/doc/html/rfc7517 .
|