LinkedDataSignature.getVerificationMethod limited to w3id.org security context definitions.
See original GitHub issueRelated: https://github.com/digitalbazaar/jsonld.js/issues/392
This prevents suite implementers from relying on the base class, and forces them to comprehend JSON-LD and implement their own getVerificationMethod
… here is one example:
async getVerificationMethod({ proof, documentLoader }) {
if (this.key) {
return this.key.publicNode();
}
// replaces:
// const verificationMethod = await super.getVerificationMethod({
// proof,
// documentLoader,
// });
// Because hard coding security contexts prevents extension using base class
// https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/suites/LinkedDataSignature.js#L233
let controller = (await documentLoader(proof.verificationMethod)).document;
const verificationMethod = await jsonld.frame(
controller,
{
"@context": [
"https://w3id.org/security/v2",
"https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld",
],
"@embed": "@always",
id: proof.verificationMethod,
},
{ documentLoader, compactToRelative: false }
);
await this.assertVerificationMethod({ verificationMethod });
return verificationMethod;
}
Perhaps this is by design… but its feels a bit odd.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
w3id.org - Permanent Identifiers for the Web
Secure, permanent URLs for your Web application that will stand the test of time. Content. Purpose; Management; System Operations; Creating a New Identifier ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Recommendation is to do 1 of 2 things…
thanks! I actually prefer the edit in this case!