@veramo/credential-ld 6.0.2-next.57 → 6.0.2

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.
Files changed (57) hide show
  1. package/build/action-handler.d.ts +461 -0
  2. package/build/action-handler.d.ts.map +1 -0
  3. package/build/{CredentialProviderLD.js → action-handler.js} +25 -38
  4. package/build/action-handler.js.map +1 -0
  5. package/build/index.d.ts +4 -3
  6. package/build/index.d.ts.map +1 -1
  7. package/build/index.js +4 -3
  8. package/build/index.js.map +1 -1
  9. package/build/ld-credential-module.d.ts +4 -4
  10. package/build/ld-credential-module.d.ts.map +1 -1
  11. package/build/ld-credential-module.js.map +1 -1
  12. package/build/ld-default-contexts.d.ts +1 -1
  13. package/build/ld-default-contexts.js +18 -18
  14. package/build/ld-default-contexts.js.map +1 -1
  15. package/build/ld-suites.d.ts +0 -1
  16. package/build/ld-suites.d.ts.map +1 -1
  17. package/build/ld-suites.js.map +1 -1
  18. package/build/plugin.schema.d.ts +430 -0
  19. package/build/plugin.schema.d.ts.map +1 -0
  20. package/build/plugin.schema.js +477 -0
  21. package/build/plugin.schema.js.map +1 -0
  22. package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts +0 -1
  23. package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts.map +1 -1
  24. package/build/suites/EcdsaSecp256k1RecoverySignature2020.js +0 -3
  25. package/build/suites/EcdsaSecp256k1RecoverySignature2020.js.map +1 -1
  26. package/build/suites/Ed25519Signature2018.d.ts +0 -1
  27. package/build/suites/Ed25519Signature2018.d.ts.map +1 -1
  28. package/build/suites/Ed25519Signature2018.js +0 -3
  29. package/build/suites/Ed25519Signature2018.js.map +1 -1
  30. package/build/suites/Ed25519Signature2020.d.ts +0 -1
  31. package/build/suites/Ed25519Signature2020.d.ts.map +1 -1
  32. package/build/suites/Ed25519Signature2020.js +0 -3
  33. package/build/suites/Ed25519Signature2020.js.map +1 -1
  34. package/build/suites/JsonWebSignature2020.d.ts +0 -1
  35. package/build/suites/JsonWebSignature2020.d.ts.map +1 -1
  36. package/build/suites/JsonWebSignature2020.js +0 -3
  37. package/build/suites/JsonWebSignature2020.js.map +1 -1
  38. package/build/tsdoc-metadata.json +1 -1
  39. package/build/types.d.ts +220 -0
  40. package/build/types.d.ts.map +1 -1
  41. package/package.json +12 -8
  42. package/src/__tests__/issue-verify-ed25519-2020.test.ts +122 -122
  43. package/src/__tests__/{issue-verify-flow-ld.test.ts → issue-verify-flow.test.ts} +11 -26
  44. package/src/{CredentialProviderLD.ts → action-handler.ts} +40 -61
  45. package/src/index.ts +4 -3
  46. package/src/ld-credential-module.ts +3 -4
  47. package/src/ld-default-contexts.ts +18 -18
  48. package/src/ld-suites.ts +0 -2
  49. package/src/plugin.schema.ts +476 -0
  50. package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +1 -6
  51. package/src/suites/Ed25519Signature2018.ts +0 -5
  52. package/src/suites/Ed25519Signature2020.ts +1 -5
  53. package/src/suites/JsonWebSignature2020.ts +1 -5
  54. package/src/types.ts +265 -0
  55. package/build/CredentialProviderLD.d.ts +0 -42
  56. package/build/CredentialProviderLD.d.ts.map +0 -1
  57. package/build/CredentialProviderLD.js.map +0 -1
@@ -0,0 +1,461 @@
1
+ import { IAgentPlugin, IKey, VerifiableCredential, VerifiablePresentation } from '@veramo/core-types';
2
+ import { VeramoLdSignature } from './index.js';
3
+ import { OrPromise, RecordLike } from '@veramo/utils';
4
+ import { ContextDoc, ICreateVerifiableCredentialLDArgs, ICreateVerifiablePresentationLDArgs, ICredentialIssuerLD, IRequiredContext, IVerifyCredentialLDArgs, IVerifyPresentationLDArgs } from './types.js';
5
+ /**
6
+ * A Veramo plugin that implements the {@link ICredentialIssuerLD} methods.
7
+ *
8
+ * @public
9
+ */
10
+ export declare class CredentialIssuerLD implements IAgentPlugin {
11
+ readonly methods: ICredentialIssuerLD;
12
+ readonly schema: {
13
+ components: {
14
+ schemas: {
15
+ ICreateVerifiableCredentialLDArgs: {
16
+ type: string;
17
+ properties: {
18
+ resolutionOptions: {
19
+ type: string;
20
+ properties: {
21
+ publicKeyFormat: {
22
+ type: string;
23
+ };
24
+ accept: {
25
+ type: string;
26
+ };
27
+ };
28
+ description: string;
29
+ };
30
+ credential: {
31
+ $ref: string;
32
+ description: string;
33
+ };
34
+ keyRef: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ fetchRemoteContexts: {
39
+ type: string;
40
+ description: string;
41
+ };
42
+ };
43
+ required: string[];
44
+ additionalProperties: {
45
+ description: string;
46
+ };
47
+ description: string;
48
+ };
49
+ CredentialPayload: {
50
+ type: string;
51
+ properties: {
52
+ issuer: {
53
+ $ref: string;
54
+ };
55
+ credentialSubject: {
56
+ $ref: string;
57
+ };
58
+ type: {
59
+ type: string;
60
+ items: {
61
+ type: string;
62
+ };
63
+ };
64
+ "@context": {
65
+ $ref: string;
66
+ };
67
+ issuanceDate: {
68
+ $ref: string;
69
+ };
70
+ expirationDate: {
71
+ $ref: string;
72
+ };
73
+ credentialStatus: {
74
+ $ref: string;
75
+ };
76
+ id: {
77
+ type: string;
78
+ };
79
+ };
80
+ required: string[];
81
+ description: string;
82
+ };
83
+ IssuerType: {
84
+ anyOf: ({
85
+ type: string;
86
+ properties: {
87
+ id: {
88
+ type: string;
89
+ };
90
+ };
91
+ required: string[];
92
+ } | {
93
+ type: string;
94
+ properties?: undefined;
95
+ required?: undefined;
96
+ })[];
97
+ description: string;
98
+ };
99
+ CredentialSubject: {
100
+ type: string;
101
+ properties: {
102
+ id: {
103
+ type: string;
104
+ };
105
+ };
106
+ description: string;
107
+ };
108
+ ContextType: {
109
+ anyOf: ({
110
+ type: string;
111
+ items?: undefined;
112
+ } | {
113
+ type: string;
114
+ items: {
115
+ anyOf: {
116
+ type: string;
117
+ }[];
118
+ };
119
+ })[];
120
+ description: string;
121
+ };
122
+ DateType: {
123
+ type: string;
124
+ description: string;
125
+ };
126
+ CredentialStatusReference: {
127
+ type: string;
128
+ properties: {
129
+ id: {
130
+ type: string;
131
+ };
132
+ type: {
133
+ type: string;
134
+ };
135
+ };
136
+ required: string[];
137
+ description: string;
138
+ };
139
+ VerifiableCredential: {
140
+ type: string;
141
+ properties: {
142
+ proof: {
143
+ $ref: string;
144
+ };
145
+ issuer: {
146
+ $ref: string;
147
+ };
148
+ credentialSubject: {
149
+ $ref: string;
150
+ };
151
+ type: {
152
+ anyOf: ({
153
+ type: string;
154
+ items: {
155
+ type: string;
156
+ };
157
+ } | {
158
+ type: string;
159
+ items?: undefined;
160
+ })[];
161
+ };
162
+ "@context": {
163
+ $ref: string;
164
+ };
165
+ issuanceDate: {
166
+ type: string;
167
+ };
168
+ expirationDate: {
169
+ type: string;
170
+ };
171
+ credentialStatus: {
172
+ $ref: string;
173
+ };
174
+ id: {
175
+ type: string;
176
+ };
177
+ };
178
+ required: string[];
179
+ description: string;
180
+ };
181
+ ProofType: {
182
+ type: string;
183
+ properties: {
184
+ type: {
185
+ type: string;
186
+ };
187
+ };
188
+ description: string;
189
+ };
190
+ ICreateVerifiablePresentationLDArgs: {
191
+ type: string;
192
+ properties: {
193
+ resolutionOptions: {
194
+ type: string;
195
+ properties: {
196
+ publicKeyFormat: {
197
+ type: string;
198
+ };
199
+ accept: {
200
+ type: string;
201
+ };
202
+ };
203
+ description: string;
204
+ };
205
+ presentation: {
206
+ $ref: string;
207
+ description: string;
208
+ };
209
+ challenge: {
210
+ type: string;
211
+ description: string;
212
+ };
213
+ domain: {
214
+ type: string;
215
+ description: string;
216
+ };
217
+ keyRef: {
218
+ type: string;
219
+ description: string;
220
+ };
221
+ fetchRemoteContexts: {
222
+ type: string;
223
+ description: string;
224
+ };
225
+ };
226
+ required: string[];
227
+ additionalProperties: {
228
+ description: string;
229
+ };
230
+ description: string;
231
+ };
232
+ PresentationPayload: {
233
+ type: string;
234
+ properties: {
235
+ holder: {
236
+ type: string;
237
+ };
238
+ verifiableCredential: {
239
+ type: string;
240
+ items: {
241
+ $ref: string;
242
+ };
243
+ };
244
+ type: {
245
+ type: string;
246
+ items: {
247
+ type: string;
248
+ };
249
+ };
250
+ "@context": {
251
+ $ref: string;
252
+ };
253
+ verifier: {
254
+ type: string;
255
+ items: {
256
+ type: string;
257
+ };
258
+ };
259
+ issuanceDate: {
260
+ $ref: string;
261
+ };
262
+ expirationDate: {
263
+ $ref: string;
264
+ };
265
+ id: {
266
+ type: string;
267
+ };
268
+ };
269
+ required: string[];
270
+ description: string;
271
+ };
272
+ W3CVerifiableCredential: {
273
+ anyOf: {
274
+ $ref: string;
275
+ }[];
276
+ description: string;
277
+ };
278
+ CompactJWT: {
279
+ type: string;
280
+ description: string;
281
+ };
282
+ VerifiablePresentation: {
283
+ type: string;
284
+ properties: {
285
+ proof: {
286
+ $ref: string;
287
+ };
288
+ holder: {
289
+ type: string;
290
+ };
291
+ verifiableCredential: {
292
+ type: string;
293
+ items: {
294
+ $ref: string;
295
+ };
296
+ };
297
+ type: {
298
+ anyOf: ({
299
+ type: string;
300
+ items: {
301
+ type: string;
302
+ };
303
+ } | {
304
+ type: string;
305
+ items?: undefined;
306
+ })[];
307
+ };
308
+ "@context": {
309
+ $ref: string;
310
+ };
311
+ verifier: {
312
+ type: string;
313
+ items: {
314
+ type: string;
315
+ };
316
+ };
317
+ issuanceDate: {
318
+ type: string;
319
+ };
320
+ expirationDate: {
321
+ type: string;
322
+ };
323
+ id: {
324
+ type: string;
325
+ };
326
+ };
327
+ required: string[];
328
+ description: string;
329
+ };
330
+ IVerifyCredentialLDArgs: {
331
+ type: string;
332
+ properties: {
333
+ resolutionOptions: {
334
+ type: string;
335
+ properties: {
336
+ publicKeyFormat: {
337
+ type: string;
338
+ };
339
+ accept: {
340
+ type: string;
341
+ };
342
+ };
343
+ description: string;
344
+ };
345
+ credential: {
346
+ $ref: string;
347
+ description: string;
348
+ };
349
+ fetchRemoteContexts: {
350
+ type: string;
351
+ description: string;
352
+ };
353
+ };
354
+ required: string[];
355
+ additionalProperties: {
356
+ description: string;
357
+ };
358
+ description: string;
359
+ };
360
+ IVerifyPresentationLDArgs: {
361
+ type: string;
362
+ properties: {
363
+ resolutionOptions: {
364
+ type: string;
365
+ properties: {
366
+ publicKeyFormat: {
367
+ type: string;
368
+ };
369
+ accept: {
370
+ type: string;
371
+ };
372
+ };
373
+ description: string;
374
+ };
375
+ presentation: {
376
+ $ref: string;
377
+ description: string;
378
+ };
379
+ challenge: {
380
+ type: string;
381
+ description: string;
382
+ };
383
+ domain: {
384
+ type: string;
385
+ description: string;
386
+ };
387
+ fetchRemoteContexts: {
388
+ type: string;
389
+ description: string;
390
+ };
391
+ };
392
+ required: string[];
393
+ additionalProperties: {
394
+ description: string;
395
+ };
396
+ description: string;
397
+ };
398
+ };
399
+ methods: {
400
+ createVerifiableCredentialLD: {
401
+ description: string;
402
+ arguments: {
403
+ $ref: string;
404
+ };
405
+ returnType: {
406
+ $ref: string;
407
+ };
408
+ };
409
+ createVerifiablePresentationLD: {
410
+ description: string;
411
+ arguments: {
412
+ $ref: string;
413
+ };
414
+ returnType: {
415
+ $ref: string;
416
+ };
417
+ };
418
+ verifyCredentialLD: {
419
+ description: string;
420
+ arguments: {
421
+ $ref: string;
422
+ };
423
+ returnType: {
424
+ type: string;
425
+ };
426
+ };
427
+ verifyPresentationLD: {
428
+ description: string;
429
+ arguments: {
430
+ $ref: string;
431
+ };
432
+ returnType: {
433
+ type: string;
434
+ };
435
+ };
436
+ };
437
+ };
438
+ };
439
+ private ldCredentialModule;
440
+ constructor(options: {
441
+ contextMaps: RecordLike<OrPromise<ContextDoc>>[];
442
+ suites: VeramoLdSignature[];
443
+ });
444
+ /** {@inheritdoc ICredentialIssuerLD.createVerifiablePresentationLD} */
445
+ createVerifiablePresentationLD(args: ICreateVerifiablePresentationLDArgs, context: IRequiredContext): Promise<VerifiablePresentation>;
446
+ /** {@inheritdoc ICredentialIssuerLD.createVerifiableCredentialLD} */
447
+ createVerifiableCredentialLD(args: ICreateVerifiableCredentialLDArgs, context: IRequiredContext): Promise<VerifiableCredential>;
448
+ /** {@inheritdoc ICredentialIssuerLD.verifyCredentialLD} */
449
+ verifyCredentialLD(args: IVerifyCredentialLDArgs, context: IRequiredContext): Promise<boolean>;
450
+ /** {@inheritdoc ICredentialIssuerLD.verifyPresentationLD} */
451
+ verifyPresentationLD(args: IVerifyPresentationLDArgs, context: IRequiredContext): Promise<boolean>;
452
+ private findSigningKeyWithId;
453
+ /**
454
+ * Returns true if the key is supported by any of the installed LD Signature suites
455
+ * @param k - the key to match
456
+ *
457
+ * @internal
458
+ */
459
+ matchKeyForLDSuite(k: IKey): Promise<boolean>;
460
+ }
461
+ //# sourceMappingURL=action-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-handler.d.ts","sourceRoot":"","sources":["../src/action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAEZ,IAAI,EAGJ,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAI9C,OAAO,EAOL,SAAS,EAET,UAAU,EAEX,MAAM,eAAe,CAAA;AAItB,OAAO,EACL,UAAU,EACV,iCAAiC,EACjC,mCAAmC,EACnC,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,YAAY,CAAA;AAKnB;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;IACrC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAA6B;IAE5C,OAAO,CAAC,kBAAkB,CAAoB;gBAElC,OAAO,EAAE;QAAE,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QAAC,MAAM,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAetG,uEAAuE;IAC1D,8BAA8B,CACzC,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC;IAoElC,qEAAqE;IACxD,4BAA4B,CACvC,IAAI,EAAE,iCAAiC,EACvC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC;IAkDhC,2DAA2D;IAC9C,kBAAkB,CAC7B,IAAI,EAAE,uBAAuB,EAC7B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,OAAO,CAAC;IAWnB,6DAA6D;IAChD,oBAAoB,CAC/B,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,OAAO,CAAC;YAeL,oBAAoB;IAsClC;;;;;OAKG;IACG,kBAAkB,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;CAiBpD"}
@@ -1,3 +1,4 @@
1
+ import { schema } from './plugin.schema.js';
1
2
  import Debug from 'debug';
2
3
  import { LdContextLoader } from './ld-context-loader.js';
3
4
  import { extractIssuer, intersect, isDefined, MANDATORY_CREDENTIAL_CONTEXT, mapIdentifierKeysToDoc, processEntryToArray, removeDIDParameters, } from '@veramo/utils';
@@ -5,42 +6,29 @@ import { LdCredentialModule } from './ld-credential-module.js';
5
6
  import { LdSuiteLoader } from './ld-suite-loader.js';
6
7
  const debug = Debug('veramo:credential-ld:action-handler');
7
8
  /**
8
- * A handler that implements the {@link AbstractCredentialProvider} methods.
9
+ * A Veramo plugin that implements the {@link ICredentialIssuerLD} methods.
9
10
  *
10
11
  * @public
11
12
  */
12
- export class CredentialProviderLD {
13
+ export class CredentialIssuerLD {
14
+ methods;
15
+ schema = schema.ICredentialIssuerLD;
13
16
  ldCredentialModule;
14
17
  constructor(options) {
15
18
  this.ldCredentialModule = new LdCredentialModule({
16
19
  ldContextLoader: new LdContextLoader({ contextsPaths: options.contextMaps }),
17
20
  ldSuiteLoader: new LdSuiteLoader({ veramoLdSignatures: options.suites }),
18
21
  });
22
+ this.methods = {
23
+ createVerifiablePresentationLD: this.createVerifiablePresentationLD.bind(this),
24
+ createVerifiableCredentialLD: this.createVerifiableCredentialLD.bind(this),
25
+ verifyCredentialLD: this.verifyCredentialLD.bind(this),
26
+ verifyPresentationLD: this.verifyPresentationLD.bind(this),
27
+ matchKeyForLDSuite: this.matchKeyForLDSuite.bind(this),
28
+ };
19
29
  }
20
- /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.matchKeyForType} */
21
- matchKeyForType(key) {
22
- return this.matchKeyForLDSuite(key);
23
- }
24
- /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.getTypeProofFormat} */
25
- getTypeProofFormat() {
26
- return 'lds';
27
- }
28
- /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canIssueCredentialType} */
29
- canIssueCredentialType(args) {
30
- return (args.proofFormat === 'lds');
31
- }
32
- /** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canVerifyDocumentType */
33
- canVerifyDocumentType(args) {
34
- const { document } = args;
35
- for (const suite of this.ldCredentialModule.ldSuiteLoader.getAllSignatureSuites()) {
36
- if (suite.getSupportedProofType() === document?.proof?.type || '') {
37
- return true;
38
- }
39
- }
40
- return false;
41
- }
42
- /** {@inheritdoc ICredentialIssuer.createVerifiablePresentationLD} */
43
- async createVerifiablePresentation(args, context) {
30
+ /** {@inheritdoc ICredentialIssuerLD.createVerifiablePresentationLD} */
31
+ async createVerifiablePresentationLD(args, context) {
44
32
  const presentationContext = processEntryToArray(args?.presentation?.['@context'], MANDATORY_CREDENTIAL_CONTEXT);
45
33
  const presentationType = processEntryToArray(args?.presentation?.type, 'VerifiablePresentation');
46
34
  const presentation = {
@@ -85,8 +73,8 @@ export class CredentialProviderLD {
85
73
  return Promise.reject(error);
86
74
  }
87
75
  }
88
- /** {@inheritdoc ICredentialIssuer.createVerifiableCredentialLD} */
89
- async createVerifiableCredential(args, context) {
76
+ /** {@inheritdoc ICredentialIssuerLD.createVerifiableCredentialLD} */
77
+ async createVerifiableCredentialLD(args, context) {
90
78
  const credentialContext = processEntryToArray(args?.credential?.['@context'], MANDATORY_CREDENTIAL_CONTEXT);
91
79
  const credentialType = processEntryToArray(args?.credential?.type, 'VerifiableCredential');
92
80
  const credential = {
@@ -118,18 +106,17 @@ export class CredentialProviderLD {
118
106
  return Promise.reject(error);
119
107
  }
120
108
  }
121
- /** {@inheritdoc ICredentialIssuer.verifyCredentialLD} */
122
- async verifyCredential(args, context) {
123
- args.credential = args.credential;
109
+ /** {@inheritdoc ICredentialIssuerLD.verifyCredentialLD} */
110
+ async verifyCredentialLD(args, context) {
124
111
  const credential = args.credential;
125
- let now = new Date();
126
- if (args.policies?.now && typeof args.policies?.now === 'number') {
127
- now = new Date(args.policies?.now * 1000);
112
+ let { now } = args;
113
+ if (typeof now === 'number') {
114
+ now = new Date(now * 1000);
128
115
  }
129
116
  return this.ldCredentialModule.verifyCredential(credential, { ...args, now }, context);
130
117
  }
131
- /** {@inheritdoc ICredentialVerifier.verifyPresentation} */
132
- async verifyPresentation(args, context) {
118
+ /** {@inheritdoc ICredentialIssuerLD.verifyPresentationLD} */
119
+ async verifyPresentationLD(args, context) {
133
120
  const presentation = args.presentation;
134
121
  let { now } = args;
135
122
  if (typeof now === 'number') {
@@ -166,7 +153,7 @@ export class CredentialProviderLD {
166
153
  *
167
154
  * @internal
168
155
  */
169
- matchKeyForLDSuite(k) {
156
+ async matchKeyForLDSuite(k) {
170
157
  // prefilter based on key algorithms
171
158
  switch (k.type) {
172
159
  case 'Ed25519':
@@ -185,4 +172,4 @@ export class CredentialProviderLD {
185
172
  .some((supportsThisKey) => supportsThisKey);
186
173
  }
187
174
  }
188
- //# sourceMappingURL=CredentialProviderLD.js.map
175
+ //# sourceMappingURL=action-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-handler.js","sourceRoot":"","sources":["../src/action-handler.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAEL,aAAa,EACb,SAAS,EACT,SAAS,EACT,4BAA4B,EAC5B,sBAAsB,EAEtB,mBAAmB,EAEnB,mBAAmB,GACpB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAYpD,MAAM,KAAK,GAAG,KAAK,CAAC,qCAAqC,CAAC,CAAA;AAE1D;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IACpB,OAAO,CAAqB;IAC5B,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAA;IAEpC,kBAAkB,CAAoB;IAE9C,YAAY,OAA0F;QACpG,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC;YAC/C,eAAe,EAAE,IAAI,eAAe,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;YAC5E,aAAa,EAAE,IAAI,aAAa,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;SACzE,CAAC,CAAA;QAE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ACH,KAAK,CAAC,kBAAkB,CAAC,CAAO;QAC9B,oCAAoC;QACpC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YACf,KAAK,SAAS;gBACZ,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC;oBAAE,OAAO,KAAK,CAAA;gBACxD,MAAK;YACP,KAAK,WAAW;gBACd,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,IAAI,EAAE,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;oBAAE,OAAO,KAAK,CAAA;gBACzF,MAAK;QACT,CAAC;QAED,0EAA0E;QAC1E,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAA;QAC5E,OAAO,MAAM;aACV,GAAG,CAAC,CAAC,KAAwB,EAAE,EAAE,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aACrF,IAAI,CAAC,CAAC,eAAwB,EAAE,EAAE,CAAC,eAAe,CAAC,CAAA;IACxD,CAAC;CACF"}
package/build/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Provides a {@link @veramo/credential-ld#CredentialProviderLD | handler} for the {@link @veramo/credential-w3c#CredentialPlugin} that
2
+ * Provides a {@link @veramo/credential-ld#CredentialIssuerLD | plugin} for the {@link @veramo/core#Agent} that
3
3
  * implements
4
- * {@link @veramo/core-types#AbstractCredentialProvider} interface.
4
+ * {@link @veramo/credential-ld#ICredentialIssuerLD} interface.
5
5
  *
6
6
  * This plugin adds support for working with JSON-LD credentials.
7
7
  * When installed, this plugin will be automatically used by
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * @packageDocumentation
12
12
  */
13
- export { CredentialProviderLD } from './CredentialProviderLD.js';
13
+ export { CredentialIssuerLD } from './action-handler.js';
14
14
  export * from './types.js';
15
15
  export { LdDefaultContexts } from './ld-default-contexts.js';
16
16
  export { VeramoLdSignature } from './ld-suites.js';
@@ -18,4 +18,5 @@ export * from './suites/EcdsaSecp256k1RecoverySignature2020.js';
18
18
  export * from './suites/Ed25519Signature2018.js';
19
19
  export * from './suites/Ed25519Signature2020.js';
20
20
  export * from './suites/JsonWebSignature2020.js';
21
+ export { schema } from './plugin.schema.js';
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA"}
package/build/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Provides a {@link @veramo/credential-ld#CredentialProviderLD | handler} for the {@link @veramo/credential-w3c#CredentialPlugin} that
2
+ * Provides a {@link @veramo/credential-ld#CredentialIssuerLD | plugin} for the {@link @veramo/core#Agent} that
3
3
  * implements
4
- * {@link @veramo/core-types#AbstractCredentialProvider} interface.
4
+ * {@link @veramo/credential-ld#ICredentialIssuerLD} interface.
5
5
  *
6
6
  * This plugin adds support for working with JSON-LD credentials.
7
7
  * When installed, this plugin will be automatically used by
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * @packageDocumentation
12
12
  */
13
- export { CredentialProviderLD } from './CredentialProviderLD.js';
13
+ export { CredentialIssuerLD } from './action-handler.js';
14
14
  export * from './types.js';
15
15
  export { LdDefaultContexts } from './ld-default-contexts.js';
16
16
  export { VeramoLdSignature } from './ld-suites.js';
@@ -18,4 +18,5 @@ export * from './suites/EcdsaSecp256k1RecoverySignature2020.js';
18
18
  export * from './suites/Ed25519Signature2018.js';
19
19
  export * from './suites/Ed25519Signature2020.js';
20
20
  export * from './suites/JsonWebSignature2020.js';
21
+ export { schema } from './plugin.schema.js';
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,cAAc,iDAAiD,CAAA;AAC/D,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA"}