mdoc issuer initialization
Procedure
-
Write the issuer DID of the agent to a ledger or set the agents DID method to
did:web. -
Create or retrieve a credential schema.
For example, the following command creates a credential schema for issuing a subset of the ISO 18013.5.1 Mobile Driver’s Licenses (mDL) fields.
curl --location 'https://${service_url}/v2.0/diagency/credential_schemas' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ${issuer1_verifiable_credentials_access_token}' \ --data '{ "name": "mdl", "version": "1.0", "contexts": [ { "@context": { "schema": "http://schema.org/", "org.iso.18013.5.1:family_name": { "@id": "org.iso.18013.5.1:family_name", "@type": "schema:Text" }, "org.iso.18013.5.1:given_name": { "@id": "org.iso.18013.5.1:given_name", "@type": "schema:Text" } } } ] }'Note: The schema format must benamespace:field. -
Create a credential definition: A credential definition uniquely identifies the issuing agent and the attributes that are included in the credential. It is created by using the schema ID. A credential schema contains the data model for issuing credentials whereas a credential definition defines the encoding and security aspects of the issued credential.
Create a credential definition for
issuer1associated with the credential schemaid.{ "schema_id": "xxxxxx", "credential_document_type": [ "org.iso.18013.5.1.mDL" ], "credential_format": "mso_mdoc", "cryptographic_binding_methods": [ "cose_key" ], "key_proof_types": { "ldp_vp": [ "eddsa-rdfc-2022" // Or "Ed25519Signature2020" ] }, "credential_signing_algorithm": "EdDSA" }Note: The credential document type must be a single item that is used as the mdocdoctype.The response includes the preceding configuration, a copy of the specified schema, and a unique ID for the credential definition.
- For
ldp_vp, the value must be an array that containsEd25519Signature2020oreddsa-rdfc-2022. - The supported value for
credential_signing_algorithmisEdDSA.
- For
- Optional:
To enable status information for credentials issued from this credential definition, add a credential status provider by including the following in the credential definition request body:
{ “credential_status_provider”: { “id”: “86a7c919-bb0c-4e77-92b1-a3bd33a69131” “enabled_status_purposes”: [“revocation”, “suspension”] } }For more information, see Enabling status information.
What to do next
After the issuer initialization is complete, issuer1 can issue a credential to user1.