Skip to main content
Version: Next

Conformity Credential

info

Please note that this content is under development and is not ready for implementation. This status message will be updated as content development progresses.

Description

This section outlines three methods for creating and using Conformity Credentials within the Mock App system. Each method offers different levels of automation and integration with external services.

Manually Import Conformity Credential

This method involves manually creating and importing a Conformity Credential.

Steps:

  1. Craft the Conformity Credential payload based on the desired schema.
  2. Sign the credential using the Verifiable Credential service.
  3. Store the credential in an external or Local Storage service.
  4. Format the URL for the conformity evidence reference.
  5. Include the formatted URL in the Conformity Credential within the DPP data props in the app config (conformityEvidence.reference).

Example config snippet:

{
"name": "Steel Mill 1",
"type": "producer",
"assets": {
"logo": "https://example.com/Logo.jpg",
"brandTitle": "Steel Mill 1"
},
"features": [
{
"name": "Issue DPP",
"id": "produce_product",
"components": [
{
"name": "JsonForm",
"type": "EntryData",
"props": {
"schema": {
"type": "object",
"properties": {
"conformityClaim": {
"type": "array",
"items": {
"type": "object",
"properties": {
"topic": { "type": "string" },
"standardOrRegulation": { "type": "string" },
"criteriaReference": { "type": "string" },
"claimedValues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": {
"type": "object",
"properties": {
"value": { "type": "number" },
"unit": { "type": "string" }
}
},
"accuracy": { "type": "number" }
}
}
},
"benchmarkValue": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": {
"type": "object",
"properties": {
"value": { "type": "number" },
"unit": { "type": "string" }
}
}
}
},
"benchmarkReference": { "type": "string" },
"conformance": { "type": "boolean" },
"conformityEvidence": {
"type": "object",
"properties": {
"type": { "type": "string" },
"assuranceLevel": { "type": "string" },
"reference": { "type": "string" }
}
}
}
}
}
}
},
"data": {
"conformityClaim": [
{
"topic": "environment.emissions",
"standardOrRegulation": "https://example.org/standards/environment",
"criteriaReference": "https://example.org/standards/environment/criteria",
"claimedValues": [
{ "name": "GHG Emissions", "value": { "value": 50, "unit": "KG_CO2E" }, "accuracy": 0.98 }
],
"benchmarkValue": { "name": "Industry Benchmark", "value": { "value": 60, "unit": "KG_CO2E" } },
"benchmarkReference": "https://example.org/benchmarks/environment",
"conformance": true,
"conformityEvidence": {
"type": "w3c_vc",
"assuranceLevel": "3rdParty",
"reference": "http://localhost:3001/verify?q%3D%7Bpayload%3A%7Buri%3Ahttp%3A%2F%2Flocalhost%3A3001%2Fconformity-credentials%2Fsteel-mill-1-emissions.json%7D%7D"
}
}
]
}
}
}
],
"services": []
}
]
}

Create Conformity Credential Within Mock App System

To Be Implemented

This method involves creating the conformity credential within the Mock App system by using a feature that is composed of the JsonForm component and storing it in local storage or by using the Storage service.

Request Conformity Credential from External Service

This method uses the ConformityCredential component to request a conformity credential from an external service, store it, and manage the received credentials.

Steps:

  1. Configure the ConformityCredential component in the app config to specify the external service details and storage options.
  2. Use the ConformityCredential component to send a request to the external service for a Conformity Credential.
  3. Receive the credential from the external service.
  4. Store the received credential in the specified storage service.
  5. Save a reference to the stored credential in local storage for future use (only accessible by the specified app).

All of the steps above are handled inside of the ConformityCredential component.

Example config snippet:

{
"name": "Steel Mill 1",
"type": "producer",
"features": [
{
"name": "Request Conformity Credential",
"id": "request_conformity_credential",
"components": [
{
"name": "ConformityCredential",
"type": "Void",
"props": {
"credentialRequestConfigs": [
{
"url": "https://example.com/emissions-assessment",
"params": {},
"options": {
"headers": [],
"method": "POST"
},
"credentialName": "Emissions Assessment",
"credentialPath": "/body/credential",
"appOnly": "Steel Mill 1"
}
],
"storedCredentialsConfig": {
"url": "http://localhost:3334/v1/documents",
"params": {
"bucket": "verifiable-credentials"
},
"options": {
"method": "POST",
"headers": {
"Content-Type": "application/json"
}
}
}
}
}
],
"services": []
}
]
}

Using the Stored Credential in a DPP

To use the stored Conformity Credentials in the DPP issuance process, you have two options:

  1. Using the Conformity Credential Checkbox component
  2. Using the Local Storage Loader component

Option 1: Using the Conformity Credential Checkbox component

The Conformity Credential Checkbox component allows users to select one or more Conformity Credentials from a list of checkboxes. The component is added to the issue DPP feature. Here's how you can incorporate it into your DPP issuance process:

{
"name": "Steel Mill 1",
"type": "producer",
"features": [
{
"name": "Issue DPP",
"id": "produce_product",
"components": [
{
"name": "ConformityCredentialCheckbox",
"type": "EntryData"
},
{
"name": "JsonForm",
"type": "EntryData",
"props": {
"schema": {
/* Your DPP JSON schema */
},
"constructData": {
"mappingFields": [
{
"sourcePath": "/{app_name}/0/url",
"destinationPath": "/credentialSubject/conformityClaim/0/conformityEvidence/reference"
}
]
}
}
},
{
"name": "CustomButton",
"type": "Submit",
"props": {
"label": "Submit",
"description": "Click to submit the form"
}
}
],
"services": [
{
/* Services to issue DPP */
}
]
}
]
}

Option 2: Using the Local Storage Loader component

The Local Storage Loader component loads data from local storage and provides it to nested components. Here's how you can use it to load and incorporate Conformity Credentials:

{
"name": "Steel Mill 1",
"type": "producer",
"features": [
{
"name": "Issue DPP",
"id": "produce_product",
"components": [
{
"name": "LocalStorageLoader",
"type": "EntryData",
"props": {
"storageKey": "Farm_conformity_credentials",
"nestedComponents": [
{
"name": "JsonForm",
"type": "EntryData",
"props": {
"schema": {
/* Your DPP JSON schema */
},
"constructData": {
"mappingFields": [
{
"sourcePath": "/{app_name}/0/url",
"destinationPath": "/credentialSubject/conformityClaim/0/conformityEvidence/reference"
}
]
}
}
},
{
"name": "CustomButton",
"type": "Submit",
"props": {
"label": "Submit",
"description": "Click to submit the form"
}
}
]
}
}
],
"services": [
{
/* Services to issue DPP */
}
]
}
]
}

Credential Import Process: Verify URL Construction

In the mock app system, credentials imported from the local storage service return a URI, and optionally, a hash and key if encrypted. This URI is now used to construct the verify URL with the following format:

{verify_app_address}?q={payload:{uri:{uri_of_credential}, key:{decryption_key}, hash:{hash_of_credential}}}

The verify URL should include the URI, and if encryption exists, the hash and key. The verify URL directs to the "verify" page of the mock app.