Closed OR13 closed 4 years ago
I am getting:
{
"id": "did:example:123#vm-1",
"type": "sec:EcdsaSecp256k1RecoveryMethod2020",
"controller": {
"id": "did:example:123",
"assertionMethod": [
"did:example:123#vm-1"
],
"publicKey": "did:example:123#vm-1"
},
"sec:privateKeyJwk": {
"type": "@json",
"@value": {
"crv": "secp256k1",
"d": "rhYFsBPF9q3-uZThy7B3c4LDF_8wnozFUAEm5LLC4Zw",
"kid": "JUvpllMEYUZ2joO59UNui_XYDqxVqiFLLAJ8klWuPBw",
"kty": "EC",
"x": "dWCvM4fTdeM0KmloF57zxtBPXTOythHPMm1HCLrdd3A",
"y": "36uMVGM7hnw-N6GnjFcihWE3SkrhMLzzLCdPMXPEXlA"
}
},
"sec:publicKeyJwk": {
"type": "@json",
"@value": {
"crv": "secp256k1",
"kid": "JUvpllMEYUZ2joO59UNui_XYDqxVqiFLLAJ8klWuPBw",
"kty": "EC",
"x": "dWCvM4fTdeM0KmloF57zxtBPXTOythHPMm1HCLrdd3A",
"y": "36uMVGM7hnw-N6GnjFcihWE3SkrhMLzzLCdPMXPEXlA"
}
}
}
I want something more like....
{
"id": "did:example:123#vm-1",
"controller": "did:example:123",
"type": "EcdsaSecp256k1RecoveryMethod2020",
"publicKeyJwk": {
"crv": "secp256k1",
"kid": "JUvpllMEYUZ2joO59UNui_XYDqxVqiFLLAJ8klWuPBw",
"kty": "EC",
"x": "dWCvM4fTdeM0KmloF57zxtBPXTOythHPMm1HCLrdd3A",
"y": "36uMVGM7hnw-N6GnjFcihWE3SkrhMLzzLCdPMXPEXlA"
},
"privateKeyJwk": {
"crv": "secp256k1",
"d": "rhYFsBPF9q3-uZThy7B3c4LDF_8wnozFUAEm5LLC4Zw",
"kid": "JUvpllMEYUZ2joO59UNui_XYDqxVqiFLLAJ8klWuPBw",
"kty": "EC",
"x": "dWCvM4fTdeM0KmloF57zxtBPXTOythHPMm1HCLrdd3A",
"y": "36uMVGM7hnw-N6GnjFcihWE3SkrhMLzzLCdPMXPEXlA"
}
},
Pretty sure this is the problem: https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/suites/LinkedDataSignature.js#L233
// Note: `expansionMap` is intentionally not passed; we can safely drop
// properties here and must allow for it
const {'@graph': [framed]} = await jsonld.frame(verificationMethod, {
'@context': constants.SECURITY_CONTEXT_URL,
'@embed': '@always',
id: verificationMethod
}, {documentLoader, compactToRelative: false});
if(!framed) {
throw new Error(`Verification method ${verificationMethod} not found.`);
}
// ensure verification method has not been revoked
if(framed.revoked !== undefined) {
throw new Error('The verification method has been revoked.');
}
return framed;
by setting the @context
in the frame... doesn't this pretty much prevent extension of linked data signatures that use getVerificationMethod
but don't have types defined in the hardcoded security context?
I figured out why... its because of the use of frame
with a hard coded context that only supports w3id.org/security/v2...
Is it not possible to compact something that uses
@json
?