diff --git a/index.html b/index.html index dcde244..43e3825 100644 --- a/index.html +++ b/index.html @@ -470,254 +470,119 @@

TemplateRenderMethod

information from the [=verifiable credential=] listed in `renderProperty`.

-
-

The `svg-mustache` Render Suite

-

-The `svg-mustache` render suite uses the Mustache templating language to -modify an SVG file, which is then used to render a visual representation -of the [=verifiable credential=]. -

- -

-In the example below, a fully embedded SVG file is used as the rendering -template. -

- -
-{
-  ...
-  "renderMethod": {
-    "type": "TemplateRenderMethod",
-    "renderSuite": "svg-mustache",
-    // the SVG file is embedded in the VC
-    "template": "data:image/svg+xml;base64,Qjei89...3jZpW"
-  }
-}
-          
- -

-The next example links to the SVG file on the Web and secures it against -modification by using the `digestMultibase` property. -

- -
-{
-...
-"renderMethod": {
-  "type": "TemplateRenderMethod",
-  "renderSuite": "svg-mustache",
-  "template": {
-    // this SVG file is fetched from the Web
-    "id": "https://degree.example/credential-templates/bachelors",
-    "mediaType": "image/svg+xml",
-    "digestMultibase": "zQmerWC85Wg6wFl9znFCwYxApG270iEu5h6JqWAPdhyxz2dR"
-  }
-}
-          
- -

-The next example links to the rendering template on the Web and secures it -using the `digestMultibase` property: -

- -
-{
-...
-"renderMethod": {
-  // this render method is fetched from the Web
-  "id": "https://degrees.example/bachelors-svg.jsonld",
-  "mediaType": "application/ld+json",
-  "type": "TemplateRenderMethod",
-  "renderSuite": "svg-mustache",
-  "digestMultibase": "zQmG270iEu5h6JqWAPdhyxz2dRerWC85Wg6wFl9znFCwYxAp"
-}
-          
- -
- -
-

The `pdf-mustache` Render Suite

-

-The `pdf-mustache` render suite uses the Mustache templating language to -modify a PDF file, which is then used to render a visual representation -of the [=verifiable credential=]. -

- -

-In the example below, a fully embedded PDF file is used as the rendering -template. -

- -
-{
-  ...
-  "renderMethod": {
-    "type": "TemplateRenderMethod",
-    "renderSuite": "pdf-mustache",
-    // this PDF file is embedded in the VC
-    "template": "data:application/pdf;base64,k309SK...pwK83b"
-  }
-}
-          
- -

-The next example links to the PDF file on the Web and secures it against -modification by using the `digestMultibase` property. -

- -
-{
-...
-"renderMethod": {
-  "type": "TemplateRenderMethod",
-  "renderSuite": "pdf-mustache",
-  "template": {
-    // this PDF file is fetched from the Web
-    "id": "https://degree.example/bachelors.pdf",
-    "mediaType": "application/pdf",
-    "digestMultibase": "zQmznFCwYxApG270iEu5h6JqWAPdhyxz2dRerWC85Wg6wFl9"
-  }
-}
-          
- -

-The next example links to the rendering template on the Web and secures it -using the `digestMultibase` property: -

- -
-{
-...
-"renderMethod": {
-  // this render method is fetched from the Web
-  "id": "https://degrees.example/bachelors-pdf.jsonld",
-  "type": "TemplateRenderMethod",
-  "renderSuite": "pdf-mustache",
-  "digestMultibase": "zQmEu5h6JqWAPdhyxmz2dRerWC85Wg6wFl9znFCwYxApG270"
-}
-          
- -
-

The `json-card` Render Suite

-The `json-card` render suite uses JSON templates to transform a -[=verifiable credential=] into a standardized JSON card format. This format -enables wallets to display credentials in a responsive card layout with key -data highlighted and configurable additional fields. Wallets that implement -this method can render the standardized JSON output in their own card UI -designs, allowing credentials to be displayed even when a wallet doesn't -natively support a specific credential type. + The `json-card` render suite uses JSON templates to transform a + [=verifiable credential=] into a standardized JSON card format. This format + enables wallets to display credentials in a responsive card layout with key + data highlighted and configurable additional fields. Wallets that implement + this method can render the standardized JSON output in their own card UI + designs, allowing credentials to be displayed even when a wallet doesn't + natively support a specific credential type.

-The template is a JSON object that matches the `json-card` output structure. -String values in the template can be JSON pointer strings (as specified in -[[[RFC6901]]]) that reference fields in the [=verifiable credential=]. When -processing the template, JSON pointer strings are evaluated against the -credential data and replaced with the resolved values. The template MUST -conform to the JSON template schema defined below, and the resulting output -MUST conform to the `json-card` output schema. Compound data across multiple -fields is not supported; each field references a single JSON pointer. + The template is a JSON object that matches the `json-card` output structure. + String values in the template can be JSON pointer strings (as specified in + [[[RFC6901]]]) that reference fields in the [=verifiable credential=]. When + processing the template, JSON pointer strings are evaluated against the + credential data and replaced with the resolved values. The template MUST + conform to the JSON template schema defined below, and the resulting output + MUST conform to the `json-card` output schema. Compound data across multiple + fields is not supported; each field references a single JSON pointer.

JSON Template Schema

-The template for a `json-card` render suite MUST be a JSON object that -conforms to the following structure. The template structure matches the -output structure, but string values can be either literal strings or JSON -pointer strings (starting with `/`) that reference fields in the -[=verifiable credential=]. The template SHOULD be validated against this -schema before processing. + The template for a `json-card` render suite MUST be a JSON object that + conforms to the following structure. The template structure matches the + output structure, but string values can be either literal strings or JSON + pointer strings (starting with `/`) that reference fields in the + [=verifiable credential=]. The template SHOULD be validated against this + schema before processing.

- - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
PropertyTypeDescription
name[=string=] -A REQUIRED string that is either a literal display name or a JSON pointer -string (e.g., "/credentialSubject/degree/name") that references -the credential data. -
description[=string=] -A REQUIRED string that is either a literal description or a JSON pointer -string that references the credential data. -
icon[=string=] -An OPTIONAL string that is either a literal URL/data URI or a JSON pointer -string that references the credential data. -
theme[=ordered map|map=] -An OPTIONAL color theme object with the following properties: -
    -
  • primaryColor ([=string=]): Primary color as a literal string or JSON pointer
  • -
  • accentColor ([=string=]): Accent color as a literal string or JSON pointer
  • -
-
fields[=list=] -A REQUIRED ordered list of custom data fields. Each field is an object with: -
    -
  • label ([=string=]): The field label (MUST be a literal string, not a JSON pointer)
  • -
  • value ([=string=]): The field value as a JSON pointer string (e.g., "/issuer")
  • -
  • language ([=string=]): An OPTIONAL language tag (as specified in [[[BCP47]]]) indicating the language of the field's label and/or value
  • -
-
validFrom[=string=] -An OPTIONAL string that is either a literal ISO 8601 date or a JSON pointer -string that references the credential data (validity start date). -
validUntil[=string=] -An OPTIONAL string that is either a literal ISO 8601 date or a JSON pointer -string that references the credential data (validity end date). -
name[=string=] + A REQUIRED string that is either a literal display name or a JSON pointer + string (e.g., "/credentialSubject/degree/name") that references + the credential data. +
description[=string=] + A REQUIRED string that is either a literal description or a JSON pointer + string that references the credential data. +
icon[=string=] + An OPTIONAL string that is either a literal URL/data URI or a JSON pointer + string that references the credential data. +
theme[=ordered map|map=] + An OPTIONAL color theme object with the following properties: +
    +
  • primaryColor ([=string=]): Primary color as a literal string or JSON pointer
  • +
  • accentColor ([=string=]): Accent color as a literal string or JSON pointer
  • +
+
fields[=list=] + A REQUIRED ordered list of custom data fields. Each field is an object with: +
    +
  • label ([=string=]): The field label (MUST be a literal string, not a JSON pointer)
  • +
  • value ([=string=]): The field value as a JSON pointer string (e.g., "/issuer")
  • +
  • language ([=string=]): An OPTIONAL language tag (as specified in [[[BCP47]]]) indicating the language of the field's label and/or value
  • +
+
validFrom[=string=] + An OPTIONAL string that is either a literal ISO 8601 date or a JSON pointer + string that references the credential data (validity start date). +
validUntil[=string=] + An OPTIONAL string that is either a literal ISO 8601 date or a JSON pointer + string that references the credential data (validity end date). +

-The following JSON Schema implements the template structure rules defined -above: + The following JSON Schema implements the template structure rules defined + above:

JSON Template Schema
             

-The following example shows a valid `json-card` template with JSON pointer -strings: + The following example shows a valid `json-card` template with JSON pointer + strings:

JSON Template Schema
           

JSON Card Output Schema

-The output of a `json-card` template MUST be a JSON object that conforms to -the following structure: + The output of a `json-card` template MUST be a JSON object that conforms to + the following structure:

- - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDescription
PropertyTypeDescription
name[=string=] -A REQUIRED display name for the credential card. -
description[=string=] -A REQUIRED description text for the credential card. -
icon[=string=] -An OPTIONAL URL or data URI for an icon or image to display on the card. -
theme[=ordered map|map=] -An OPTIONAL color theme object with the following properties: -
    -
  • primaryColor ([=string=]): Primary color for backgrounds and highlights
  • -
  • accentColor ([=string=]): Accent color for highlights and emphasis
  • -
-
fields[=list=] -A REQUIRED ordered list of custom data fields. Each field is an object with: -
    -
  • label ([=string=]): The field label
  • -
  • value ([=string=]): The field value
  • -
  • language ([=string=]): An OPTIONAL language tag (as specified in [[[BCP47]]]) indicating the language of the field
  • -
-
validFrom[=string=] -An OPTIONAL ISO 8601 date string indicating when the credential becomes valid. -
validUntil[=string=] -An OPTIONAL ISO 8601 date string indicating when the credential ceases to be valid. -
name[=string=] + A REQUIRED display name for the credential card. +
description[=string=] + A REQUIRED description text for the credential card. +
icon[=string=] + An OPTIONAL URL or data URI for an icon or image to display on the card. +
theme[=ordered map|map=] + An OPTIONAL color theme object with the following properties: +
    +
  • primaryColor ([=string=]): Primary color for backgrounds and highlights
  • +
  • accentColor ([=string=]): Accent color for highlights and emphasis
  • +
+
fields[=list=] + A REQUIRED ordered list of custom data fields. Each field is an object with: +
    +
  • label ([=string=]): The field label
  • +
  • value ([=string=]): The field value
  • +
  • language ([=string=]): An OPTIONAL language tag (as specified in [[[BCP47]]]) indicating the language of the field
  • +
+
validFrom[=string=] + An OPTIONAL ISO 8601 date string indicating when the credential becomes valid. +
validUntil[=string=] + An OPTIONAL ISO 8601 date string indicating when the credential ceases to be valid. +

-The following example shows a valid `json-card` output: + The following example shows a valid `json-card` output:

JSON Card Output Schema
           

Template Processing

-When processing a `json-card` template, the following steps MUST be -performed: + When processing a `json-card` template, the following steps MUST be + performed:

  1. -Validate the template JSON object against the JSON template schema defined -above. If validation fails, processing MUST stop and an error MUST be -returned. + Validate the template JSON object against the JSON template schema defined + above. If validation fails, processing MUST stop and an error MUST be + returned.
  2. -For each string value in the template object: + For each string value in the template object:
    1. -If the string value starts with `/` (indicating it is a JSON pointer), -evaluate it using the JSON Pointer algorithm [[[RFC6901]]] against the -[=verifiable credential=] as the target document. + If the string value starts with `/` (indicating it is a JSON pointer), + evaluate it using the JSON Pointer algorithm [[[RFC6901]]] against the + [=verifiable credential=] as the target document.
    2. -If the JSON pointer evaluation succeeds, replace the JSON pointer string with -the resolved value. If the resolved value is not a string, convert it to a -string representation. + If the JSON pointer evaluation succeeds, replace the JSON pointer string with + the resolved value. If the resolved value is not a string, convert it to a + string representation.
    3. -If the JSON pointer evaluation fails or returns `null`, the behavior is -implementation-specific. Implementations MAY use an empty string, leave the -value as `null`, or signal an error. + If the JSON pointer evaluation fails or returns `null`, the behavior is + implementation-specific. Implementations MAY use an empty string, leave the + value as `null`, or signal an error.
    4. -If the string value does not start with `/`, treat it as a literal string -and leave it unchanged. + If the string value does not start with `/`, treat it as a literal string + and leave it unchanged.
  3. -Validate the resulting JSON object against the `json-card` output schema. If -validation fails, processing MUST stop and an error MUST be returned. + Validate the resulting JSON object against the `json-card` output schema. If + validation fails, processing MUST stop and an error MUST be returned.

-Note that compound data across multiple fields is not supported. Each field -in the template references a single JSON pointer that resolves to a single -value from the credential. + Note that compound data across multiple fields is not supported. Each field + in the template references a single JSON pointer that resolves to a single + value from the credential.

-In the example below, a fully embedded JSON template is used as the rendering -template. The template uses JSON pointer strings to reference credential data. + In the example below, a fully embedded JSON template is used as the rendering + template. The template uses JSON pointer strings to reference credential data.

Template Processing
           

-The next example links to the JSON template on the Web and secures it against -modification by using the `digestMultibase` property. + The next example links to the JSON template on the Web and secures it against + modification by using the `digestMultibase` property.

+               title="A remotely hosted JSON template for a json-card render template">
 {
 ...
 "renderMethod": {
@@ -1029,12 +894,12 @@ 

Template Processing

-The next example links to the rendering template on the Web and secures it -using the `digestMultibase` property: + The next example links to the rendering template on the Web and secures it + using the `digestMultibase` property:

+               title="A remotely hosted json-card render method">
 {
 ...
 "renderMethod": {
@@ -1312,7 +1177,7 @@ 
Ready and Error Events

Output Preferences

Rendering environment preferences MAY be provided within the Render Method. The -purpose of this object is to provide suggested use, display, and intended +purpose of this object is to provide suggested use, display, and intended access mode when rendering the provided template. An implementation SHOULD follow these preferences when provided.

@@ -1334,9 +1199,9 @@

Output Preferences

-

-The `outputPreference` object MAY contain any of the following properties: -

+

+The `outputPreference` object MAY contain any of the following properties: +

@@ -1359,8 +1224,8 @@

Output Preferences

mediaType An OPTIONAL [=string=] stating a valid media type listed in the -IANA Media Types preferred for rendering. This value MAY be used when +IANA Media Types preferred for rendering. This value MAY be used when suggesting addtional processing prior to rendering. Examples include converting an SVG template into a static image or an HTML document into a PDF.