-
Notifications
You must be signed in to change notification settings - Fork 29
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LdpPresentationGenerator fails to add public key to a VP proof node. #330
Comments
Thanks for your contribution 🔥 We will take a look asap 🚀 |
I think you don't have the whole picture here. LD proofs can have embedded JWKs, in which case you'd be correct, simply adding the Generally, LDP verification has to be done on the expanded form of the credential. As a matter of security, public key material should not be embedded directly, but should be resolved from the credential/presentation issuer's DID to establish provenance. |
that's not a bug either :) the |
Sorry, I am still not fully grasping what should be correct implementation here. Is default MethodResolver not capable of passing LdpVerification checks as it will never provide correct verification method? To me it looks like that DataIntegrityKeyPair class implements wrong interface. 0.6.1: 0.6.2: In both version LdpVerifier checks VerificationKey interface:
|
no, the key aspect is to remember, that all verification checks happen on the expanded JSON-LD of a LDP-Credential. Expansion is the process of dereferencing and resolving all linked data, such as the public key material. That means, whether you embed the JWK or link it via a URL does not matter in the end, because both "variants" produce the same (ugly) JSON document. You have to expand though. The If you have discovered bug, I would ask you to provide a reproducible test case, preferably as Gist, otherwise I would like to convert this issue in a discussion, as that seems more appropriate. |
Thanks. Since its not directly identity hub issue- lets convert this one to discussion then. I will try using referenced verification and see if it works. Still, LdpVerifier and DataIntegrityKeyPair code looks a bit misleading or wrong. In any case, if that part will continue blocking me - will report with a gist in connector repo :) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Bug Report
With version
0.6.2
there seem to be a change of how VP proofs are populated. Missing publicKeyJwk leads to an verification exception in LdpVerifier as it fails to correctly parse verification method.if (!(verificationMethod instanceof VerificationKey)) { return failure("Proof did not contain a valid VerificationMethod, expected VerificationKey, got: %s".formatted(verificationMethod.getClass())); }
Possible Implementation
LdpPresentationGenerator fails to add publicKeyJwk as it was not passed to proof draft verification method. JsonWebKeyPair uses provided key to derive public key.
https://github.com/eclipse-edc/IdentityHub/blob/main/core/identity-hub-credentials/src/main/java/org/eclipse/edc/identityhub/core/creators/LdpPresentationGenerator.java#L169
Passing jwk to the proof makes VP proof valid again.
The text was updated successfully, but these errors were encountered: