deltaDAO / self-description-signer

A simple script to create Gaia-X Self Descriptions
6 stars 6 forks source link

[Enhancement] Support for ECDSA Keys because EDC requires them #21

Open kettenbach-it opened 1 year ago

kettenbach-it commented 1 year ago

Motivation / Problem

The Eclipse Dataspace Connector (EDC) requires the users to use EC signatures instead of RSA. The self-description-signer does not support EC keys:

āÆ node index.js
šŸ“ Loaded ./config/self-description.json
šŸ“ˆ Hashed canonized SD 8fc77f3ec2a1add9803dd55cc8d833c916521d2310f7e93e8310c5f21920e07c
TypeError: Invalid key for this operation, its asymmetricKeyType must be rsa or rsa-pss
    at keyForCrypto (self-description-signer/node_modules/jose/dist/node/cjs/runtime/node_key.js:53:23)
    at sign (self-description-signer/node_modules/jose/dist/node/cjs/runtime/sign.js:23:91)
    at FlattenedSign.sign (self-description-signer/node_modules/jose/dist/node/cjs/jws/flattened/sign.js:68:55)
    at CompactSign.sign (self-description-signer/node_modules/jose/dist/node/cjs/jws/compact/sign.js:14:43)
    at sign (self-description-signer/index.js:48:14)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createProof (self-description-signer/index.js:63:10)
    at async main (self-description-signer/index.js:173:19)

Therefore I can't use the web:dids for EDC.

Solution

self-description-signer should support EC keys.

Alternatives

None

Additional context

Pull request for logging key signing errors: https://github.com/deltaDAO/self-description-signer/pull/22

kettenbach-it commented 1 year ago

I tried to play around with jose a little to get ECDSA to work: https://github.com/deltaDAO/self-description-signer/pull/25

Signing works, but not local verification. I'm not an export in node and not in jose either....

In the end, it's pointless anyway, because the server part of the whole thing has to be able to do ECDSA: https://github.com/deltaDAO/self-description-signing-api