Sphereon-Opensource / SIOP-OID4VP

Self Issued OpenID Provider v2 (SIOP) with optional OpenID for Verifiable Presentations (OpenID4VP)
Apache License 2.0
77 stars 25 forks source link

Support for more signing algorithms #53

Closed trusch closed 1 year ago

trusch commented 1 year ago

There are a lot of DID methods which depend on other signing algorithms. I feel that at least ed25519 and sr25519 should be added to support polkadot based DID solutions.

Is this something that might have a chance to land in here? I could also have a look how to add it, if I get positive feedback!

Great project btw. really appreciated.

trusch commented 1 year ago

I see now that support for more signing algorithms would need to be added to decentralized-identity/did-jwt. I also created an issue there: https://github.com/decentralized-identity/did-jwt/issues/282

nklomp commented 1 year ago

Hi @trusch thanks

Indeed the best place is to get it into did-jwt, but you can create a Signer implementation yourself that implements this interface: https://github.com/decentralized-identity/did-jwt/blob/056b2e422896436b781ecab2b466bacf72708d23/src/JWT.ts#L9 If it gets merged we can update our checks for the internal signature (basically DID-JWT supported signers).

We have also created something similar in https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/blob/e91448d1d692ddc6e141bcce806a62466a172d32/packages/kms-local/src/x509/rsa-signer.ts#L46

If you would create your own implementation you would be able to use the SuppliedSigner option with your own Signer. See https://github.com/Sphereon-Opensource/SIOP-OID4VP/blob/b679950ee8416cbcaf7231e49f9a56726a66447d/src/did/DidJWT.ts#L178

nklomp commented 1 year ago

In https://github.com/Sphereon-Opensource/SIOP-OID4VP/blob/b679950ee8416cbcaf7231e49f9a56726a66447d/src/rp/RPBuilder.ts#L227 you can see the RP builder option for a SuppliedSignature.

Note that the signature argument in there is actually a signer, so the name is a bit of. Also note that the code signature of that property is exactly the same as the did-jwt Signer interface/type

nklomp commented 1 year ago

Closing, as it should be possible