Updated on 2022-12-06 GMT+08:00

Verifying a Credential

Function

This API is used to verify that a credential exists and is valid.

URI

POST /v1/identity/verify-vc

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

orgID

Yes

String

Organization ID.

channelID

Yes

String

Channel ID.

cryptoMethod

Yes

String

Encryption method, which is fixed at SW.

cert

Yes

String

User certificate. Add an explicit line break (\n) at the end of each line.

sk

Yes

String

User private key. Add an explicit line break (\n) at the end of each line.

timestamp

Yes

String

Timestamp.

vcIndex

Yes

String

VC index.

owner

Yes

String

VC holder identifier.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

isOwned

Boolean

Whether the holder owns the VC.

Status code: 400

Table 3 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

Minimum: 8

Maximum: 36

errorMsg

String

Error description.

Minimum: 2

Maximum: 512

Status code: 500

Table 4 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

Minimum: 8

Maximum: 36

errorMsg

String

Error description.

Minimum: 2

Maximum: 512

Example Requests

{
  "orgID" : "4f1439758ebb41f7411b5f684b67713c08b89198",
  "channelID" : "mychannel",
  "cryptoMethod" : "SW",
  "cert" : "-----BEGIN CERTIFICATE-----\n...\n...\n-----END CERTIFICATE-----",
  "sk" : "------BEGIN PRIVATE KEY-----\n...\n...\n-----END PRIVATE KEY-----",
  "timestamp" : "2020-10-27T17:28:16+08:00",
  "vcIndex" : 1,
  "owner" : "did:example:ebfeb1f712ebc6f1c276e12ec21"
}

Example Responses

Status code: 200

VCVerifyResponeParams Information

{
  "isOwned" : true
}

Status code: 400

Error response.

{
  "errorCode" : "BCS.4002030",
  "errorMsg" : "Owner(bol) does not have credential ..."
}

Status code: 500

Error response.

{
  "errorCode" : "BCS.5002014",
  "errorMsg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

VCVerifyResponeParams Information

400

Error response.

500

Error response.

Error Codes

See Error Codes.