-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from Sphereon-Opensource/feature/DPP-127-fixes
feature/SDK-1
- Loading branch information
Showing
38 changed files
with
3,880 additions
and
3,351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DEBUG=* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
diff --git a/node_modules/@veramo/credential-w3c/build/action-handler.js b/node_modules/@veramo/credential-w3c/build/action-handler.js | ||
index d941dae..7a5ee6c 100644 | ||
--- a/node_modules/@veramo/credential-w3c/build/action-handler.js | ||
+++ b/node_modules/@veramo/credential-w3c/build/action-handler.js | ||
@@ -87,7 +87,7 @@ class CredentialPlugin { | ||
throw new Error('invalid_argument: presentation.holder must be a DID managed by this agent'); | ||
} | ||
//FIXME: `args` should allow picking a key or key type | ||
- const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Ed25519'); | ||
+ const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Secp256r1' || k.type === 'Ed25519'); | ||
if (!key) | ||
throw Error('key_not_found: No signing key for ' + identifier.did); | ||
let verifiablePresentation; | ||
@@ -117,6 +117,8 @@ class CredentialPlugin { | ||
let alg = 'ES256K'; | ||
if (key.type === 'Ed25519') { | ||
alg = 'EdDSA'; | ||
+ } else if (key.type === 'Secp256r1') { | ||
+ alg = 'ES256'; | ||
} | ||
const signer = wrapSigner(context, key, alg); | ||
const jwt = yield (0, did_jwt_vc_1.createVerifiablePresentationJwt)(presentation, { did: identifier.did, signer, alg }, Object.assign({ removeOriginalFields, challenge, domain }, otherOptions)); | ||
@@ -174,13 +176,15 @@ class CredentialPlugin { | ||
} | ||
else { | ||
//FIXME: `args` should allow picking a key or key type | ||
- const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Ed25519'); | ||
+ const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Secp256r1' || k.type === 'Ed25519'); | ||
if (!key) | ||
throw Error('No signing key for ' + identifier.did); | ||
debug('Signing VC with', identifier.did); | ||
let alg = 'ES256K'; | ||
if (key.type === 'Ed25519') { | ||
alg = 'EdDSA'; | ||
+ } else if (key.type === 'Secp256r1') { | ||
+ alg = 'ES256'; | ||
} | ||
const signer = wrapSigner(context, key, alg); | ||
const jwt = yield (0, did_jwt_vc_1.createVerifiableCredentialJwt)(credential, { did: identifier.did, signer, alg }, Object.assign({ removeOriginalFields }, otherOptions)); | ||
diff --git a/node_modules/@veramo/credential-w3c/src/action-handler.ts b/node_modules/@veramo/credential-w3c/src/action-handler.ts | ||
index ca8d51b..6a9c032 100644 | ||
--- a/node_modules/@veramo/credential-w3c/src/action-handler.ts | ||
+++ b/node_modules/@veramo/credential-w3c/src/action-handler.ts | ||
@@ -129,7 +129,7 @@ export class CredentialPlugin implements IAgentPlugin { | ||
throw new Error('invalid_argument: presentation.holder must be a DID managed by this agent') | ||
} | ||
//FIXME: `args` should allow picking a key or key type | ||
- const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Ed25519') | ||
+ const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Secp256r1' || k.type === 'Ed25519') | ||
if (!key) throw Error('key_not_found: No signing key for ' + identifier.did) | ||
|
||
let verifiablePresentation: VerifiablePresentation | ||
@@ -164,6 +164,8 @@ export class CredentialPlugin implements IAgentPlugin { | ||
let alg = 'ES256K' | ||
if (key.type === 'Ed25519') { | ||
alg = 'EdDSA' | ||
+ } else if (key.type === 'Secp256r1') { | ||
+ alg = 'ES256'; | ||
} | ||
const signer = wrapSigner(context, key, alg) | ||
|
||
@@ -235,13 +237,15 @@ export class CredentialPlugin implements IAgentPlugin { | ||
} | ||
} else { | ||
//FIXME: `args` should allow picking a key or key type | ||
- const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Ed25519') | ||
+ const key = identifier.keys.find((k) => k.type === 'Secp256k1' || k.type === 'Secp256r1' || k.type === 'Ed25519') | ||
if (!key) throw Error('No signing key for ' + identifier.did) | ||
|
||
debug('Signing VC with', identifier.did) | ||
let alg = 'ES256K' | ||
if (key.type === 'Ed25519') { | ||
alg = 'EdDSA' | ||
+ } else if (key.type === 'Secp256r1') { | ||
+ alg = 'ES256'; | ||
} | ||
const signer = wrapSigner(context, key, alg) | ||
const jwt = await createVerifiableCredentialJwt( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.