@trustvc/trustvc 2.12.2 → 2.12.4
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.
|
@@ -125,7 +125,7 @@ class DocumentBuilder {
|
|
|
125
125
|
w3cCredentialStatus.assertTransferableRecords(this.document.credentialStatus, "sign");
|
|
126
126
|
await this.verifyTokenRegistry();
|
|
127
127
|
}
|
|
128
|
-
this.document.issuer = privateKey.id.split("#")[0];
|
|
128
|
+
this.document.issuer = this.document.issuer || privateKey.id.split("#")[0];
|
|
129
129
|
this.document.validFrom = this.document.validFrom || (/* @__PURE__ */ new Date()).toISOString();
|
|
130
130
|
this.addContext(w3cContext.DATA_INTEGRITY_V2_URL);
|
|
131
131
|
const signedVC = await w3c.signW3C(this.document, privateKey, cryptoSuite, options);
|
|
@@ -37,7 +37,8 @@ const w3cIssuerIdentity = {
|
|
|
37
37
|
}, "test"),
|
|
38
38
|
verify: /* @__PURE__ */ __name(async (document, verifierOptions) => {
|
|
39
39
|
const doc = document;
|
|
40
|
-
|
|
40
|
+
const issuerId = typeof doc.issuer === "string" ? doc.issuer : doc.issuer?.id;
|
|
41
|
+
if (doc.proof?.verificationMethod?.split("#")[0] !== issuerId) {
|
|
41
42
|
return {
|
|
42
43
|
type: "ISSUER_IDENTITY",
|
|
43
44
|
name: "W3CIssuerIdentity",
|
|
@@ -48,7 +49,7 @@ const w3cIssuerIdentity = {
|
|
|
48
49
|
status: "INVALID"
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
|
-
const resolutionResult = await checkDidWebResolve(
|
|
52
|
+
const resolutionResult = await checkDidWebResolve(issuerId, verifierOptions?.documentLoader);
|
|
52
53
|
if (resolutionResult) {
|
|
53
54
|
return {
|
|
54
55
|
type: "ISSUER_IDENTITY",
|
|
@@ -123,7 +123,7 @@ class DocumentBuilder {
|
|
|
123
123
|
assertTransferableRecords(this.document.credentialStatus, "sign");
|
|
124
124
|
await this.verifyTokenRegistry();
|
|
125
125
|
}
|
|
126
|
-
this.document.issuer = privateKey.id.split("#")[0];
|
|
126
|
+
this.document.issuer = this.document.issuer || privateKey.id.split("#")[0];
|
|
127
127
|
this.document.validFrom = this.document.validFrom || (/* @__PURE__ */ new Date()).toISOString();
|
|
128
128
|
this.addContext(DATA_INTEGRITY_V2_URL);
|
|
129
129
|
const signedVC = await signW3C(this.document, privateKey, cryptoSuite, options);
|
|
@@ -35,7 +35,8 @@ const w3cIssuerIdentity = {
|
|
|
35
35
|
}, "test"),
|
|
36
36
|
verify: /* @__PURE__ */ __name(async (document, verifierOptions) => {
|
|
37
37
|
const doc = document;
|
|
38
|
-
|
|
38
|
+
const issuerId = typeof doc.issuer === "string" ? doc.issuer : doc.issuer?.id;
|
|
39
|
+
if (doc.proof?.verificationMethod?.split("#")[0] !== issuerId) {
|
|
39
40
|
return {
|
|
40
41
|
type: "ISSUER_IDENTITY",
|
|
41
42
|
name: "W3CIssuerIdentity",
|
|
@@ -46,7 +47,7 @@ const w3cIssuerIdentity = {
|
|
|
46
47
|
status: "INVALID"
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
const resolutionResult = await checkDidWebResolve(
|
|
50
|
+
const resolutionResult = await checkDidWebResolve(issuerId, verifierOptions?.documentLoader);
|
|
50
51
|
if (resolutionResult) {
|
|
51
52
|
return {
|
|
52
53
|
type: "ISSUER_IDENTITY",
|