Skip to content

LdpPresentationGenerator fails to add public key to a VP proof node. #330

@ricardas-buc

Description

@ricardas-buc

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.

        var proofDraft = Jws2020ProofDraft.Builder.newInstance()
                .proofPurpose(ASSERTION_METHOD)
                .verificationMethod(new JsonWebKeyPair(URI.create(controller + "#" + publicKeyId), verificationMethodType, controllerUri, jwk))
                .created(Instant.now())
                .mapper(mapper)
                .build();

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageall new issues awaiting classification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions