@veramo/credential-ld 4.1.3-next.9 → 4.2.1-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.
Files changed (43) hide show
  1. package/build/action-handler.d.ts.map +1 -1
  2. package/build/action-handler.js.map +1 -1
  3. package/build/contexts/did_v0.11.json +6 -0
  4. package/build/contexts/ed25519-signature-2020-v1.json +77 -0
  5. package/build/contexts/json-web-signature-2020-v1.json +71 -0
  6. package/build/index.d.ts +2 -0
  7. package/build/index.d.ts.map +1 -1
  8. package/build/index.js +2 -0
  9. package/build/index.js.map +1 -1
  10. package/build/ld-credential-module.js +6 -4
  11. package/build/ld-credential-module.js.map +1 -1
  12. package/build/ld-default-contexts.d.ts.map +1 -1
  13. package/build/ld-default-contexts.js +2 -0
  14. package/build/ld-default-contexts.js.map +1 -1
  15. package/build/ld-suite-loader.d.ts +1 -1
  16. package/build/ld-suite-loader.d.ts.map +1 -1
  17. package/build/ld-suite-loader.js +8 -5
  18. package/build/ld-suite-loader.js.map +1 -1
  19. package/build/ld-suites.d.ts +1 -1
  20. package/build/ld-suites.d.ts.map +1 -1
  21. package/build/suites/Ed25519Signature2020.d.ts +19 -0
  22. package/build/suites/Ed25519Signature2020.d.ts.map +1 -0
  23. package/build/suites/Ed25519Signature2020.js +102 -0
  24. package/build/suites/Ed25519Signature2020.js.map +1 -0
  25. package/build/suites/JsonWebSignature2020.d.ts +16 -0
  26. package/build/suites/JsonWebSignature2020.d.ts.map +1 -0
  27. package/build/suites/JsonWebSignature2020.js +105 -0
  28. package/build/suites/JsonWebSignature2020.js.map +1 -0
  29. package/build/tsdoc-metadata.json +1 -1
  30. package/build/types.d.ts +2 -2
  31. package/build/types.d.ts.map +1 -1
  32. package/package.json +8 -6
  33. package/src/action-handler.ts +1 -0
  34. package/src/contexts/did_v0.11.json +6 -0
  35. package/src/contexts/ed25519-signature-2020-v1.json +77 -0
  36. package/src/contexts/json-web-signature-2020-v1.json +71 -0
  37. package/src/index.ts +2 -0
  38. package/src/ld-credential-module.ts +4 -4
  39. package/src/ld-default-contexts.ts +2 -0
  40. package/src/ld-suite-loader.ts +9 -7
  41. package/src/module-types/jsonld/index.d.ts +2 -0
  42. package/src/suites/Ed25519Signature2020.ts +79 -0
  43. package/src/suites/JsonWebSignature2020.ts +85 -0
@@ -1 +1 @@
1
- {"version":3,"file":"action-handler.d.ts","sourceRoot":"","sources":["../src/action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAKZ,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAU,iBAAiB,EAAE,MAAM,IAAI,CAAA;AAG9C,OAAO,EAML,SAAS,EAET,UAAU,EACX,MAAM,eAAe,CAAA;AAItB,OAAO,EACL,UAAU,EACV,iCAAiC,EACjC,mCAAmC,EACnC,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAIhB;;;;GAIG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAA;IACrC,QAAQ,CAAC,MAAM,MAA2B;IAE1C,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;IActG,uEAAuE;IAC1D,8BAA8B,CACzC,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC;IAiElC,qEAAqE;IACxD,4BAA4B,CACvC,IAAI,EAAE,iCAAiC,EACvC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC;IAiDhC,2DAA2D;IAC9C,kBAAkB,CAC7B,IAAI,EAAE,uBAAuB,EAC7B,OAAO,EAAE,gBAAgB,GACx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;gBACV,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,CAAA;aACxD;YACD,IAAI,UAAU,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE;gBACnF,KAAK,CACH,wHAAwH,CACzH,CAAA;gBACD,UAAU,GAAG,SAAS,CAAA;aACvB;YACD,IAAI,CAAC,UAAU,EAAE;gBACf,IAAI,MAAM,EAAE;oBACV,KAAK,CACH,uHAAuH,CACxH,CAAA;iBACF;gBACD,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAA;aAC/F;YAGD,IAAI,CAAC,UAAU;gBAAE,MAAM,KAAK,CAAC,oDAAoD,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;YAClG,oBAAoB,GAAG,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAA;YAC5D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAA;QAC7C,CAAC;KAAA;CACF;AAtND,gDAsNC"}
@@ -12,6 +12,10 @@
12
12
  "EcdsaSecp256k1VerificationKey2019": "sec:EcdsaSecp256k1VerificationKey2019",
13
13
  "Ed25519Signature2018": "sec:Ed25519Signature2018",
14
14
  "Ed25519VerificationKey2018": "sec:Ed25519VerificationKey2018",
15
+ "Ed25519Signature2020": "sec:Ed25519Signature2020",
16
+ "Ed25519VerificationKey2020": "sec:Ed25519VerificationKey2020",
17
+ "JsonWebSignature2020": "sec:JsonWebSignature2020",
18
+ "JsonWebKey2020": "sec:JsonWebKey2020",
15
19
  "RsaSignature2018": "sec:RsaSignature2018",
16
20
  "RsaVerificationKey2018": "sec:RsaVerificationKey2018",
17
21
  "SchnorrSecp256k1Signature2019": "sec:SchnorrSecp256k1Signature2019",
@@ -46,6 +50,8 @@
46
50
  "proofValue": "sec:proofValue",
47
51
  "publicKey": { "@id": "sec:publicKey", "@type": "@id", "@container": "@set" },
48
52
  "publicKeyBase58": "sec:publicKeyBase58",
53
+ "publicKeyMultibase": "sec:publicKeyMultibase",
54
+ "publicKeyJwk": "sec:publicKeyJwk",
49
55
  "publicKeyPem": "sec:publicKeyPem",
50
56
  "revoked": { "@id": "sec:revoked", "@type": "xsd:dateTime" },
51
57
  "service": { "@id": "didv:service", "@type": "@id", "@container": "@set" },
@@ -0,0 +1,77 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "proof": {
7
+ "@id": "https://w3id.org/security#proof",
8
+ "@type": "@id",
9
+ "@container": "@graph"
10
+ },
11
+ "Ed25519VerificationKey2020": {
12
+ "@id": "https://w3id.org/security#Ed25519VerificationKey2020"
13
+ },
14
+ "Ed25519Signature2020": {
15
+ "@id": "https://w3id.org/security#Ed25519Signature2020",
16
+ "@context": {
17
+ "@protected": true,
18
+ "id": "@id",
19
+ "type": "@type",
20
+ "challenge": "https://w3id.org/security#challenge",
21
+ "created": {
22
+ "@id": "http://purl.org/dc/terms/created",
23
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
24
+ },
25
+ "domain": "https://w3id.org/security#domain",
26
+ "expires": {
27
+ "@id": "https://w3id.org/security#expiration",
28
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
29
+ },
30
+ "nonce": "https://w3id.org/security#nonce",
31
+ "proofPurpose": {
32
+ "@id": "https://w3id.org/security#proofPurpose",
33
+ "@type": "@vocab",
34
+ "@context": {
35
+ "@version": 1.1,
36
+ "@protected": true,
37
+ "id": "@id",
38
+ "type": "@type",
39
+ "assertionMethod": {
40
+ "@id": "https://w3id.org/security#assertionMethod",
41
+ "@type": "@id",
42
+ "@container": "@set"
43
+ },
44
+ "authentication": {
45
+ "@id": "https://w3id.org/security#authenticationMethod",
46
+ "@type": "@id",
47
+ "@container": "@set"
48
+ },
49
+ "capabilityInvocation": {
50
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
51
+ "@type": "@id",
52
+ "@container": "@set"
53
+ },
54
+ "capabilityDelegation": {
55
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
56
+ "@type": "@id",
57
+ "@container": "@set"
58
+ },
59
+ "keyAgreement": {
60
+ "@id": "https://w3id.org/security#keyAgreementMethod",
61
+ "@type": "@id",
62
+ "@container": "@set"
63
+ }
64
+ }
65
+ },
66
+ "proofValue": {
67
+ "@id": "https://w3id.org/security#proofValue",
68
+ "@type": "https://w3id.org/security#multibase"
69
+ },
70
+ "verificationMethod": {
71
+ "@id": "https://w3id.org/security#verificationMethod",
72
+ "@type": "@id"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "id": "@id",
5
+ "type": "@type",
6
+ "@protected": true,
7
+ "JsonWebKey2020": {
8
+ "@id": "https://w3id.org/security#JsonWebKey2020"
9
+ },
10
+ "JsonWebSignature2020": {
11
+ "@id": "https://w3id.org/security#JsonWebSignature2020",
12
+ "@context": {
13
+ "@version": 1.1,
14
+ "id": "@id",
15
+ "type": "@type",
16
+ "@protected": true,
17
+ "challenge": "https://w3id.org/security#challenge",
18
+ "created": {
19
+ "@id": "http://purl.org/dc/terms/created",
20
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
21
+ },
22
+ "domain": "https://w3id.org/security#domain",
23
+ "expires": {
24
+ "@id": "https://w3id.org/security#expiration",
25
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
26
+ },
27
+ "jws": "https://w3id.org/security#jws",
28
+ "nonce": "https://w3id.org/security#nonce",
29
+ "proofPurpose": {
30
+ "@id": "https://w3id.org/security#proofPurpose",
31
+ "@type": "@vocab",
32
+ "@context": {
33
+ "@version": 1.1,
34
+ "@protected": true,
35
+ "id": "@id",
36
+ "type": "@type",
37
+ "assertionMethod": {
38
+ "@id": "https://w3id.org/security#assertionMethod",
39
+ "@type": "@id",
40
+ "@container": "@set"
41
+ },
42
+ "authentication": {
43
+ "@id": "https://w3id.org/security#authenticationMethod",
44
+ "@type": "@id",
45
+ "@container": "@set"
46
+ },
47
+ "capabilityInvocation": {
48
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
49
+ "@type": "@id",
50
+ "@container": "@set"
51
+ },
52
+ "capabilityDelegation": {
53
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
54
+ "@type": "@id",
55
+ "@container": "@set"
56
+ },
57
+ "keyAgreement": {
58
+ "@id": "https://w3id.org/security#keyAgreementMethod",
59
+ "@type": "@id",
60
+ "@container": "@set"
61
+ }
62
+ }
63
+ },
64
+ "verificationMethod": {
65
+ "@id": "https://w3id.org/security#verificationMethod",
66
+ "@type": "@id"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
package/build/index.d.ts CHANGED
@@ -16,6 +16,8 @@ export { LdDefaultContexts } from './ld-default-contexts';
16
16
  export { VeramoLdSignature } from './ld-suites';
17
17
  export * from './suites/EcdsaSecp256k1RecoverySignature2020';
18
18
  export * from './suites/Ed25519Signature2018';
19
+ export * from './suites/Ed25519Signature2020';
20
+ export * from './suites/JsonWebSignature2020';
19
21
  /**
20
22
  * The parameter and return types schemas for the {@link @veramo/credential-ld#CredentialIssuerLD | CredentialIssuerLD}
21
23
  * plugin methods.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,+BAA+B,CAAA;AAE7C;;;;;GAKG;AACH,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,cAAc,8CAA8C,CAAA;AAC5D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAE7C;;;;;GAKG;AACH,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA"}
package/build/index.js CHANGED
@@ -36,6 +36,8 @@ var ld_suites_1 = require("./ld-suites");
36
36
  Object.defineProperty(exports, "VeramoLdSignature", { enumerable: true, get: function () { return ld_suites_1.VeramoLdSignature; } });
37
37
  __exportStar(require("./suites/EcdsaSecp256k1RecoverySignature2020"), exports);
38
38
  __exportStar(require("./suites/Ed25519Signature2018"), exports);
39
+ __exportStar(require("./suites/Ed25519Signature2020"), exports);
40
+ __exportStar(require("./suites/JsonWebSignature2020"), exports);
39
41
  /**
40
42
  * The parameter and return types schemas for the {@link @veramo/credential-ld#CredentialIssuerLD | CredentialIssuerLD}
41
43
  * plugin methods.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,mDAAqD;AAA5C,oHAAA,kBAAkB,OAAA;AAC3B,0CAAuB;AACvB,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,yCAA+C;AAAtC,8GAAA,iBAAiB,OAAA;AAC1B,+EAA4D;AAC5D,gEAA6C;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,mDAAqD;AAA5C,oHAAA,kBAAkB,OAAA;AAC3B,0CAAuB;AACvB,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,yCAA+C;AAAtC,8GAAA,iBAAiB,OAAA;AAC1B,+EAA4D;AAC5D,gEAA6C;AAC7C,gEAA6C;AAC7C,gEAA6C;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM"}
@@ -99,20 +99,22 @@ class LdCredentialModule {
99
99
  }));
100
100
  }
101
101
  issueLDVerifiableCredential(credential, issuerDid, key, verificationMethodId, options, context) {
102
+ var _a, _b, _c;
102
103
  return __awaiter(this, void 0, void 0, function* () {
103
- const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type);
104
+ const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, (_c = (_b = (_a = key.meta) === null || _a === void 0 ? void 0 : _a.verificationMethod) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : '');
104
105
  const documentLoader = this.getDocumentLoader(context, options.fetchRemoteContexts);
105
106
  // some suites can modify the incoming credential (e.g. add required contexts)
106
107
  suite.preSigningCredModification(credential);
107
- return yield vc.issue(Object.assign(Object.assign({}, options), { credential, suite: suite.getSuiteForSigning(key, issuerDid, verificationMethodId, context), documentLoader, compactProof: false }));
108
+ return yield vc.issue(Object.assign(Object.assign({}, options), { credential, suite: yield suite.getSuiteForSigning(key, issuerDid, verificationMethodId, context), documentLoader, compactProof: false }));
108
109
  });
109
110
  }
110
111
  signLDVerifiablePresentation(presentation, holderDid, key, verificationMethodId, challenge, domain, options, context) {
112
+ var _a, _b, _c;
111
113
  return __awaiter(this, void 0, void 0, function* () {
112
- const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type);
114
+ const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, (_c = (_b = (_a = key.meta) === null || _a === void 0 ? void 0 : _a.verificationMethod) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : '');
113
115
  const documentLoader = this.getDocumentLoader(context, options.fetchRemoteContexts);
114
116
  suite.preSigningPresModification(presentation);
115
- return yield vc.signPresentation(Object.assign(Object.assign({}, options), { presentation, suite: suite.getSuiteForSigning(key, holderDid, verificationMethodId, context), challenge,
117
+ return yield vc.signPresentation(Object.assign(Object.assign({}, options), { presentation, suite: yield suite.getSuiteForSigning(key, holderDid, verificationMethodId, context), challenge,
116
118
  domain,
117
119
  documentLoader, compactProof: false }));
118
120
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ld-credential-module.js","sourceRoot":"","sources":["../src/ld-credential-module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,8DAA+B;AAC/B,kDAAyB;AACzB,6EAA2E;AAC3E,2DAA4C;AAK5C,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,iCAAiC,CAAC,CAAA;AAEtD,MAAa,kBAAkB;IAY7B,YAAY,OAA2E;QACrF,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAA;QAC9C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAA;IAC5C,CAAC;IAED,iBAAiB,CAAC,OAAiC,EAAE,yBAAkC,KAAK;QAC1F,OAAO,IAAA,uCAAmB,EAAC,CAAO,GAAW,EAAE,EAAE;YAC/C,+CAA+C;YAE/C,iBAAiB;YACjB,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE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EAAE;gBACpB,+BAA+B;gBAC/B,KAAK,CAAC,oCAAoC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;aAC7E;YACD,OAAO,MAAM,CAAA;QACf,CAAC;KAAA;CACF;AA5KD,gDA4KC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ld-default-contexts.d.ts","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,kBAkB5B,CAAA"}
1
+ {"version":3,"file":"ld-default-contexts.d.ts","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,kBAoB5B,CAAA"}
@@ -17,6 +17,8 @@ exports.LdDefaultContexts = new Map([
17
17
  ['https://w3id.org/security/v3-unstable', require('./contexts/w3id.org_security_v3-unstable.json')],
18
18
  ['https://w3id.org/security/suites/ed25519-2018/v1', require('./contexts/w3id.org_security_suites_ed25519-2018_v1.json')],
19
19
  ['https://w3id.org/security/suites/x25519-2019/v1', require('./contexts/w3id.org_security_suites_x25519-2019_v1.json')],
20
+ ['https://w3id.org/security/suites/ed25519-2020/v1', require('./contexts/ed25519-signature-2020-v1.json')],
21
+ ['https://w3id.org/security/suites/jws-2020/v1', require('./contexts/json-web-signature-2020-v1.json')],
20
22
  // ['https://w3id.org/did/v0.11', require('./contexts/did_v0.11.json')],
21
23
  // ['https://veramo.io/contexts/socialmedia/v1', require('./contexts/socialmedia-v1.json')],
22
24
  // ['https://veramo.io/contexts/kyc/v1', require('./contexts/kyc-v1.json')],
@@ -1 +1 @@
1
- {"version":3,"file":"ld-default-contexts.js","sourceRoot":"","sources":["../src/ld-default-contexts.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACvC,CAAC,wCAAwC,EAAE,OAAO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C;IACzH,CAAC,iDAAiD,EAAE,OAAO,CAAC,yDAAyD,CAAC,CAAC;IACvH,CAAC,kDAAkD,EAAE,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAC1G,CAAC,8CAA8C,EAAE,OAAO,CAAC,4CAA4C,CAAC,CAAC;IACvG,wEAAwE;IACxE,4FAA4F;IAC5F,4EAA4E;IAC5E,CAAC,uCAAuC,EAAE,OAAO,CAAC,+CAA+C,CAAC,CAAC;IACnG,+EAA+E;IAC/E,CAAC,6GAA6G,EAAE,OAAO,CAAC,sDAAsD,CAAC,CAAC;IAChL,CAAC,6GAA6G,EAAE,OAAO,CAAC,oEAAoE,CAAC,CAAC;IAC9L,CAAC,4DAA4D,EAAE,OAAO,CAAC,oEAAoE,CAAC,CAAC;IAC7I,8GAA8G;IAC9G,6GAA6G;CAC9G,CAAC,CAAA"}
@@ -8,7 +8,7 @@ export declare class LdSuiteLoader {
8
8
  veramoLdSignatures: VeramoLdSignature[];
9
9
  });
10
10
  private signatureMap;
11
- getSignatureSuiteForKeyType(type: TKeyType): VeramoLdSignature;
11
+ getSignatureSuiteForKeyType(type: TKeyType, verificationType: string): VeramoLdSignature;
12
12
  getAllSignatureSuites(): VeramoLdSignature[];
13
13
  getAllSignatureSuiteTypes(): string[];
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ld-suite-loader.d.ts","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,qBAAa,aAAa;gBACZ,OAAO,EAAE;QAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAKhE,OAAO,CAAC,YAAY,CAAwC;IAE5D,2BAA2B,CAAC,IAAI,EAAE,QAAQ;IAO1C,qBAAqB;IAIrB,yBAAyB;CAG1B"}
1
+ {"version":3,"file":"ld-suite-loader.d.ts","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEvC;;GAEG;AACH,qBAAa,aAAa;gBACZ,OAAO,EAAE;QAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAOhE,OAAO,CAAC,YAAY,CAAwD;IAE5E,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM;IAOpE,qBAAqB,IAAI,iBAAiB,EAAE;IAI5C,yBAAyB;CAG1B"}
@@ -8,20 +8,23 @@ class LdSuiteLoader {
8
8
  constructor(options) {
9
9
  this.signatureMap = {};
10
10
  options.veramoLdSignatures.forEach((obj) => {
11
- this.signatureMap[obj.getSupportedVeramoKeyType()] = obj;
11
+ const keyType = obj.getSupportedVeramoKeyType();
12
+ const verificationType = obj.getSupportedVerificationType();
13
+ return this.signatureMap[keyType] = Object.assign(Object.assign({}, this.signatureMap[keyType]), { [verificationType]: obj });
12
14
  });
13
15
  }
14
- getSignatureSuiteForKeyType(type) {
15
- const suite = this.signatureMap[type];
16
+ getSignatureSuiteForKeyType(type, verificationType) {
17
+ var _a;
18
+ const suite = (_a = this.signatureMap[type]) === null || _a === void 0 ? void 0 : _a[verificationType];
16
19
  if (suite)
17
20
  return suite;
18
21
  throw new Error('No Veramo LD Signature Suite for ' + type);
19
22
  }
20
23
  getAllSignatureSuites() {
21
- return Object.values(this.signatureMap);
24
+ return Object.values(this.signatureMap).map((x) => Object.values(x)).flat();
22
25
  }
23
26
  getAllSignatureSuiteTypes() {
24
- return Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType());
27
+ return Object.values(this.signatureMap).map((x) => Object.keys(x)).flat();
25
28
  }
26
29
  }
27
30
  exports.LdSuiteLoader = LdSuiteLoader;
@@ -1 +1 @@
1
- {"version":3,"file":"ld-suite-loader.js","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAY,OAAoD;QAKxD,iBAAY,GAAsC,EAAE,CAAA;QAJ1D,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACzC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,yBAAyB,EAAE,CAAC,GAAG,GAAG,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;IAGD,2BAA2B,CAAC,IAAc;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACrC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAA;QAEvB,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACzC,CAAC;IAED,yBAAyB;QACvB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,4BAA4B,EAAE,CAAC,CAAA;IACtF,CAAC;CACF;AAtBD,sCAsBC"}
1
+ {"version":3,"file":"ld-suite-loader.js","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAY,OAAoD;QAOxD,iBAAY,GAAsD,EAAE,CAAA;QAN1E,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACzC,MAAM,OAAO,GAAG,GAAG,CAAC,yBAAyB,EAAE,CAAA;YAC/C,MAAM,gBAAgB,GAAG,GAAG,CAAC,4BAA4B,EAAE,CAAA;YAC3D,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,mCAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,GAAE,CAAA;QAChG,CAAC,CAAC,CAAA;IACJ,CAAC;IAGD,2BAA2B,CAAC,IAAc,EAAE,gBAAwB;;QAClE,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0CAAG,gBAAgB,CAAC,CAAA;QACzD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAA;QAEvB,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC7E,CAAC;IAED,yBAAyB;QACvB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC3E,CAAC;CACF;AAxBD,sCAwBC"}
@@ -1,6 +1,6 @@
1
1
  import { CredentialPayload, IAgentContext, IKey, IKeyManager, IResolver, PresentationPayload, TKeyType } from '@veramo/core';
2
2
  import { DIDDocument } from 'did-resolver';
3
- export declare type RequiredAgentMethods = IResolver & Pick<IKeyManager, 'keyManagerGet' | 'keyManagerSign'>;
3
+ export type RequiredAgentMethods = IResolver & Pick<IKeyManager, 'keyManagerGet' | 'keyManagerSign'>;
4
4
  /**
5
5
  * Base class for Veramo adapters of LinkedDataSignature suites.
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ld-suites.d.ts","sourceRoot":"","sources":["../src/ld-suites.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACj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IAAI,QAAQ;IAE9C,QAAQ,CAAC,kBAAkB,CACzB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC3C,GAAG;IAEN,QAAQ,CAAC,uBAAuB,IAAI,GAAG;IAEvC,QAAQ,CAAC,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAEhF,QAAQ,CAAC,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAExE,0BAA0B,CAAC,YAAY,EAAE,mBAAmB,GAAG,IAAI;CAQpE"}
@@ -0,0 +1,19 @@
1
+ import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites';
2
+ import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core';
3
+ /**
4
+ * Veramo wrapper for the Ed25519Signature2020 suite by digitalcredentials
5
+ *
6
+ * @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
7
+ */
8
+ export declare class VeramoEd25519Signature2020 extends VeramoLdSignature {
9
+ private readonly MULTIBASE_BASE58BTC_PREFIX;
10
+ private readonly MULTICODEC_PREFIX;
11
+ getSupportedVerificationType(): string;
12
+ getSupportedVeramoKeyType(): TKeyType;
13
+ getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IAgentContext<RequiredAgentMethods>): Promise<any>;
14
+ getSuiteForVerification(): any;
15
+ preSigningCredModification(credential: CredentialPayload): void;
16
+ preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void;
17
+ preSigningKeyModification(key: Uint8Array): string;
18
+ }
19
+ //# sourceMappingURL=Ed25519Signature2020.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ed25519Signature2020.d.ts","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5F;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC/D,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAM;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAe;IAEjD,4BAA4B,IAAI,MAAM;IAItC,yBAAyB,IAAI,QAAQ;IAIrC,kBAAkB,CAChB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC3C,OAAO,CAAC,GAAG,CAAC;IAkCf,uBAAuB,IAAI,GAAG;IAI9B,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAIvE,yBAAyB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM;CAInD"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.VeramoEd25519Signature2020 = void 0;
36
+ const ld_suites_1 = require("../ld-suites");
37
+ const u8a = __importStar(require("uint8arrays"));
38
+ const ed25519_signature_2020_1 = require("@digitalcredentials/ed25519-signature-2020");
39
+ const ed25519_verification_key_2020_1 = require("@digitalcredentials/ed25519-verification-key-2020");
40
+ /**
41
+ * Veramo wrapper for the Ed25519Signature2020 suite by digitalcredentials
42
+ *
43
+ * @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
44
+ */
45
+ class VeramoEd25519Signature2020 extends ld_suites_1.VeramoLdSignature {
46
+ constructor() {
47
+ super(...arguments);
48
+ this.MULTIBASE_BASE58BTC_PREFIX = 'z';
49
+ this.MULTICODEC_PREFIX = [0xed, 0x01];
50
+ }
51
+ getSupportedVerificationType() {
52
+ return 'Ed25519VerificationKey2020';
53
+ }
54
+ getSupportedVeramoKeyType() {
55
+ return 'Ed25519';
56
+ }
57
+ getSuiteForSigning(key, issuerDid, verificationMethodId, context) {
58
+ const controller = issuerDid;
59
+ // DID Key ID
60
+ let id = verificationMethodId;
61
+ const signer = {
62
+ // returns signatureBytes
63
+ sign: (args) => __awaiter(this, void 0, void 0, function* () {
64
+ const messageString = u8a.toString(args.data, 'base64');
65
+ const signature = yield context.agent.keyManagerSign({
66
+ keyRef: key.kid,
67
+ data: messageString,
68
+ encoding: 'base64',
69
+ });
70
+ return u8a.fromString(signature);
71
+ }),
72
+ };
73
+ const verificationKey = new ed25519_verification_key_2020_1.Ed25519VerificationKey2020({
74
+ id,
75
+ controller,
76
+ publicKeyMultibase: this.preSigningKeyModification(u8a.fromString(key.publicKeyHex, 'hex')),
77
+ signer: () => signer,
78
+ type: this.getSupportedVerificationType(),
79
+ });
80
+ // overwrite the signer since we're not passing the private key
81
+ verificationKey.signer = () => signer;
82
+ return new ed25519_signature_2020_1.Ed25519Signature2020({
83
+ key: verificationKey,
84
+ signer: signer,
85
+ });
86
+ }
87
+ getSuiteForVerification() {
88
+ return new ed25519_signature_2020_1.Ed25519Signature2020();
89
+ }
90
+ preSigningCredModification(credential) {
91
+ // nothing to do here
92
+ }
93
+ preDidResolutionModification(didUrl, didDoc) {
94
+ // nothing to do here
95
+ }
96
+ preSigningKeyModification(key) {
97
+ const modifiedKey = u8a.concat([this.MULTICODEC_PREFIX, key]);
98
+ return `${this.MULTIBASE_BASE58BTC_PREFIX}${u8a.toString(modifiedKey, 'base58btc')}`;
99
+ }
100
+ }
101
+ exports.VeramoEd25519Signature2020 = VeramoEd25519Signature2020;
102
+ //# sourceMappingURL=Ed25519Signature2020.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Ed25519Signature2020.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2020.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsE;AAEtE,iDAAkC;AAClC,uFAAiF;AACjF,qGAA8F;AAE9F;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BAAiB;IAAjE;;QACmB,+BAA0B,GAAG,GAAG,CAAA;QAChC,sBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAiEnD,CAAC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IAED,0BAA0B,CAAC,UAA6B;QACtD,qBAAqB;IACvB,CAAC;IAED,4BAA4B,CAAC,MAAc,EAAE,MAAmB;QAC9D,qBAAqB;IACvB,CAAC;IAED,yBAAyB,CAAC,GAAe;QACvC,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAA;QAC7D,OAAO,GAAG,IAAI,CAAC,0BAA0B,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAA;IACtF,CAAC;CACF;AAnED,gEAmEC"}
@@ -0,0 +1,16 @@
1
+ import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from "@veramo/core";
2
+ import { RequiredAgentMethods, VeramoLdSignature } from "../ld-suites";
3
+ /**
4
+ * Veramo wrapper for the JsonWebSignature2020 suite by Transmute Industries
5
+ *
6
+ * @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
7
+ */
8
+ export declare class VeramoJsonWebSignature2020 extends VeramoLdSignature {
9
+ getSupportedVerificationType(): 'JsonWebKey2020';
10
+ getSupportedVeramoKeyType(): TKeyType;
11
+ getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IAgentContext<RequiredAgentMethods>): Promise<any>;
12
+ getSuiteForVerification(): any;
13
+ preSigningCredModification(credential: CredentialPayload): void;
14
+ preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void;
15
+ }
16
+ //# sourceMappingURL=JsonWebSignature2020.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonWebSignature2020.d.ts","sourceRoot":"","sources":["../../src/suites/JsonWebSignature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMvE;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC7D,4BAA4B,IAAI,gBAAgB;IAIhD,yBAAyB,IAAI,QAAQ;IAI/B,kBAAkB,CACpB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC7C,OAAO,CAAC,GAAG,CAAC;IA+Cf,uBAAuB,IAAI,GAAG;IAI9B,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;CAG1E"}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.VeramoJsonWebSignature2020 = void 0;
36
+ const ld_suites_1 = require("../ld-suites");
37
+ const u8a = __importStar(require("uint8arrays"));
38
+ const json_web_signature_1 = require("@transmute/json-web-signature");
39
+ const utils_1 = require("@veramo/utils");
40
+ /**
41
+ * Veramo wrapper for the JsonWebSignature2020 suite by Transmute Industries
42
+ *
43
+ * @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
44
+ */
45
+ class VeramoJsonWebSignature2020 extends ld_suites_1.VeramoLdSignature {
46
+ getSupportedVerificationType() {
47
+ return 'JsonWebKey2020';
48
+ }
49
+ getSupportedVeramoKeyType() {
50
+ return 'Ed25519';
51
+ }
52
+ getSuiteForSigning(key, issuerDid, verificationMethodId, context) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const controller = issuerDid;
55
+ // DID Key ID
56
+ let id = verificationMethodId;
57
+ const signer = {
58
+ // returns a JWS detached
59
+ sign: (args) => __awaiter(this, void 0, void 0, function* () {
60
+ const header = {
61
+ alg: 'EdDSA',
62
+ b64: false,
63
+ crit: ['b64'],
64
+ };
65
+ const headerString = (0, utils_1.encodeJoseBlob)(header);
66
+ const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data]);
67
+ const messageString = u8a.toString(messageBuffer, 'base64');
68
+ const signature = yield context.agent.keyManagerSign({
69
+ keyRef: key.kid,
70
+ algorithm: 'EdDSA',
71
+ data: messageString,
72
+ encoding: 'base64',
73
+ });
74
+ return `${headerString}..${signature}`;
75
+ }),
76
+ };
77
+ const verificationKey = yield json_web_signature_1.JsonWebKey.from({
78
+ id: id,
79
+ type: this.getSupportedVerificationType(),
80
+ controller: controller,
81
+ publicKeyJwk: {
82
+ kty: 'OKP',
83
+ crv: 'Ed25519',
84
+ x: u8a.toString(u8a.fromString(key.publicKeyHex, 'hex'), 'base64url'),
85
+ },
86
+ });
87
+ verificationKey.signer = () => signer;
88
+ const suite = new json_web_signature_1.JsonWebSignature({
89
+ key: verificationKey,
90
+ });
91
+ return suite;
92
+ });
93
+ }
94
+ getSuiteForVerification() {
95
+ return new json_web_signature_1.JsonWebSignature();
96
+ }
97
+ preSigningCredModification(credential) {
98
+ credential['@context'] = [...credential['@context'] || [], 'https://w3id.org/security/suites/jws-2020/v1'];
99
+ }
100
+ preDidResolutionModification(didUrl, didDoc) {
101
+ // do nothing
102
+ }
103
+ }
104
+ exports.VeramoJsonWebSignature2020 = VeramoJsonWebSignature2020;
105
+ //# sourceMappingURL=JsonWebSignature2020.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonWebSignature2020.js","sourceRoot":"","sources":["../../src/suites/JsonWebSignature2020.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4CAAuE;AACvE,iDAAmC;AACnC,sEAA6E;AAC7E,yCAA+C;AAG/C;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BAAiB;IAC7D,4BAA4B;QACxB,OAAO,gBAAgB,CAAA;IAC3B,CAAC;IAED,yBAAyB;QACrB,OAAO,SAAS,CAAA;IACpB,CAAC;IAEK,kBAAkB,CACpB,GAAS,EACT,SAAiB,EACjB,oBAA4B,EAC5B,OAA4C;;YAE5C,MAAM,UAAU,GAAG,SAAS,CAAA;YAE5B,aAAa;YACb,IAAI,EAAE,GAAG,oBAAoB,CAAA;YAE7B,MAAM,MAAM,GAAG;gBACX,yBAAyB;gBACzB,IAAI,EAAE,CAAO,IAA0B,EAAmB,EAAE;oBACxD,MAAM,MAAM,GAAG;wBACX,GAAG,EAAE,OAAO;wBACZ,GAA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AAI,qCAAgB,EAAE,CAAA;IACjC,CAAC;IAED,0BAA0B,CAAC,UAA6B;QACpD,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,8CAA8C,CAAC,CAAA;IAC9G,CAAC;IAED,4BAA4B,CAAC,MAAc,EAAE,MAAmB;QAC5D,aAAa;IACjB,CAAC;CACJ;AAxED,gEAwEC"}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.25.0"
8
+ "packageVersion": "7.33.6"
9
9
  }
10
10
  ]
11
11
  }
package/build/types.d.ts CHANGED
@@ -208,13 +208,13 @@ export interface IVerifyPresentationLDArgs {
208
208
  *
209
209
  * @beta This API may change without a BREAKING CHANGE notice.
210
210
  */
211
- export declare type IRequiredContext = IAgentContext<IResolver & Pick<IDIDManager, 'didManagerGet'> & Pick<IKeyManager, 'keyManagerGet' | 'keyManagerSign'>>;
211
+ export type IRequiredContext = IAgentContext<IResolver & Pick<IDIDManager, 'didManagerGet'> & Pick<IKeyManager, 'keyManagerGet' | 'keyManagerSign'>>;
212
212
  /**
213
213
  * Describes a document with a `@context` property.
214
214
  *
215
215
  * @beta This API may change without a BREAKING CHANGE notice.
216
216
  */
217
- export declare type ContextDoc = {
217
+ export type ContextDoc = {
218
218
  '@context': Record<string, any>;
219
219
  };
220
220
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AAErB;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;;;;;;;;;;;OA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EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;OAEG;IACH,CAAC,CAAC,EAAC,MAAM,GAAG,GAAG,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAC1C,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,gBAAgB,CAAC,CACvG,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veramo/credential-ld",
3
3
  "description": "Veramo plugin for working with W3C JSON-LD Verifiable Credentials & Presentations.",
4
- "version": "4.1.3-next.9+33c7ceed",
4
+ "version": "4.2.1-next.1+24da47c4",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "scripts": {
@@ -14,15 +14,17 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
+ "@digitalcredentials/ed25519-signature-2020": "^3.0.2",
17
18
  "@digitalcredentials/jsonld": "^5.2.1",
18
19
  "@digitalcredentials/jsonld-signatures": "^9.3.1",
19
20
  "@digitalcredentials/vc": "^5.0.0",
20
21
  "@transmute/credentials-context": "^0.7.0-unstable.67",
21
22
  "@transmute/ed25519-signature-2018": "^0.7.0-unstable.67",
23
+ "@transmute/json-web-signature": "^0.7.0-unstable.67",
22
24
  "@veramo-community/lds-ecdsa-secp256k1-recovery2020": "uport-project/EcdsaSecp256k1RecoverySignature2020",
23
- "@veramo/core": "^4.1.3-next.9+33c7ceed",
24
- "@veramo/did-resolver": "^4.1.3-next.9+33c7ceed",
25
- "@veramo/utils": "^4.1.3-next.9+33c7ceed",
25
+ "@veramo/core": "^4.2.1-next.1+24da47c4",
26
+ "@veramo/did-resolver": "^4.2.1-next.1+24da47c4",
27
+ "@veramo/utils": "^4.2.1-next.1+24da47c4",
26
28
  "debug": "^4.3.3",
27
29
  "did-resolver": "^4.0.1",
28
30
  "uint8arrays": "^3.0.0"
@@ -34,7 +36,7 @@
34
36
  "devDependencies": {
35
37
  "@types/debug": "4.1.7",
36
38
  "borc": "3.0.0",
37
- "typescript": "4.8.4"
39
+ "typescript": "4.9.3"
38
40
  },
39
41
  "files": [
40
42
  "build/**/*",
@@ -51,5 +53,5 @@
51
53
  "author": "Mircea Nistor <mircea.nistor@mesh.xyz>",
52
54
  "license": "Apache-2.0",
53
55
  "keywords": [],
54
- "gitHead": "33c7ceed3b9850cfd6f5677aeeb89aeda2be72e5"
56
+ "gitHead": "24da47c4377b86df6dcf568ce9721066fae6787e"
55
57
  }
@@ -251,6 +251,7 @@ export class CredentialIssuerLD implements IAgentPlugin {
251
251
  signingKey = extendedKeys.find((k) => supportedTypes.includes(k.meta.verificationMethod.type))
252
252
  }
253
253
 
254
+
254
255
  if (!signingKey) throw Error(`key_not_found: No suitable signing key found for ${identifier.did}`)
255
256
  verificationMethodId = signingKey.meta.verificationMethod.id
256
257
  return { signingKey, verificationMethodId }
@@ -14,6 +14,10 @@
14
14
  "EcdsaSecp256k1VerificationKey2019": "sec:EcdsaSecp256k1VerificationKey2019",
15
15
  "Ed25519Signature2018": "sec:Ed25519Signature2018",
16
16
  "Ed25519VerificationKey2018": "sec:Ed25519VerificationKey2018",
17
+ "Ed25519Signature2020": "sec:Ed25519Signature2020",
18
+ "Ed25519VerificationKey2020": "sec:Ed25519VerificationKey2020",
19
+ "JsonWebSignature2020": "sec:JsonWebSignature2020",
20
+ "JsonWebKey2020": "sec:JsonWebKey2020",
17
21
  "RsaSignature2018": "sec:RsaSignature2018",
18
22
  "RsaVerificationKey2018": "sec:RsaVerificationKey2018",
19
23
  "SchnorrSecp256k1Signature2019": "sec:SchnorrSecp256k1Signature2019",
@@ -49,6 +53,8 @@
49
53
  "proofValue": "sec:proofValue",
50
54
  "publicKey": {"@id": "sec:publicKey", "@type": "@id", "@container": "@set"},
51
55
  "publicKeyBase58": "sec:publicKeyBase58",
56
+ "publicKeyMultibase": "sec:publicKeyMultibase",
57
+ "publicKeyJwk": "sec:publicKeyJwk",
52
58
  "publicKeyPem": "sec:publicKeyPem",
53
59
  "revoked": {"@id": "sec:revoked", "@type": "xsd:dateTime"},
54
60
  "service": {"@id": "didv:service", "@type": "@id", "@container": "@set"},
@@ -0,0 +1,77 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "proof": {
7
+ "@id": "https://w3id.org/security#proof",
8
+ "@type": "@id",
9
+ "@container": "@graph"
10
+ },
11
+ "Ed25519VerificationKey2020": {
12
+ "@id": "https://w3id.org/security#Ed25519VerificationKey2020"
13
+ },
14
+ "Ed25519Signature2020": {
15
+ "@id": "https://w3id.org/security#Ed25519Signature2020",
16
+ "@context": {
17
+ "@protected": true,
18
+ "id": "@id",
19
+ "type": "@type",
20
+ "challenge": "https://w3id.org/security#challenge",
21
+ "created": {
22
+ "@id": "http://purl.org/dc/terms/created",
23
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
24
+ },
25
+ "domain": "https://w3id.org/security#domain",
26
+ "expires": {
27
+ "@id": "https://w3id.org/security#expiration",
28
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
29
+ },
30
+ "nonce": "https://w3id.org/security#nonce",
31
+ "proofPurpose": {
32
+ "@id": "https://w3id.org/security#proofPurpose",
33
+ "@type": "@vocab",
34
+ "@context": {
35
+ "@version": 1.1,
36
+ "@protected": true,
37
+ "id": "@id",
38
+ "type": "@type",
39
+ "assertionMethod": {
40
+ "@id": "https://w3id.org/security#assertionMethod",
41
+ "@type": "@id",
42
+ "@container": "@set"
43
+ },
44
+ "authentication": {
45
+ "@id": "https://w3id.org/security#authenticationMethod",
46
+ "@type": "@id",
47
+ "@container": "@set"
48
+ },
49
+ "capabilityInvocation": {
50
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
51
+ "@type": "@id",
52
+ "@container": "@set"
53
+ },
54
+ "capabilityDelegation": {
55
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
56
+ "@type": "@id",
57
+ "@container": "@set"
58
+ },
59
+ "keyAgreement": {
60
+ "@id": "https://w3id.org/security#keyAgreementMethod",
61
+ "@type": "@id",
62
+ "@container": "@set"
63
+ }
64
+ }
65
+ },
66
+ "proofValue": {
67
+ "@id": "https://w3id.org/security#proofValue",
68
+ "@type": "https://w3id.org/security#multibase"
69
+ },
70
+ "verificationMethod": {
71
+ "@id": "https://w3id.org/security#verificationMethod",
72
+ "@type": "@id"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "id": "@id",
5
+ "type": "@type",
6
+ "@protected": true,
7
+ "JsonWebKey2020": {
8
+ "@id": "https://w3id.org/security#JsonWebKey2020"
9
+ },
10
+ "JsonWebSignature2020": {
11
+ "@id": "https://w3id.org/security#JsonWebSignature2020",
12
+ "@context": {
13
+ "@version": 1.1,
14
+ "id": "@id",
15
+ "type": "@type",
16
+ "@protected": true,
17
+ "challenge": "https://w3id.org/security#challenge",
18
+ "created": {
19
+ "@id": "http://purl.org/dc/terms/created",
20
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
21
+ },
22
+ "domain": "https://w3id.org/security#domain",
23
+ "expires": {
24
+ "@id": "https://w3id.org/security#expiration",
25
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
26
+ },
27
+ "jws": "https://w3id.org/security#jws",
28
+ "nonce": "https://w3id.org/security#nonce",
29
+ "proofPurpose": {
30
+ "@id": "https://w3id.org/security#proofPurpose",
31
+ "@type": "@vocab",
32
+ "@context": {
33
+ "@version": 1.1,
34
+ "@protected": true,
35
+ "id": "@id",
36
+ "type": "@type",
37
+ "assertionMethod": {
38
+ "@id": "https://w3id.org/security#assertionMethod",
39
+ "@type": "@id",
40
+ "@container": "@set"
41
+ },
42
+ "authentication": {
43
+ "@id": "https://w3id.org/security#authenticationMethod",
44
+ "@type": "@id",
45
+ "@container": "@set"
46
+ },
47
+ "capabilityInvocation": {
48
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
49
+ "@type": "@id",
50
+ "@container": "@set"
51
+ },
52
+ "capabilityDelegation": {
53
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
54
+ "@type": "@id",
55
+ "@container": "@set"
56
+ },
57
+ "keyAgreement": {
58
+ "@id": "https://w3id.org/security#keyAgreementMethod",
59
+ "@type": "@id",
60
+ "@container": "@set"
61
+ }
62
+ }
63
+ },
64
+ "verificationMethod": {
65
+ "@id": "https://w3id.org/security#verificationMethod",
66
+ "@type": "@id"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
package/src/index.ts CHANGED
@@ -16,6 +16,8 @@ export { LdDefaultContexts } from './ld-default-contexts'
16
16
  export { VeramoLdSignature } from './ld-suites'
17
17
  export * from './suites/EcdsaSecp256k1RecoverySignature2020'
18
18
  export * from './suites/Ed25519Signature2018'
19
+ export * from './suites/Ed25519Signature2020'
20
+ export * from './suites/JsonWebSignature2020'
19
21
 
20
22
  /**
21
23
  * The parameter and return types schemas for the {@link @veramo/credential-ld#CredentialIssuerLD | CredentialIssuerLD}
@@ -101,7 +101,7 @@ export class LdCredentialModule {
101
101
  options: any,
102
102
  context: IAgentContext<RequiredAgentMethods>,
103
103
  ): Promise<VerifiableCredential> {
104
- const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type)
104
+ const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, key.meta?.verificationMethod?.type ?? '')
105
105
  const documentLoader = this.getDocumentLoader(context, options.fetchRemoteContexts)
106
106
 
107
107
  // some suites can modify the incoming credential (e.g. add required contexts)
@@ -110,7 +110,7 @@ export class LdCredentialModule {
110
110
  return await vc.issue({
111
111
  ...options,
112
112
  credential,
113
- suite: suite.getSuiteForSigning(key, issuerDid, verificationMethodId, context),
113
+ suite: await suite.getSuiteForSigning(key, issuerDid, verificationMethodId, context),
114
114
  documentLoader,
115
115
  compactProof: false,
116
116
  })
@@ -126,7 +126,7 @@ export class LdCredentialModule {
126
126
  options: any,
127
127
  context: IAgentContext<RequiredAgentMethods>,
128
128
  ): Promise<VerifiablePresentation> {
129
- const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type)
129
+ const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, key.meta?.verificationMethod?.type ?? '')
130
130
  const documentLoader = this.getDocumentLoader(context, options.fetchRemoteContexts)
131
131
 
132
132
  suite.preSigningPresModification(presentation)
@@ -134,7 +134,7 @@ export class LdCredentialModule {
134
134
  return await vc.signPresentation({
135
135
  ...options,
136
136
  presentation,
137
- suite: suite.getSuiteForSigning(key, holderDid, verificationMethodId, context),
137
+ suite: await suite.getSuiteForSigning(key, holderDid, verificationMethodId, context),
138
138
  challenge,
139
139
  domain,
140
140
  documentLoader,
@@ -16,6 +16,8 @@ export const LdDefaultContexts = new Map([
16
16
  ['https://w3id.org/security/v3-unstable', require('./contexts/w3id.org_security_v3-unstable.json')],
17
17
  ['https://w3id.org/security/suites/ed25519-2018/v1', require('./contexts/w3id.org_security_suites_ed25519-2018_v1.json')],
18
18
  ['https://w3id.org/security/suites/x25519-2019/v1', require('./contexts/w3id.org_security_suites_x25519-2019_v1.json')],
19
+ ['https://w3id.org/security/suites/ed25519-2020/v1', require('./contexts/ed25519-signature-2020-v1.json')],
20
+ ['https://w3id.org/security/suites/jws-2020/v1', require('./contexts/json-web-signature-2020-v1.json')],
19
21
  // ['https://w3id.org/did/v0.11', require('./contexts/did_v0.11.json')],
20
22
  // ['https://veramo.io/contexts/socialmedia/v1', require('./contexts/socialmedia-v1.json')],
21
23
  // ['https://veramo.io/contexts/kyc/v1', require('./contexts/kyc-v1.json')],
@@ -7,23 +7,25 @@ import { TKeyType } from '@veramo/core'
7
7
  export class LdSuiteLoader {
8
8
  constructor(options: { veramoLdSignatures: VeramoLdSignature[] }) {
9
9
  options.veramoLdSignatures.forEach((obj) => {
10
- this.signatureMap[obj.getSupportedVeramoKeyType()] = obj
10
+ const keyType = obj.getSupportedVeramoKeyType()
11
+ const verificationType = obj.getSupportedVerificationType()
12
+ return this.signatureMap[keyType] = { ...this.signatureMap[keyType], [verificationType]: obj }
11
13
  })
12
14
  }
13
- private signatureMap: Record<string, VeramoLdSignature> = {}
15
+ private signatureMap: Record<string, Record<string, VeramoLdSignature>> = {}
14
16
 
15
- getSignatureSuiteForKeyType(type: TKeyType) {
16
- const suite = this.signatureMap[type]
17
+ getSignatureSuiteForKeyType(type: TKeyType, verificationType: string) {
18
+ const suite = this.signatureMap[type]?.[verificationType]
17
19
  if (suite) return suite
18
20
 
19
21
  throw new Error('No Veramo LD Signature Suite for ' + type)
20
22
  }
21
23
 
22
- getAllSignatureSuites() {
23
- return Object.values(this.signatureMap)
24
+ getAllSignatureSuites(): VeramoLdSignature[] {
25
+ return Object.values(this.signatureMap).map((x) => Object.values(x)).flat()
24
26
  }
25
27
 
26
28
  getAllSignatureSuiteTypes() {
27
- return Object.values(this.signatureMap).map((x) => x.getSupportedVerificationType())
29
+ return Object.values(this.signatureMap).map((x) => Object.keys(x)).flat()
28
30
  }
29
31
  }
@@ -1,6 +1,8 @@
1
1
  declare module '@digitalcredentials/jsonld'
2
2
  declare module '@digitalcredentials/jsonld-signatures'
3
3
  declare module '@digitalcredentials/vc'
4
+ declare module '@digitalcredentials/ed25519-signature-2020'
5
+ declare module '@digitalcredentials/ed25519-verification-key-2020'
4
6
  declare module '@veramo-community/lds-ecdsa-secp256k1-recovery2020'
5
7
 
6
8
  declare module "*.json" {
@@ -0,0 +1,79 @@
1
+ import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites'
2
+ import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core'
3
+ import * as u8a from 'uint8arrays'
4
+ import { Ed25519Signature2020 } from '@digitalcredentials/ed25519-signature-2020'
5
+ import { Ed25519VerificationKey2020 } from '@digitalcredentials/ed25519-verification-key-2020'
6
+
7
+ /**
8
+ * Veramo wrapper for the Ed25519Signature2020 suite by digitalcredentials
9
+ *
10
+ * @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
11
+ */
12
+ export class VeramoEd25519Signature2020 extends VeramoLdSignature {
13
+ private readonly MULTIBASE_BASE58BTC_PREFIX = 'z'
14
+ private readonly MULTICODEC_PREFIX = [0xed, 0x01]
15
+
16
+ getSupportedVerificationType(): string {
17
+ return 'Ed25519VerificationKey2020'
18
+ }
19
+
20
+ getSupportedVeramoKeyType(): TKeyType {
21
+ return 'Ed25519'
22
+ }
23
+
24
+ getSuiteForSigning(
25
+ key: IKey,
26
+ issuerDid: string,
27
+ verificationMethodId: string,
28
+ context: IAgentContext<RequiredAgentMethods>,
29
+ ): Promise<any> {
30
+ const controller = issuerDid
31
+
32
+ // DID Key ID
33
+ let id = verificationMethodId
34
+
35
+ const signer = {
36
+ // returns signatureBytes
37
+ sign: async (args: { data: Uint8Array }): Promise<Uint8Array> => {
38
+ const messageString = u8a.toString(args.data, 'base64')
39
+ const signature = await context.agent.keyManagerSign({
40
+ keyRef: key.kid,
41
+ data: messageString,
42
+ encoding: 'base64',
43
+ })
44
+ return u8a.fromString(signature)
45
+ },
46
+ }
47
+
48
+ const verificationKey = new Ed25519VerificationKey2020({
49
+ id,
50
+ controller,
51
+ publicKeyMultibase: this.preSigningKeyModification(u8a.fromString(key.publicKeyHex, 'hex')),
52
+ signer: () => signer,
53
+ type: this.getSupportedVerificationType(),
54
+ })
55
+ // overwrite the signer since we're not passing the private key
56
+ verificationKey.signer = () => signer as any
57
+ return new Ed25519Signature2020({
58
+ key: verificationKey,
59
+ signer: signer,
60
+ })
61
+ }
62
+
63
+ getSuiteForVerification(): any {
64
+ return new Ed25519Signature2020()
65
+ }
66
+
67
+ preSigningCredModification(credential: CredentialPayload): void {
68
+ // nothing to do here
69
+ }
70
+
71
+ preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void {
72
+ // nothing to do here
73
+ }
74
+
75
+ preSigningKeyModification(key: Uint8Array): string {
76
+ const modifiedKey = u8a.concat([this.MULTICODEC_PREFIX, key])
77
+ return `${this.MULTIBASE_BASE58BTC_PREFIX}${u8a.toString(modifiedKey, 'base58btc')}`
78
+ }
79
+ }
@@ -0,0 +1,85 @@
1
+ import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from "@veramo/core";
2
+ import { RequiredAgentMethods, VeramoLdSignature } from "../ld-suites";
3
+ import * as u8a from "uint8arrays";
4
+ import { JsonWebKey, JsonWebSignature } from "@transmute/json-web-signature";
5
+ import { encodeJoseBlob } from "@veramo/utils";
6
+
7
+
8
+ /**
9
+ * Veramo wrapper for the JsonWebSignature2020 suite by Transmute Industries
10
+ *
11
+ * @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
12
+ */
13
+ export class VeramoJsonWebSignature2020 extends VeramoLdSignature {
14
+ getSupportedVerificationType(): 'JsonWebKey2020' {
15
+ return 'JsonWebKey2020'
16
+ }
17
+
18
+ getSupportedVeramoKeyType(): TKeyType {
19
+ return 'Ed25519'
20
+ }
21
+
22
+ async getSuiteForSigning(
23
+ key: IKey,
24
+ issuerDid: string,
25
+ verificationMethodId: string,
26
+ context: IAgentContext<RequiredAgentMethods>,
27
+ ): Promise<any> {
28
+ const controller = issuerDid
29
+
30
+ // DID Key ID
31
+ let id = verificationMethodId
32
+
33
+ const signer = {
34
+ // returns a JWS detached
35
+ sign: async (args: { data: Uint8Array }): Promise<string> => {
36
+ const header = {
37
+ alg: 'EdDSA',
38
+ b64: false,
39
+ crit: ['b64'],
40
+ }
41
+ const headerString = encodeJoseBlob(header)
42
+ const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data])
43
+ const messageString = u8a.toString(messageBuffer, 'base64')
44
+ const signature = await context.agent.keyManagerSign({
45
+ keyRef: key.kid,
46
+ algorithm: 'EdDSA',
47
+ data: messageString,
48
+ encoding: 'base64',
49
+ })
50
+ return `${headerString}..${signature}`
51
+ },
52
+ }
53
+
54
+ const verificationKey = await JsonWebKey.from({
55
+ id: id,
56
+ type: this.getSupportedVerificationType(),
57
+ controller: controller,
58
+ publicKeyJwk: {
59
+ kty: 'OKP',
60
+ crv: 'Ed25519',
61
+ x: u8a.toString(u8a.fromString(key.publicKeyHex, 'hex'), 'base64url'),
62
+ },
63
+ })
64
+
65
+ verificationKey.signer = () => signer
66
+
67
+ const suite = new JsonWebSignature({
68
+ key: verificationKey,
69
+ })
70
+
71
+ return suite
72
+ }
73
+
74
+ getSuiteForVerification(): any {
75
+ return new JsonWebSignature()
76
+ }
77
+
78
+ preSigningCredModification(credential: CredentialPayload): void {
79
+ credential['@context'] = [...credential['@context'] || [], 'https://w3id.org/security/suites/jws-2020/v1']
80
+ }
81
+
82
+ preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void {
83
+ // do nothing
84
+ }
85
+ }