Credentials
Introduction
Credentials are one of the key concepts of self-sovereign identity. We follow the Hyperledger Aries Issue Credential Protocol 1.0 as defined by the linked RFC.
In our API, this protocol is represented using the Credentials Endpoints.
A credential is given as type CredentialContract, as shown below:
- Javascript
Create Schemas
Schemas represent the attribute structure of a Credential Definition.
Schemas can either be created while creating a custom credential definition or using the API POST /definition/schemas
.
- Javascript
Create Credential Definitions
Credential Definitions are templates for credentials that can be issed to users. There are two ways to create definitions. Either use the an existing schema or create a custom definition. Creating custom schemas and using existing schemas can be accomplished both through the API and the Trinsic Studio.
Custom
- Javascript
- Studio
From Schema
- Javascript
- Studio
Steps to issue a credential
There are 3 steps in issuing a credential to a digital wallet. Read more about Connectionless Credentials here.
- Offer Credential
- Request Credential
- Issue Credential
Our API offers two endpoints to accomplish the issuer initiated steps 1 & 3.
1. Send a credential offer
- JSON
- Javascript
- Studio
- Connection
This will send a credential offer of the specified definitionId
to the specified connectionId
.
This offer will include a dictionary of credentialValues
, which will be the values of the credential attributes.
Each key:value pair in the credentialValues object should correspond to the list of attributes in the specified definition.
The list of keys should match the attributeName
list that is in the Credential definition.
2. Wait for a credential request
3. Issue credential
PUT /credentials/{credentialId}
This simply needs the credential identifier.
If the credential is in state requested
, the credential will be issued to the digital wallet of the individual who accepted that offered credential.
Revoke a credential
A credential can be revoked by using the following commands:
Connectionless credentials
- JSON
- Javascript
- Studio
- Connection
This will create a connectionless credential offer of the specified definitionId
that will be returned as a link called offerUrl
.
This offer will include a dictionary of credentialValues
, which will be the values of the credential attributes.
Each key:value pair in the credentialValues object should correspond to the list of attributes in the specified definition.
The list of keys should match the attributeName
list that is in the Credential definition.