Cert-tools: display field (text/html) and application/pdf

Could you help me with cert-tools:

  1. Wondering how to add variable information (multiple values) from the csv-file to “display” field (in conf.ini of cert-tools). For example, If I want to have something like this:
"display": {
    "contentMediaType": "text/html",
    "content": "<h1>Diploma</h1>...*|NAME|*, credits *|ECTS|*"
  }

If I add it to additional_global_fields, it doesn’t understand that |NAME| and |ECTS| are variable values. If I add it to additional_per_recipient_fields, it doesn’t support multiple variables.
How to solve it?

Updated:
2. I tried with pdf, but found that it doesn’t show up on the page during the verification process. There is no preview, only offers to download locally. Will it be possible to view it later on the browser page?

  1. Will it be possible to use “style” tags for text/html format (“display.content” field)? I found an old post (Using <style> tags in displayHtml field)… Now, when I used them, I got the label “removed” instead of my document during the verification process.

  2. When I added images (base64 encoding) to the text/html format

<img src=\"data:image/png;base64,iVBO...\"  width=\"240\">

it displayed them fine, but failed verification and returned “Computed hash does not match remote hash”. How can this be affected by the presence of images in the text of the “display.content” field? What is the reason?

I am not too familiar with cert-tools as I have not worked much on the project neither used it myself.

  1. I am not certain, you might need to add your own logic there as it may not be able to discover such tags within a string at this moment (or maybe it does not know of this property and does not look it up). In both cases, if you solve it, would you mind opening a PR to cert-tools to make it beneficial to the community?

  2. That might have to do with your browser. Which one are you using? With Firefox and Chromium browsers I am able to see an embedded widget with the pdf content.

  3. style tags are being removed due to XSS sanitizing. If you want to use styles you need to put them inline for each HTML tag. Please bear in mind that those styles also get sanitized for the same XSS security reason, so some styles are not supported. If you believe you are missing an important style property, please open an issue on blockcerts-verifier so we can review whitelisting.

  4. I am not sure what you mean by that. If you have modified the document after the issuance, then the hashes won’t match. If before, it should not be a problem and that’s also how we handle images, so your problem might come from somewhere else.