Skip to main content
Version: Next

Sign document

POST 

/api/management/signature/sign

Sign a JSON document with default or defined key

Request

Bodyrequired

    typestring

    Possible values: [JsonWebSignature2020, DataIntegrityProof]

    Example: {"type":"JsonWebSignature2020"}
    plainDocumentobjectrequired
    Example: {"id":"document1","content":"This is a sample document"}
    keyIdstring
    Example: did:example:12345
    normalizationstring

    Possible values: [RDFC, JCS]

    Default value: RDFC
    Example: RDFC
    proofPurposestring
    Default value: assertionMethod
    Example: assertionMethod
    options object
    typestring

    Possible values: [DataIntegrityProof]

    Example: DataIntegrityProof
    proofPurposestring
    Example: assertionMethod
    idstring
    Example: did:example:xyz#proof-1
    verificationMethodstring
    Example: did:example:author#verificationKey
    cryptosuitestring
    Example: ecdsa-2019
    createdstring
    Example: 2021-01-01T00:00:00Z
    expiresstring
    Example: 2022-01-01T00:00:00Z
    domainstring[]
    Example: ["example.com"]
    challengestring
    Example: 1234567890
    proofValuestring
    Example: ProofValueString
    previousProofstring[]
    Example: ["PreviousProof1","PreviousProof2"]
    noncestring
    Example: nonce-string
    embeddedVerificationMethodboolean
    Default value: false
    Example: false

Responses

Schema
    proof objectrequired
    oneOf
    typestringrequired

    Possible values: [JsonWebSignature2020, DataIntegrityProof]

    Example: JsonWebSignature2020
    proofPurposestringrequired
    Example: assertionMethod

Authorization: oauth2

name: oauth2type: oauth2scopes: wallet_use_keys,wallet_manage_keysflows: {
  "password": {
    "scopes": {
      "wallet_view_did": "wallet_view_did",
      "wallet_manage_keys": "wallet_manage_keys",
      "wallet_use_keys": "wallet_use_keys",
      "wallet_view_own_credentials": "wallet_view_own_credentials",
      "wallet_view_all_credentials": "wallet_view_all_credentials",
      "wallet_manage_own_credentials": "wallet_manage_own_credentials",
      "wallet_manage_all_credentials": "wallet_manage_all_credentials",
      "wallet_issue_credentials": "wallet_issue_credentials",
      "wallet_view_presentations": "wallet_view_presentations"
    }
  }
}
curl -L 'https://tsg.dataspac.es/api/management/signature/sign' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"type": {
"type": "JsonWebSignature2020"
},
"plainDocument": {
"id": "document1",
"content": "This is a sample document"
},
"keyId": "did:example:12345",
"normalization": "RDFC",
"proofPurpose": "assertionMethod",
"options": {
"created": "2023-10-12T18:25:43.511Z",
"proofPurpose": "assertionMethod"
},
"embeddedVerificationMethod": false
}'
Request Collapse all
Auth
Body required
{
  "type": {
    "type": "JsonWebSignature2020"
  },
  "plainDocument": {
    "id": "document1",
    "content": "This is a sample document"
  },
  "keyId": "did:example:12345",
  "normalization": "RDFC",
  "proofPurpose": "assertionMethod",
  "options": {
    "created": "2023-10-12T18:25:43.511Z",
    "proofPurpose": "assertionMethod"
  },
  "embeddedVerificationMethod": false
}