digitalbazaar / rsa-signature-2018

RsaSignature2018 Linked Data Proof suite for use with jsonld-signatures.
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Is it empty implementation equivalent to Not Implemented? #2

Open dileepbapat opened 3 years ago

dileepbapat commented 3 years ago

https://github.com/digitalbazaar/rsa-signature-2018/blob/master/lib/RsaSignature2018.js

Above file defines an empty object, is it missing implementation?

Change: https://github.com/digitalbazaar/jsonld-signatures/blob/master/CHANGELOG.md#800---2021-03-18 moves signature suites into its own repo (which is this)

dmitrizagidulin commented 3 years ago

@dileepbapat - you're correct, a standalone RSA suite is not implemented at this point. (We don't really use it in any of our use cases / deployments.) For what it's worth, there is PR https://github.com/digitalbazaar/rsa-signature-2018/pull/1, which does have the code extracted from jsonld-signatures. It's just not really used/tested.

uocnb commented 2 years ago

@dmitrizagidulin I've tested with the latest version of vc.js with rn branch, and it works well. Could you please merge the PR #1?

dmitrizagidulin commented 2 years ago

@uocnb - oh, hey, good to know! :) Thanks for testing it.

fabrii commented 1 year ago

Hi @uocnb. Did it worked out of the box for you?

I'm generating my credentials with https://github.com/danubetech/verifiable-credentials-java. It generates them with RS256 ALG. I changed the algorithm in RsaSignature2018.js, and removed the "pss" attributes and salts in the RsaVerificationKey2018.js, but I am always getting "Invalid Signature". Might be also related to the way both libraries calculate the data that is going to be validated against the signature.

BTW, I also tried generating (java) and validating (js) credentials with ED25519 and works ok.

Just in case, reproducer here: https://github.com/fabrii/dc-playground

Thanks

fabrii commented 1 year ago

Found out that the RsaSignature2018 is working perfectly. The problem is that the received "verifyData" byte array is different on javascript vs java library. I am digging a bit further to know why.

fabrii commented 1 year ago

Seems to be related to an error in the canonicalization process.

Opened an issue upstream: https://github.com/digitalbazaar/jsonld.js/issues/524

@dmitrizagidulin, I would really appreciate if you could take a look and tell me what you think.

Thanks!

uocnb commented 1 year ago

Hi @fabrii, as I remember it required few changes to make it work. It's long time already when I'm working with this. The implementation can be found here: https://github.com/idpass/inji. See the package.json for details.

Good luck!

fabrii commented 1 year ago

I made it work. The suite is working ok. The problem is with the canonicalization process. More info in the issue opened in digitalbazar.

Thanks.