Skip to content
English
  • There are no suggestions because the search field is empty.

Sign a digest with the authenticated user's DID key

POST /api/v1/protected/sign Select code sample Fetch cURL
const url = 'https://localhost:8080/api/v1/protected/sign';const options = {  method: 'POST',  headers: {Authorization: '
  
   ', 'Content-Type': 'application/json'}, body: '{"dataHash":"b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}
  
curl --request POST \  --url https://localhost:8080/api/v1/protected/sign \  --header 'Authorization: 
  
   ' \ --header 'Content-Type: application/json' \ --data '{ "dataHash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9" }'
  

Sign a 32-byte SHA-256 digest (hex-encoded) using the authenticated user’s DID key in the configured key provider

Authorizations

Section titled “Authorizations ”

Request Body

Section titled “Request Body ”

Hex encoded data hash to sign

Media type application/json object dataHash required string
Example
b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9

Responses

Section titled “ Responses ”

200

Section titled “200 ”

Signature created successfully

Media type application/json object signature string
Example
{  "signature": "3045022100a1b2c3d4e5f6..."}

400

Section titled “400 ”

Bad request - Invalid data

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

401

Section titled “401 ”

Unauthorized

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

404

Section titled “404 ”

No DID key found for user

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}

500

Section titled “500 ”

Internal server error

Media type application/json object error string error_description string
Example
{  "error": "Unauthorized",  "error_description": "Invalid token"}
Previous
Sign a digest with the platform DID key
Next
Sign a PDF digest with the platform DID key