Sign API

post
/utils/sign
Sign the Payload without storing
Parameters
Header
authorization*
Set to Bearer {access-token}
Body
...*
Object
Json Object with data key and its value representing what needs to be signed and its credentialTemplate as another key
Responses
200: OK
Successfully generated signed credentials
Sample Request
{
"id": "sunbird-rc.utils.sign",
"request": {
"data": {
"name": "Ade Hastuti",
"date_of_birth": "2022-08-01",
"gender": "Female"
},
"credentialTemplate": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"{context_url}"
],
"type": [
"VerifiableCredential"
],
"issuanceDate": "2021-08-27T10:57:57.237Z",
"credentialSubject": {
"type": "Beneficiary",
"name": "{{name}}",
},
"issuer": "did:web:openg2p"
}
}
}

Usage

cURL

curl --location --request POST '{registry-url}/utils/sign' \
--header 'Authorization: Bearer {access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "sunbird-rc.utils.sign",
"request": {
"data": {
"name": "Ade Hastuti",
"date_of_birth": "2022-08-01",
"gender": "Female"
},
"credentialTemplate": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"{context_url}"
],
"type": [
"VerifiableCredential"
],
"issuanceDate": "2021-08-27T10:57:57.237Z",
"credentialSubject": {
"type": "Beneficiary",
"name": "{{name}}",
},
"issuer": "did:web:openg2p"
}
}
}'

HTTPie

printf '{
"id": "sunbird-rc.utils.sign",
"request": {
"data": {
"name": "Ade Hastuti",
"date_of_birth": "2022-08-01",
"gender": "Female"
},
"credentialTemplate": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"{context_url}"
],
"type": [
"VerifiableCredential"
],
"issuanceDate": "2021-08-27T10:57:57.237Z",
"credentialSubject": {
"type": "Beneficiary",
"name": "{{name}}",
},
"issuer": "did:web:openg2p"
}
}
}'| http POST '{registry-url}/utils/sign' \
Authorization:'Bearer {access-token}' \
Content-Type:'application/json'
{registry-url} is usually http://localhost:{port}. The port can be found under the registry section in the docker-compose.yml file and is usually 8081