digitalbazaar / ed25519-verification-key-2020

Javascript library for generating and working with Ed25519VerificationKey2020 key pairs, for use with crypto-ld.
BSD 3-Clause "New" or "Revised" License
3 stars 10 forks source link

Replicate issue: toJWK fails to be imported by JOSE lib #21

Open vongohren opened 1 year ago

vongohren commented 1 year ago

I just wanted to raise awareness here as the issue is in a fork, and might be here as well.

https://github.com/digitalcredentials/ed25519-verification-key-2020/issues/5#issuecomment-1314141779

vongohren commented 1 year ago

Checking in here if there are any thoughts of why this might happen?

dmitrizagidulin commented 1 year ago

Found the cause -- the toJwk and fromJsonWebKey2020 methods have an error in their logic. See PR https://github.com/digitalcredentials/ed25519-verification-key-2020/pull/7 for fix.

dlongley commented 1 year ago

Looks like the fix here would be to ensure only the first 32 bytes are set as jwk.d.

https://github.com/digitalbazaar/ed25519-verification-key-2020/blob/main/lib/Ed25519VerificationKey2020.js#L316

dlongley commented 1 year ago

We should add local interop tests with the jose lib as well.