@veramo/credential-ld 5.6.1-unstable.36 → 6.0.0
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/build/action-handler.d.ts +49 -1
- package/build/action-handler.d.ts.map +1 -1
- package/build/action-handler.js +8 -8
- package/build/action-handler.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/ld-context-loader.js.map +1 -1
- package/build/ld-credential-module.d.ts +11 -6
- package/build/ld-credential-module.d.ts.map +1 -1
- package/build/ld-credential-module.js +19 -11
- package/build/ld-credential-module.js.map +1 -1
- package/build/ld-default-contexts.js +2 -2
- package/build/ld-default-contexts.js.map +1 -1
- package/build/ld-suite-loader.d.ts +1 -1
- package/build/ld-suite-loader.d.ts.map +1 -1
- package/build/ld-suite-loader.js +9 -9
- package/build/ld-suite-loader.js.map +1 -1
- package/build/ld-suites.d.ts +1 -1
- package/build/ld-suites.d.ts.map +1 -1
- package/build/ld-suites.js.map +1 -1
- package/build/plugin.schema.d.ts +430 -0
- package/build/plugin.schema.d.ts.map +1 -0
- package/build/{plugin.schema.json → plugin.schema.js} +65 -16
- package/build/plugin.schema.js.map +1 -0
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts.map +1 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.js +3 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.js.map +1 -1
- package/build/suites/Ed25519Signature2018.d.ts +1 -1
- package/build/suites/Ed25519Signature2018.d.ts.map +1 -1
- package/build/suites/Ed25519Signature2018.js +3 -2
- package/build/suites/Ed25519Signature2018.js.map +1 -1
- package/build/suites/Ed25519Signature2020.d.ts +1 -1
- package/build/suites/Ed25519Signature2020.d.ts.map +1 -1
- package/build/suites/Ed25519Signature2020.js +3 -2
- package/build/suites/Ed25519Signature2020.js.map +1 -1
- package/build/suites/JsonWebSignature2020.d.ts +1 -1
- package/build/suites/JsonWebSignature2020.d.ts.map +1 -1
- package/build/suites/JsonWebSignature2020.js +2 -1
- package/build/suites/JsonWebSignature2020.js.map +1 -1
- package/build/tsdoc-metadata.json +1 -1
- package/build/types.d.ts +5 -5
- package/build/types.d.ts.map +1 -1
- package/package.json +9 -11
- package/src/action-handler.ts +13 -10
- package/src/index.ts +2 -1
- package/src/ld-credential-module.ts +28 -19
- package/src/ld-suite-loader.ts +10 -10
- package/src/ld-suites.ts +1 -1
- package/src/{plugin.schema.json → plugin.schema.ts} +63 -15
- package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +3 -1
- package/src/suites/Ed25519Signature2018.ts +4 -3
- package/src/suites/Ed25519Signature2020.ts +4 -3
- package/src/suites/JsonWebSignature2020.ts +3 -2
- package/src/types.ts +5 -4
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
{
|
|
1
|
+
export const schema = {
|
|
2
2
|
"ICredentialIssuerLD": {
|
|
3
3
|
"components": {
|
|
4
4
|
"schemas": {
|
|
5
5
|
"ICreateVerifiableCredentialLDArgs": {
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
|
+
"resolutionOptions": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"publicKeyFormat": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"accept": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"description": "Options to be passed to the DID resolver."
|
|
19
|
+
},
|
|
8
20
|
"credential": {
|
|
9
21
|
"$ref": "#/components/schemas/CredentialPayload",
|
|
10
|
-
"description": "The json payload of the Credential according to the
|
|
22
|
+
"description": "The json payload of the Credential according to the {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`\n\n`@context`, `type` and `issuanceDate` will be added automatically if omitted"
|
|
11
23
|
},
|
|
12
24
|
"keyRef": {
|
|
13
25
|
"type": "string",
|
|
@@ -24,7 +36,7 @@
|
|
|
24
36
|
"additionalProperties": {
|
|
25
37
|
"description": "Any other options that can be forwarded to the lower level libraries"
|
|
26
38
|
},
|
|
27
|
-
"description": "Encapsulates the parameters required to create a
|
|
39
|
+
"description": "Encapsulates the parameters required to create a {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential }"
|
|
28
40
|
},
|
|
29
41
|
"CredentialPayload": {
|
|
30
42
|
"type": "object",
|
|
@@ -79,7 +91,7 @@
|
|
|
79
91
|
"type": "string"
|
|
80
92
|
}
|
|
81
93
|
],
|
|
82
|
-
"description": "The issuer of a {@link VerifiableCredential } or the holder of a {@link VerifiablePresentation } .\n\nThe value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.\n\nSee {@link
|
|
94
|
+
"description": "The issuer of a {@link VerifiableCredential } or the holder of a {@link VerifiablePresentation } .\n\nThe value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#issuer | Issuer data model }"
|
|
83
95
|
},
|
|
84
96
|
"CredentialSubject": {
|
|
85
97
|
"type": "object",
|
|
@@ -88,7 +100,7 @@
|
|
|
88
100
|
"type": "string"
|
|
89
101
|
}
|
|
90
102
|
},
|
|
91
|
-
"description": "The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.\n\nSee {@link
|
|
103
|
+
"description": "The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#credential-subject | Credential Subject }"
|
|
92
104
|
},
|
|
93
105
|
"ContextType": {
|
|
94
106
|
"anyOf": [
|
|
@@ -132,7 +144,7 @@
|
|
|
132
144
|
"id",
|
|
133
145
|
"type"
|
|
134
146
|
],
|
|
135
|
-
"description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link
|
|
147
|
+
"description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }"
|
|
136
148
|
},
|
|
137
149
|
"VerifiableCredential": {
|
|
138
150
|
"type": "object",
|
|
@@ -182,7 +194,7 @@
|
|
|
182
194
|
"issuer",
|
|
183
195
|
"proof"
|
|
184
196
|
],
|
|
185
|
-
"description": "Represents a signed Verifiable Credential payload (includes proof), using a JSON representation. See {@link
|
|
197
|
+
"description": "Represents a signed Verifiable Credential payload (includes proof), using a JSON representation. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model }"
|
|
186
198
|
},
|
|
187
199
|
"ProofType": {
|
|
188
200
|
"type": "object",
|
|
@@ -196,9 +208,21 @@
|
|
|
196
208
|
"ICreateVerifiablePresentationLDArgs": {
|
|
197
209
|
"type": "object",
|
|
198
210
|
"properties": {
|
|
211
|
+
"resolutionOptions": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"properties": {
|
|
214
|
+
"publicKeyFormat": {
|
|
215
|
+
"type": "string"
|
|
216
|
+
},
|
|
217
|
+
"accept": {
|
|
218
|
+
"type": "string"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"description": "Options to be passed to the DID resolver."
|
|
222
|
+
},
|
|
199
223
|
"presentation": {
|
|
200
224
|
"$ref": "#/components/schemas/PresentationPayload",
|
|
201
|
-
"description": "The json payload of the Presentation according to the
|
|
225
|
+
"description": "The json payload of the Presentation according to the {@link https://www.w3.org/TR/vc-data-model/#presentations | canonical model } .\n\nThe signer of the Presentation is chosen based on the `holder` property of the `presentation`\n\n`@context`, `type` and `issuanceDate` will be added automatically if omitted."
|
|
202
226
|
},
|
|
203
227
|
"challenge": {
|
|
204
228
|
"type": "string",
|
|
@@ -223,7 +247,7 @@
|
|
|
223
247
|
"additionalProperties": {
|
|
224
248
|
"description": "Any other options that can be forwarded to the lower level libraries"
|
|
225
249
|
},
|
|
226
|
-
"description": "Encapsulates the parameters required to create a
|
|
250
|
+
"description": "Encapsulates the parameters required to create a {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation }"
|
|
227
251
|
},
|
|
228
252
|
"PresentationPayload": {
|
|
229
253
|
"type": "object",
|
|
@@ -276,7 +300,7 @@
|
|
|
276
300
|
"$ref": "#/components/schemas/CompactJWT"
|
|
277
301
|
}
|
|
278
302
|
],
|
|
279
|
-
"description": "Represents a signed Verifiable Credential (includes proof), in either JSON or compact JWT format. See {@link
|
|
303
|
+
"description": "Represents a signed Verifiable Credential (includes proof), in either JSON or compact JWT format. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model } See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats }"
|
|
280
304
|
},
|
|
281
305
|
"CompactJWT": {
|
|
282
306
|
"type": "string",
|
|
@@ -334,14 +358,26 @@
|
|
|
334
358
|
"holder",
|
|
335
359
|
"proof"
|
|
336
360
|
],
|
|
337
|
-
"description": "Represents a signed Verifiable Presentation (includes proof), using a JSON representation. See {@link
|
|
361
|
+
"description": "Represents a signed Verifiable Presentation (includes proof), using a JSON representation. See {@link https://www.w3.org/TR/vc-data-model/#presentations | VP data model }"
|
|
338
362
|
},
|
|
339
363
|
"IVerifyCredentialLDArgs": {
|
|
340
364
|
"type": "object",
|
|
341
365
|
"properties": {
|
|
366
|
+
"resolutionOptions": {
|
|
367
|
+
"type": "object",
|
|
368
|
+
"properties": {
|
|
369
|
+
"publicKeyFormat": {
|
|
370
|
+
"type": "string"
|
|
371
|
+
},
|
|
372
|
+
"accept": {
|
|
373
|
+
"type": "string"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"description": "Options to be passed to the DID resolver."
|
|
377
|
+
},
|
|
342
378
|
"credential": {
|
|
343
379
|
"$ref": "#/components/schemas/VerifiableCredential",
|
|
344
|
-
"description": "The json payload of the Credential according to the
|
|
380
|
+
"description": "The json payload of the Credential according to the {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`"
|
|
345
381
|
},
|
|
346
382
|
"fetchRemoteContexts": {
|
|
347
383
|
"type": "boolean",
|
|
@@ -354,14 +390,26 @@
|
|
|
354
390
|
"additionalProperties": {
|
|
355
391
|
"description": "Any other options that can be forwarded to the lower level libraries"
|
|
356
392
|
},
|
|
357
|
-
"description": "Encapsulates the parameters required to verify a
|
|
393
|
+
"description": "Encapsulates the parameters required to verify a {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential }"
|
|
358
394
|
},
|
|
359
395
|
"IVerifyPresentationLDArgs": {
|
|
360
396
|
"type": "object",
|
|
361
397
|
"properties": {
|
|
398
|
+
"resolutionOptions": {
|
|
399
|
+
"type": "object",
|
|
400
|
+
"properties": {
|
|
401
|
+
"publicKeyFormat": {
|
|
402
|
+
"type": "string"
|
|
403
|
+
},
|
|
404
|
+
"accept": {
|
|
405
|
+
"type": "string"
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"description": "Options to be passed to the DID resolver."
|
|
409
|
+
},
|
|
362
410
|
"presentation": {
|
|
363
411
|
"$ref": "#/components/schemas/VerifiablePresentation",
|
|
364
|
-
"description": "The json payload of the Credential according to the
|
|
412
|
+
"description": "The json payload of the Credential according to the {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`"
|
|
365
413
|
},
|
|
366
414
|
"challenge": {
|
|
367
415
|
"type": "string",
|
|
@@ -382,7 +430,7 @@
|
|
|
382
430
|
"additionalProperties": {
|
|
383
431
|
"description": "Any other options that can be forwarded to the lower level libraries"
|
|
384
432
|
},
|
|
385
|
-
"description": "Encapsulates the parameters required to verify a
|
|
433
|
+
"description": "Encapsulates the parameters required to verify a {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation }"
|
|
386
434
|
}
|
|
387
435
|
},
|
|
388
436
|
"methods": {
|
|
@@ -13,6 +13,8 @@ const { EcdsaSecp256k1RecoveryMethod2020, EcdsaSecp256k1RecoverySignature2020 }
|
|
|
13
13
|
export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature {
|
|
14
14
|
getSupportedVerificationType(): string {
|
|
15
15
|
return 'EcdsaSecp256k1RecoveryMethod2020'
|
|
16
|
+
// TODO: add support for ['EcdsaSecp256k1VerificationKey2020', 'EcdsaSecp256k1VerificationKey2019',
|
|
17
|
+
// 'JsonWebKey2020', 'Multikey']
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
getSupportedVeramoKeyType(): TKeyType {
|
|
@@ -52,7 +54,7 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature
|
|
|
52
54
|
key: new EcdsaSecp256k1RecoveryMethod2020({
|
|
53
55
|
publicKeyHex: key.publicKeyHex,
|
|
54
56
|
signer: () => signer,
|
|
55
|
-
type:
|
|
57
|
+
type: 'EcdsaSecp256k1RecoveryMethod2020',
|
|
56
58
|
controller,
|
|
57
59
|
id: verifiableMethodId,
|
|
58
60
|
}),
|
|
@@ -9,8 +9,9 @@ import { Ed25519Signature2018, Ed25519VerificationKey2018 } from '@transmute/ed2
|
|
|
9
9
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
10
10
|
*/
|
|
11
11
|
export class VeramoEd25519Signature2018 extends VeramoLdSignature {
|
|
12
|
-
getSupportedVerificationType(): string {
|
|
13
|
-
return 'Ed25519VerificationKey2018'
|
|
12
|
+
getSupportedVerificationType(): string[] {
|
|
13
|
+
return ['Ed25519VerificationKey2018', 'JsonWebKey2020']
|
|
14
|
+
// TODO: add support for ['Ed25519VerificationKey2020', 'Multikey']
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
getSupportedVeramoKeyType(): TKeyType {
|
|
@@ -54,7 +55,7 @@ export class VeramoEd25519Signature2018 extends VeramoLdSignature {
|
|
|
54
55
|
controller,
|
|
55
56
|
publicKey: hexToBytes(key.publicKeyHex),
|
|
56
57
|
signer: () => signer,
|
|
57
|
-
type:
|
|
58
|
+
type: 'Ed25519VerificationKey2018',
|
|
58
59
|
})
|
|
59
60
|
// overwrite the signer since we're not passing the private key and transmute doesn't support that behavior
|
|
60
61
|
verificationKey.signer = () => signer as any
|
|
@@ -30,8 +30,9 @@ const debug = Debug('veramo:credential-ld:Ed25519Signature2020')
|
|
|
30
30
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
31
31
|
*/
|
|
32
32
|
export class VeramoEd25519Signature2020 extends VeramoLdSignature {
|
|
33
|
-
getSupportedVerificationType(): string {
|
|
34
|
-
return 'Ed25519VerificationKey2020'
|
|
33
|
+
getSupportedVerificationType(): string[] {
|
|
34
|
+
return ['Ed25519VerificationKey2020', 'Ed25519VerificationKey2018']
|
|
35
|
+
// TODO: add support for ['JsonWebKey2020', 'Multikey']
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
getSupportedVeramoKeyType(): TKeyType {
|
|
@@ -72,7 +73,7 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature {
|
|
|
72
73
|
})
|
|
73
74
|
// overwrite the signer since we're not passing the private key
|
|
74
75
|
verificationKey.signer = () => signer as any
|
|
75
|
-
verificationKey.type =
|
|
76
|
+
verificationKey.type = 'Ed25519VerificationKey2020'
|
|
76
77
|
return new Ed25519Signature2020({
|
|
77
78
|
key: verificationKey,
|
|
78
79
|
signer: signer,
|
|
@@ -17,8 +17,9 @@ import {
|
|
|
17
17
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
18
18
|
*/
|
|
19
19
|
export class VeramoJsonWebSignature2020 extends VeramoLdSignature {
|
|
20
|
-
getSupportedVerificationType():
|
|
20
|
+
getSupportedVerificationType(): string {
|
|
21
21
|
return 'JsonWebKey2020'
|
|
22
|
+
// TODO: add support for ['Ed25519VerificationKey2018', 'Ed25519VerificationKey2020', 'Multikey'] and others
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
getSupportedVeramoKeyType(): TKeyType {
|
|
@@ -59,7 +60,7 @@ export class VeramoJsonWebSignature2020 extends VeramoLdSignature {
|
|
|
59
60
|
|
|
60
61
|
const verificationKey = await JsonWebKey.from({
|
|
61
62
|
id: id,
|
|
62
|
-
type:
|
|
63
|
+
type: 'JsonWebKey2020',
|
|
63
64
|
controller: controller,
|
|
64
65
|
publicKeyJwk: {
|
|
65
66
|
kty: 'OKP',
|
package/src/types.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
IPluginMethodMap,
|
|
8
8
|
IResolver,
|
|
9
9
|
PresentationPayload,
|
|
10
|
+
UsingResolutionOptions,
|
|
10
11
|
VerifiableCredential,
|
|
11
12
|
VerifiablePresentation,
|
|
12
13
|
} from '@veramo/core-types'
|
|
@@ -104,7 +105,7 @@ export interface ICredentialIssuerLD extends IPluginMethodMap {
|
|
|
104
105
|
*
|
|
105
106
|
* @beta This API may change without a BREAKING CHANGE notice.
|
|
106
107
|
*/
|
|
107
|
-
export interface ICreateVerifiablePresentationLDArgs {
|
|
108
|
+
export interface ICreateVerifiablePresentationLDArgs extends UsingResolutionOptions {
|
|
108
109
|
/**
|
|
109
110
|
* The json payload of the Presentation according to the
|
|
110
111
|
* {@link https://www.w3.org/TR/vc-data-model/#presentations | canonical model}.
|
|
@@ -150,7 +151,7 @@ export interface ICreateVerifiablePresentationLDArgs {
|
|
|
150
151
|
*
|
|
151
152
|
* @beta This API may change without a BREAKING CHANGE notice.
|
|
152
153
|
*/
|
|
153
|
-
export interface ICreateVerifiableCredentialLDArgs {
|
|
154
|
+
export interface ICreateVerifiableCredentialLDArgs extends UsingResolutionOptions {
|
|
154
155
|
/**
|
|
155
156
|
* The json payload of the Credential according to the
|
|
156
157
|
* {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model}
|
|
@@ -186,7 +187,7 @@ export interface ICreateVerifiableCredentialLDArgs {
|
|
|
186
187
|
*
|
|
187
188
|
* @beta This API may change without a BREAKING CHANGE notice
|
|
188
189
|
*/
|
|
189
|
-
export interface IVerifyCredentialLDArgs {
|
|
190
|
+
export interface IVerifyCredentialLDArgs extends UsingResolutionOptions {
|
|
190
191
|
/**
|
|
191
192
|
* The json payload of the Credential according to the
|
|
192
193
|
* {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model}
|
|
@@ -216,7 +217,7 @@ export interface IVerifyCredentialLDArgs {
|
|
|
216
217
|
*
|
|
217
218
|
* @beta This API may change without a BREAKING CHANGE notice.
|
|
218
219
|
*/
|
|
219
|
-
export interface IVerifyPresentationLDArgs {
|
|
220
|
+
export interface IVerifyPresentationLDArgs extends UsingResolutionOptions {
|
|
220
221
|
/**
|
|
221
222
|
* The json payload of the Credential according to the
|
|
222
223
|
* {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model}
|