@veramo/credential-ld 3.1.5-next.119 → 3.1.5-next.122

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 (30) hide show
  1. package/build/contexts/did_v0.11.json +55 -0
  2. package/build/contexts/ed25519-signature-2018-v1.json +91 -0
  3. package/build/contexts/kyc-v1.json +8 -0
  4. package/build/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json +21 -0
  5. package/build/contexts/socialmedia-v1.json +7 -0
  6. package/build/contexts/transmute_v1.json +20 -0
  7. package/build/contexts/veramo.io_contexts_profile_v1.json +8 -0
  8. package/build/contexts/w3id.org_security_suites_ed25519-2018_v1.json +58 -0
  9. package/build/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json +87 -0
  10. package/build/contexts/w3id.org_security_suites_x25519-2019_v1.json +26 -0
  11. package/build/contexts/w3id.org_security_v1.json +47 -0
  12. package/build/contexts/w3id.org_security_v2.json +58 -0
  13. package/build/contexts/w3id.org_security_v3-unstable.json +710 -0
  14. package/build/contexts/www.w3.org_2018_credentials_v1.json +195 -0
  15. package/build/contexts/www.w3.org_ns_did_v1.json +57 -0
  16. package/build/ld-credential-module.d.ts.map +1 -1
  17. package/build/ld-credential-module.js +5 -9
  18. package/build/ld-credential-module.js.map +1 -1
  19. package/build/ld-suites.js +1 -1
  20. package/build/ld-suites.js.map +1 -1
  21. package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts +2 -2
  22. package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts.map +1 -1
  23. package/build/suites/EcdsaSecp256k1RecoverySignature2020.js +9 -13
  24. package/build/suites/EcdsaSecp256k1RecoverySignature2020.js.map +1 -1
  25. package/package.json +12 -12
  26. package/src/__tests__/issue-verify-flow.test.ts +3 -1
  27. package/src/ld-credential-module.ts +5 -10
  28. package/src/ld-suites.ts +1 -1
  29. package/src/module-types/jsonld/index.d.ts +9 -0
  30. package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +12 -15
@@ -0,0 +1,195 @@
1
+ {
2
+ "@context": {
3
+ "@version": 1.1,
4
+ "@protected": true,
5
+ "id": "@id",
6
+ "type": "@type",
7
+ "VerifiableCredential": {
8
+ "@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
9
+ "@context": {
10
+ "@version": 1.1,
11
+ "@protected": true,
12
+ "id": "@id",
13
+ "type": "@type",
14
+ "cred": "https://www.w3.org/2018/credentials#",
15
+ "sec": "https://w3id.org/security#",
16
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
17
+ "credentialSchema": {
18
+ "@id": "cred:credentialSchema",
19
+ "@type": "@id",
20
+ "@context": {
21
+ "@version": 1.1,
22
+ "@protected": true,
23
+ "id": "@id",
24
+ "type": "@type",
25
+ "cred": "https://www.w3.org/2018/credentials#",
26
+ "JsonSchemaValidator2018": "cred:JsonSchemaValidator2018"
27
+ }
28
+ },
29
+ "credentialStatus": { "@id": "cred:credentialStatus", "@type": "@id" },
30
+ "credentialSubject": { "@id": "cred:credentialSubject", "@type": "@id" },
31
+ "evidence": { "@id": "cred:evidence", "@type": "@id" },
32
+ "expirationDate": { "@id": "cred:expirationDate", "@type": "xsd:dateTime" },
33
+ "holder": { "@id": "cred:holder", "@type": "@id" },
34
+ "issued": { "@id": "cred:issued", "@type": "xsd:dateTime" },
35
+ "issuer": { "@id": "cred:issuer", "@type": "@id" },
36
+ "issuanceDate": { "@id": "cred:issuanceDate", "@type": "xsd:dateTime" },
37
+ "proof": { "@id": "sec:proof", "@type": "@id", "@container": "@graph" },
38
+ "refreshService": {
39
+ "@id": "cred:refreshService",
40
+ "@type": "@id",
41
+ "@context": {
42
+ "@version": 1.1,
43
+ "@protected": true,
44
+ "id": "@id",
45
+ "type": "@type",
46
+ "cred": "https://www.w3.org/2018/credentials#",
47
+ "ManualRefreshService2018": "cred:ManualRefreshService2018"
48
+ }
49
+ },
50
+ "termsOfUse": { "@id": "cred:termsOfUse", "@type": "@id" },
51
+ "validFrom": { "@id": "cred:validFrom", "@type": "xsd:dateTime" },
52
+ "validUntil": { "@id": "cred:validUntil", "@type": "xsd:dateTime" }
53
+ }
54
+ },
55
+ "VerifiablePresentation": {
56
+ "@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
57
+ "@context": {
58
+ "@version": 1.1,
59
+ "@protected": true,
60
+ "id": "@id",
61
+ "type": "@type",
62
+ "cred": "https://www.w3.org/2018/credentials#",
63
+ "sec": "https://w3id.org/security#",
64
+ "holder": { "@id": "cred:holder", "@type": "@id" },
65
+ "proof": { "@id": "sec:proof", "@type": "@id", "@container": "@graph" },
66
+ "verifiableCredential": { "@id": "cred:verifiableCredential", "@type": "@id", "@container": "@graph" }
67
+ }
68
+ },
69
+ "EcdsaSecp256k1Signature2019": {
70
+ "@id": "https://w3id.org/security#EcdsaSecp256k1Signature2019",
71
+ "@context": {
72
+ "@version": 1.1,
73
+ "@protected": true,
74
+ "id": "@id",
75
+ "type": "@type",
76
+ "sec": "https://w3id.org/security#",
77
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
78
+ "challenge": "sec:challenge",
79
+ "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
80
+ "domain": "sec:domain",
81
+ "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" },
82
+ "jws": "sec:jws",
83
+ "nonce": "sec:nonce",
84
+ "proofPurpose": {
85
+ "@id": "sec:proofPurpose",
86
+ "@type": "@vocab",
87
+ "@context": {
88
+ "@version": 1.1,
89
+ "@protected": true,
90
+ "id": "@id",
91
+ "type": "@type",
92
+ "sec": "https://w3id.org/security#",
93
+ "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
94
+ "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
95
+ }
96
+ },
97
+ "proofValue": "sec:proofValue",
98
+ "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" }
99
+ }
100
+ },
101
+ "EcdsaSecp256r1Signature2019": {
102
+ "@id": "https://w3id.org/security#EcdsaSecp256r1Signature2019",
103
+ "@context": {
104
+ "@version": 1.1,
105
+ "@protected": true,
106
+ "id": "@id",
107
+ "type": "@type",
108
+ "sec": "https://w3id.org/security#",
109
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
110
+ "challenge": "sec:challenge",
111
+ "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
112
+ "domain": "sec:domain",
113
+ "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" },
114
+ "jws": "sec:jws",
115
+ "nonce": "sec:nonce",
116
+ "proofPurpose": {
117
+ "@id": "sec:proofPurpose",
118
+ "@type": "@vocab",
119
+ "@context": {
120
+ "@version": 1.1,
121
+ "@protected": true,
122
+ "id": "@id",
123
+ "type": "@type",
124
+ "sec": "https://w3id.org/security#",
125
+ "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
126
+ "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
127
+ }
128
+ },
129
+ "proofValue": "sec:proofValue",
130
+ "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" }
131
+ }
132
+ },
133
+ "Ed25519Signature2018": {
134
+ "@id": "https://w3id.org/security#Ed25519Signature2018",
135
+ "@context": {
136
+ "@version": 1.1,
137
+ "@protected": true,
138
+ "id": "@id",
139
+ "type": "@type",
140
+ "sec": "https://w3id.org/security#",
141
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
142
+ "challenge": "sec:challenge",
143
+ "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
144
+ "domain": "sec:domain",
145
+ "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" },
146
+ "jws": "sec:jws",
147
+ "nonce": "sec:nonce",
148
+ "proofPurpose": {
149
+ "@id": "sec:proofPurpose",
150
+ "@type": "@vocab",
151
+ "@context": {
152
+ "@version": 1.1,
153
+ "@protected": true,
154
+ "id": "@id",
155
+ "type": "@type",
156
+ "sec": "https://w3id.org/security#",
157
+ "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
158
+ "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
159
+ }
160
+ },
161
+ "proofValue": "sec:proofValue",
162
+ "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" }
163
+ }
164
+ },
165
+ "RsaSignature2018": {
166
+ "@id": "https://w3id.org/security#RsaSignature2018",
167
+ "@context": {
168
+ "@version": 1.1,
169
+ "@protected": true,
170
+ "challenge": "sec:challenge",
171
+ "created": { "@id": "http://purl.org/dc/terms/created", "@type": "xsd:dateTime" },
172
+ "domain": "sec:domain",
173
+ "expires": { "@id": "sec:expiration", "@type": "xsd:dateTime" },
174
+ "jws": "sec:jws",
175
+ "nonce": "sec:nonce",
176
+ "proofPurpose": {
177
+ "@id": "sec:proofPurpose",
178
+ "@type": "@vocab",
179
+ "@context": {
180
+ "@version": 1.1,
181
+ "@protected": true,
182
+ "id": "@id",
183
+ "type": "@type",
184
+ "sec": "https://w3id.org/security#",
185
+ "assertionMethod": { "@id": "sec:assertionMethod", "@type": "@id", "@container": "@set" },
186
+ "authentication": { "@id": "sec:authenticationMethod", "@type": "@id", "@container": "@set" }
187
+ }
188
+ },
189
+ "proofValue": "sec:proofValue",
190
+ "verificationMethod": { "@id": "sec:verificationMethod", "@type": "@id" }
191
+ }
192
+ },
193
+ "proof": { "@id": "https://w3id.org/security#proof", "@type": "@id", "@container": "@graph" }
194
+ }
195
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "@context": {
3
+ "@protected": true,
4
+ "id": "@id",
5
+ "type": "@type",
6
+ "alsoKnownAs": {
7
+ "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
8
+ "@type": "@id"
9
+ },
10
+ "assertionMethod": {
11
+ "@id": "https://w3id.org/security#assertionMethod",
12
+ "@type": "@id",
13
+ "@container": "@set"
14
+ },
15
+ "authentication": {
16
+ "@id": "https://w3id.org/security#authenticationMethod",
17
+ "@type": "@id",
18
+ "@container": "@set"
19
+ },
20
+ "capabilityDelegation": {
21
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
22
+ "@type": "@id",
23
+ "@container": "@set"
24
+ },
25
+ "capabilityInvocation": {
26
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
27
+ "@type": "@id",
28
+ "@container": "@set"
29
+ },
30
+ "controller": {
31
+ "@id": "https://w3id.org/security#controller",
32
+ "@type": "@id"
33
+ },
34
+ "keyAgreement": {
35
+ "@id": "https://w3id.org/security#keyAgreementMethod",
36
+ "@type": "@id",
37
+ "@container": "@set"
38
+ },
39
+ "service": {
40
+ "@id": "https://www.w3.org/ns/did#service",
41
+ "@type": "@id",
42
+ "@context": {
43
+ "@protected": true,
44
+ "id": "@id",
45
+ "type": "@type",
46
+ "serviceEndpoint": {
47
+ "@id": "https://www.w3.org/ns/did#serviceEndpoint",
48
+ "@type": "@id"
49
+ }
50
+ }
51
+ },
52
+ "verificationMethod": {
53
+ "@id": "https://w3id.org/security#verificationMethod",
54
+ "@type": "@id"
55
+ }
56
+ }
57
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"ld-credential-module.d.ts","sourceRoot":"","sources":["../src/ld-credential-module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,IAAI,EACJ,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AAKrB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAMlD,qBAAa,kBAAkB;IAC7B;;;;;;OAMG;IAEH,OAAO,CAAC,eAAe,CAAiB;IACxC,aAAa,EAAE,aAAa,CAAA;gBAChB,OAAO,EAAE;QAAE,eAAe,EAAE,eAAe,CAAC;QAAC,aAAa,EAAE,aAAa,C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39
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
40
40
  const debug_1 = __importDefault(require("debug"));
41
- const jsonld_signatures_1 = require("jsonld-signatures");
42
- const vc = __importStar(require("@digitalbazaar/vc"));
43
- const AssertionProofPurpose = jsonld_signatures_1.purposes.AssertionProofPurpose;
41
+ const jsonld_signatures_1 = require("@digitalcredentials/jsonld-signatures");
42
+ const vc = __importStar(require("@digitalcredentials/vc"));
44
43
  const debug = (0, debug_1.default)('veramo:w3c:ld-credential-module');
45
44
  class LdCredentialModule {
46
45
  constructor(options) {
@@ -56,8 +55,8 @@ class LdCredentialModule {
56
55
  const didDoc = resolutionResult.didDocument;
57
56
  if (!didDoc)
58
57
  return;
59
- // currently Veramo LD suites can modify the resolution response for DIDs from
60
- // the document Loader. This allows to fix incompatibilities between DID Documents
58
+ // currently, Veramo LD suites can modify the resolution response for DIDs from
59
+ // the document Loader. This allows us to fix incompatibilities between DID Documents
61
60
  // and LD suites to be fixed specifically within the Veramo LD Suites definition
62
61
  this.ldSuiteLoader.getAllSignatureSuites().forEach((x) => x.preDidResolutionModification(url, didDoc));
63
62
  // console.log(`Returning from Documentloader: ${JSON.stringify(returnDocument)}`)
@@ -103,7 +102,7 @@ class LdCredentialModule {
103
102
  return __awaiter(this, void 0, void 0, function* () {
104
103
  const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type);
105
104
  const documentLoader = this.getDocumentLoader(context);
106
- // some suites can modify the incoming credential (e.g. add required contexts)W
105
+ // some suites can modify the incoming credential (e.g. add required contexts)
107
106
  suite.preSigningCredModification(credential);
108
107
  return yield vc.issue({
109
108
  credential,
@@ -124,7 +123,6 @@ class LdCredentialModule {
124
123
  challenge,
125
124
  domain,
126
125
  documentLoader,
127
- purpose: new AssertionProofPurpose(),
128
126
  compactProof: false,
129
127
  });
130
128
  });
@@ -143,7 +141,6 @@ class LdCredentialModule {
143
141
  credential,
144
142
  suite: this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification()),
145
143
  documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
146
- purpose: new AssertionProofPurpose(),
147
144
  compactProof: false,
148
145
  checkStatus: checkStatusFn,
149
146
  });
@@ -164,7 +161,6 @@ class LdCredentialModule {
164
161
  documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
165
162
  challenge,
166
163
  domain,
167
- purpose: new AssertionProofPurpose(),
168
164
  compactProof: false,
169
165
  });
170
166
  if (result.verified)
@@ -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,yDAAiE;AACjE,sDAAuC;AAKvC,MAAM,qBAAqB,GAAG,4BAAQ,CAAC,qBAAqB,CAAA;AAE5D,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,iCAAiC,CAAC,CAAA;AAEtD,MAAa,kBAAkB;IAW7B,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;gBACxC,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAA;gBACxE,MAAM,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAA;gBAE3C,IAAI,CAAC,MAAM;oBAAE,OAAM;gBAEnB,8EAA8E;gBAC9E,kFAAkF;gBAClF,gFAAgF;gBAChF,IAAI,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C,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,uBAAuB,EAAE,CAAC;gBACzF,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,CAAC;gBACpE,SAAS;gBACT,MAAM;gBACN,YAAY,EAAE,KAAK;aACpB,CAAC,CAAA;YAEF,IAAI,MAAM,CAAC,QAAQ;gBAAE,OAAO,IAAI,CAAA;YAEhC,gBAAgB;YAEhB,+BAA+B;YAC/B,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAA;YACzD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;YAC5C,MAAM,KAAK,CAAC,4CAA4C,CAAC,CAAA;QAC3D,CAAC;KAAA;CACF;AAlLD,gDAkLC"}
@@ -7,7 +7,7 @@ class VeramoLdSignature {
7
7
  // TODO: Remove invalid field 'verifiers' from Presentation. Needs to be adapted for LD credentials
8
8
  // Only remove empty array (vc.signPresentation will throw then)
9
9
  const sanitizedPresentation = presentation;
10
- if (((_a = sanitizedPresentation.verifier) === null || _a === void 0 ? void 0 : _a.length) == 0) {
10
+ if (((_a = sanitizedPresentation === null || sanitizedPresentation === void 0 ? void 0 : sanitizedPresentation.verifier) === null || _a === void 0 ? void 0 : _a.length) == 0) {
11
11
  delete sanitizedPresentation.verifier;
12
12
  }
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ld-suites.js","sourceRoot":"","sources":["../src/ld-suites.ts"],"names":[],"mappings":";;;AAaA,MAAsB,iBAAiB;IAuBrC,0BAA0B,CAAC,YAAiC;;QAC1D,mGAAmG;QACnG,gEAAgE;QAChE,MAAM,qBAAqB,GAAG,YAAmB,CAAA;QACjD,IAAI,CAAA,MAAA,qBAAqB,CAAC,QAAQ,0CAAE,MAAM,KAAI,CAAC,EAAE;YAC/C,OAAO,qBAAqB,CAAC,QAAQ,CAAA;SACtC;IACH,CAAC;CACF;AA/BD,8CA+BC"}
1
+ {"version":3,"file":"ld-suites.js","sourceRoot":"","sources":["../src/ld-suites.ts"],"names":[],"mappings":";;;AAaA,MAAsB,iBAAiB;IAuBrC,0BAA0B,CAAC,YAAiC;;QAC1D,mGAAmG;QACnG,gEAAgE;QAChE,MAAM,qBAAqB,GAAG,YAAmB,CAAA;QACjD,IAAI,CAAA,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,QAAQ,0CAAE,MAAM,KAAI,CAAC,EAAE;YAChD,OAAO,qBAAqB,CAAC,QAAQ,CAAA;SACtC;IACH,CAAC;CACF;AA/BD,8CA+BC"}
@@ -1,12 +1,12 @@
1
1
  import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites';
2
- import { CredentialPayload, DIDDocument, IAgentContext, IKey, PresentationPayload, TKeyType } from '@veramo/core';
2
+ import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core';
3
3
  export declare class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature {
4
4
  getSupportedVerificationType(): string;
5
5
  getSupportedVeramoKeyType(): TKeyType;
6
6
  getSuiteForSigning(key: IKey, did: string, verifiableMethodId: string, context: IAgentContext<RequiredAgentMethods>): any;
7
7
  getSuiteForVerification(): any;
8
8
  preSigningCredModification(credential: CredentialPayload): void;
9
- preSigningPresModification(presentation: PresentationPayload): void;
10
9
  preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void;
10
+ getContext(): string;
11
11
  }
12
12
  //# sourceMappingURL=EcdsaSecp256k1RecoverySignature2020.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.d.ts","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE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IAAI;IAmBvE,UAAU,IAAI,MAAM;CAGrB"}
@@ -66,7 +66,7 @@ class VeramoEcdsaSecp256k1RecoverySignature2020 extends ld_suites_1.VeramoLdSign
66
66
  return `${headerString}..${signature}`;
67
67
  }),
68
68
  };
69
- return new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoverySignature2020({
69
+ const suite = new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoverySignature2020({
70
70
  // signer,
71
71
  key: new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoveryMethod2020({
72
72
  publicKeyHex: key.publicKeyHex,
@@ -76,29 +76,22 @@ class VeramoEcdsaSecp256k1RecoverySignature2020 extends ld_suites_1.VeramoLdSign
76
76
  id: verifiableMethodId,
77
77
  }),
78
78
  });
79
+ suite.ensureSuiteContext = ({ document }) => {
80
+ document['@context'] = [...(0, utils_1.asArray)(document['@context'] || []), this.getContext()];
81
+ };
82
+ return suite;
79
83
  }
80
84
  getSuiteForVerification() {
81
85
  return new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoverySignature2020();
82
86
  }
83
87
  preSigningCredModification(credential) {
84
- credential['@context'] = [
85
- ...(0, utils_1.asArray)(credential['@context'] || []),
86
- 'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
87
- ];
88
- }
89
- preSigningPresModification(presentation) {
90
- super.preSigningPresModification(presentation);
91
- presentation['@context'] = [
92
- ...(0, utils_1.asArray)(presentation['@context'] || []),
93
- 'https://w3id.org/security/suites/secp256k1recovery-2020/v2',
94
- ];
95
88
  }
96
89
  preDidResolutionModification(didUrl, didDoc) {
97
90
  var _a, _b;
98
91
  // did:ethr
99
92
  const idx = ((_a = didDoc['@context']) === null || _a === void 0 ? void 0 : _a.indexOf('https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld')) || -1;
100
93
  if (Array.isArray(didDoc['@context']) && idx !== -1) {
101
- didDoc['@context'][idx] = "https://w3id.org/security/suites/secp256k1recovery-2020/v2";
94
+ didDoc['@context'][idx] = this.getContext();
102
95
  }
103
96
  if (didUrl.toLowerCase().startsWith('did:ethr')) {
104
97
  //EcdsaSecp256k1RecoveryMethod2020 does not support older format blockchainAccountId
@@ -112,6 +105,9 @@ class VeramoEcdsaSecp256k1RecoverySignature2020 extends ld_suites_1.VeramoLdSign
112
105
  });
113
106
  }
114
107
  }
108
+ getContext() {
109
+ return 'https://w3id.org/security/suites/secp256k1recovery-2020/v2';
110
+ }
115
111
  }
116
112
  exports.VeramoEcdsaSecp256k1RecoverySignature2020 = VeramoEcdsaSecp256k1RecoverySignature2020;
117
113
  //# sourceMappingURL=EcdsaSecp256k1RecoverySignature2020.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.js","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsE;AAEtE,kGAGoD;AAEpD,iDAAkC;AAClC,yCAAuD;AAEvD,MAAa,yCAA0C,SAAQ,6BAAiB;IAC9E,4BAA4B;QAC1B,OAAO,kCAAkC,CAAA;IAC3C,CAAC;IAED,yBAAyB;QACvB,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,kBAAkB,CAChB,GAAS,EACT,GAAW,EACX,kBAA0B,EAC1B,OAA4C;QAE5C,MAAM,UAAU,GAAG,GAAG,CAAA;QACtB,MAAM,MAAM,GAAG;YACb,wBAAwB;YACxB,IAAI,EAAE,CAAO,IAA0B,EAAmB,EAAE;gBAC1D,MAAM,MAAM,GAAG;oBACb,GAAG,EAAE,UAAU;oBACf,GAAG,EAAE,KAAK;oBACV,IAAI,EAAE,CAAC,KAAK,CAAC;iBACd,CAAA;gBACD,MAAM,YAAY,GAAG,IAAA,sBAAc,EAAC,MAAM,CAAC,CAAA;gBAC3C,MAAM,aAAa,GAAG,GAAG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AAU;QACR,OAAO,4DAA4D,CAAA;IACrE,CAAC;CACF;AApFD,8FAoFC"}
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": "3.1.5-next.119+3a0765ef",
4
+ "version": "3.1.5-next.122+180af512",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
7
  "scripts": {
@@ -14,23 +14,23 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@digitalbazaar/vc": "^2.1.0",
18
- "@transmute/credentials-context": "^0.7.0-unstable.34",
19
- "@transmute/ed25519-signature-2018": "^0.7.0-unstable.34",
17
+ "@digitalcredentials/jsonld": "^5.2.1",
18
+ "@digitalcredentials/jsonld-signatures": "^9.3.1",
19
+ "@digitalcredentials/vc": "^1.1.2",
20
+ "@transmute/credentials-context": "^0.7.0-unstable.60",
21
+ "@transmute/ed25519-signature-2018": "^0.7.0-unstable.60",
20
22
  "@transmute/lds-ecdsa-secp256k1-recovery2020": "decentralized-identity/EcdsaSecp256k1RecoverySignature2020",
21
- "@veramo/core": "^3.1.5-next.119+3a0765ef",
22
- "@veramo/did-resolver": "^3.1.5-next.119+3a0765ef",
23
- "@veramo/utils": "^3.1.5-next.119+3a0765ef",
23
+ "@veramo/core": "^3.1.5-next.122+180af512",
24
+ "@veramo/did-resolver": "^3.1.5-next.122+180af512",
25
+ "@veramo/utils": "^3.1.5-next.122+180af512",
24
26
  "debug": "^4.3.3",
25
- "did-resolver": "^3.1.5",
26
- "jsonld": "^5.2.0",
27
- "jsonld-signatures": "^9.3.1",
27
+ "did-resolver": "3.2.0",
28
28
  "uint8arrays": "^3.0.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/debug": "4.1.7",
32
32
  "borc": "3.0.0",
33
- "typescript": "4.7.2"
33
+ "typescript": "4.7.3"
34
34
  },
35
35
  "files": [
36
36
  "build/**/*",
@@ -47,5 +47,5 @@
47
47
  "author": "Mircea Nistor <mircea.nistor@mesh.xyz>",
48
48
  "license": "Apache-2.0",
49
49
  "keywords": [],
50
- "gitHead": "3a0765ef632aae29701004cbfbeb38a2de7bc847"
50
+ "gitHead": "180af5122146e0b2022a70a1689f5891edec117a"
51
51
  }
@@ -98,7 +98,7 @@ describe('credential-LD full flow', () => {
98
98
  expect(verified).toBe(true)
99
99
  })
100
100
 
101
- it.only('works with EcdsaSecp256k1RecoveryMethod2020 credentials', async () => {
101
+ it('works with EcdsaSecp256k1RecoveryMethod2020 credentials', async () => {
102
102
  const credential: CredentialPayload = {
103
103
  issuer: didEthrIdentifier.did,
104
104
  '@context': ['custom:example.context'],
@@ -138,6 +138,7 @@ describe('credential-LD full flow', () => {
138
138
  verifiableCredential: [verifiableCredential1],
139
139
  holder: didKeyIdentifier.did
140
140
  },
141
+ challenge: "VERAMO",
141
142
  proofFormat: 'lds',
142
143
  })
143
144
 
@@ -172,6 +173,7 @@ describe('credential-LD full flow', () => {
172
173
  verifiableCredential: [verifiableCredential1],
173
174
  holder: didEthrIdentifier.did
174
175
  },
176
+ challenge: "VERAMO",
175
177
  proofFormat: 'lds',
176
178
  })
177
179
 
@@ -9,14 +9,12 @@ import {
9
9
  } from '@veramo/core'
10
10
  import fetch from 'cross-fetch'
11
11
  import Debug from 'debug'
12
- import { extendContextLoader, purposes } from 'jsonld-signatures'
13
- import * as vc from '@digitalbazaar/vc'
12
+ import { extendContextLoader } from '@digitalcredentials/jsonld-signatures'
13
+ import * as vc from '@digitalcredentials/vc'
14
14
  import { LdContextLoader } from './ld-context-loader'
15
15
  import { LdSuiteLoader } from './ld-suite-loader'
16
16
  import { RequiredAgentMethods } from './ld-suites'
17
17
 
18
- const AssertionProofPurpose = purposes.AssertionProofPurpose
19
-
20
18
  const debug = Debug('veramo:w3c:ld-credential-module')
21
19
 
22
20
  export class LdCredentialModule {
@@ -46,8 +44,8 @@ export class LdCredentialModule {
46
44
 
47
45
  if (!didDoc) return
48
46
 
49
- // currently Veramo LD suites can modify the resolution response for DIDs from
50
- // the document Loader. This allows to fix incompatibilities between DID Documents
47
+ // currently, Veramo LD suites can modify the resolution response for DIDs from
48
+ // the document Loader. This allows us to fix incompatibilities between DID Documents
51
49
  // and LD suites to be fixed specifically within the Veramo LD Suites definition
52
50
  this.ldSuiteLoader.getAllSignatureSuites().forEach((x) => x.preDidResolutionModification(url, didDoc))
53
51
 
@@ -104,7 +102,7 @@ export class LdCredentialModule {
104
102
  const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type)
105
103
  const documentLoader = this.getDocumentLoader(context)
106
104
 
107
- // some suites can modify the incoming credential (e.g. add required contexts)W
105
+ // some suites can modify the incoming credential (e.g. add required contexts)
108
106
  suite.preSigningCredModification(credential)
109
107
 
110
108
  return await vc.issue({
@@ -135,7 +133,6 @@ export class LdCredentialModule {
135
133
  challenge,
136
134
  domain,
137
135
  documentLoader,
138
- purpose: new AssertionProofPurpose(),
139
136
  compactProof: false,
140
137
  })
141
138
  }
@@ -159,7 +156,6 @@ export class LdCredentialModule {
159
156
  credential,
160
157
  suite: this.ldSuiteLoader.getAllSignatureSuites().map((x) => x.getSuiteForVerification()),
161
158
  documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
162
- purpose: new AssertionProofPurpose(),
163
159
  compactProof: false,
164
160
  checkStatus: checkStatusFn,
165
161
  })
@@ -187,7 +183,6 @@ export class LdCredentialModule {
187
183
  documentLoader: this.getDocumentLoader(context, fetchRemoteContexts),
188
184
  challenge,
189
185
  domain,
190
- purpose: new AssertionProofPurpose(),
191
186
  compactProof: false,
192
187
  })
193
188
 
package/src/ld-suites.ts CHANGED
@@ -38,7 +38,7 @@ export abstract class VeramoLdSignature {
38
38
  // TODO: Remove invalid field 'verifiers' from Presentation. Needs to be adapted for LD credentials
39
39
  // Only remove empty array (vc.signPresentation will throw then)
40
40
  const sanitizedPresentation = presentation as any
41
- if (sanitizedPresentation.verifier?.length == 0) {
41
+ if (sanitizedPresentation?.verifier?.length == 0) {
42
42
  delete sanitizedPresentation.verifier
43
43
  }
44
44
  }
@@ -0,0 +1,9 @@
1
+ declare module '@digitalcredentials/jsonld'
2
+ declare module '@digitalcredentials/jsonld-signatures'
3
+ declare module '@digitalcredentials/vc'
4
+ declare module '@transmute/lds-ecdsa-secp256k1-recovery2020'
5
+
6
+ declare module "*.json" {
7
+ const content: any;
8
+ export default content;
9
+ }