w3c-ccg / vc-ed

Verifiable Credentials for Education Task Force
https://w3c-ccg.github.io/vc-ed/
Other
42 stars 9 forks source link

Extracting data in a pdf format from a VC #3

Closed Sakurann closed 2 years ago

Sakurann commented 3 years ago

How can the verifier reproduce a pdf record from the set of values below, given in the payload example in section 1.5.3.1? Is there a standard protocol that can be used to extract the data in pdf format from "data" claim?

{
      "POCid": "did:example:ebfeb1f712ebc6f1c276e12ec23",
      "payload": {
        "format": "application/pdf",
        "data": "H4sICMr5oF4CA2Zha2VfY2VydC5wZGYA7L0H3CxJWS6uIEgQAQmCi[...]"
 }
roverwolf commented 2 years ago

I'm not sure I understand the question of a "standard protocol", but I am assuming that the question is how to get the PDF from that example.

I'll note that the example in section 1.5.3.1 is using the property name data instead of payloadRecord that LER Wrapper document uses (second payload in the linked example).

The payload.data property is a base64 encoded string. To get the file one would decode the base64 string stored in data and then treat the result as the mime type provided in the format property (which in this case is application/pdf).

The example in section 1.5.3.1 does not include a full PDF file in the data property, the [...] represents that there is more data but not being provided for brievity.

kayaelle commented 2 years ago

@Sakurann - what do you think of @roverwolf's answer? Do you have any follow-up questions? If not, may I close this ticket?

dmitrizagidulin commented 2 years ago

This may also be related to the general purpose mechanism of linking to non-VC resources (images, PDFs) from inside a VC: https://github.com/w3c/vc-data-model/issues/831

kayaelle commented 2 years ago

The task force decided to close this issue as it was related to the LER Wrapper recommendation. As @dmitrizagidulin notes above, linking to non-VC resources is being explored in another issue at CCG.