hyperledger / anoncreds-rs

anoncreds-rs
https://wiki.hyperledger.org/display/anoncreds
Apache License 2.0
73 stars 55 forks source link

Conversion from W3cVerifiableCredential to the legacy format fails #326

Closed auer-martin closed 7 months ago

auer-martin commented 7 months ago

The conversion from a W3cVerifiableCredential to the legacy format fails if it is a "derived" vc from a presentation. That should still work, right?

    const w3cVerifiablePresentation = W3cPresentation.create({...})
    const w3cVerifiablePresentationJson = w3cVerifiablePresentation.toJson()
    const verifiableCredentialJson = w3cVerifiablePresentationJson.verifiableCredential[0]
    const w3cVerifiableCredential = W3cCredential.fromJson(verifiableCredentialJson)
    const legacyCredential = w3cVerifiableCredential.toLegacy()
    // Error: DataIntegrityProof does not contain credential signature proof
swcurran commented 7 months ago

I’m not sure, but I’m also not sure why it would be needed. Could you explain? Is it as a part of verifying the VP?

An AnonCreds derived VC in a VP is quite different from an issued VC, so I’m not surprised that the conversion does not work.

auer-martin commented 7 months ago

Okay. I was running into it when doing some experimentation. If that is the expected behavior, I will close this. Thanks for the information.