Updated on 2023-01-18 GMT+08:00

Authorizing an ABE User Key

Function

Authorizing an ABE User Key

URI

PUT /v1/datashare/abekey-order

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

Certificate.

sk

Yes

String

Private key.

timestamp

Yes

String

Timestamp.

applyer

Yes

String

Applicant identifier.

provider

Yes

String

Authorizer identifier.

attrJson

No

Array of attribute objects

Attributes.

Table 2 attribute

Parameter

Mandatory

Type

Description

name

Yes

String

Attribute name.

type

Yes

String

Attribute type (plain or comparable).

value

Yes

String

Attribute value. When the attribute type is plain, the value is the attribute value. When the attribute type is comparable, the value must be an integer.

maxValue

No

String

Upper limit of the attribute value. This parameter can be used only when the attribute type is comparable.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

applyer

String

Applicant identifier.

applyerName

String

Applicant name.

provider

String

Authorizer identifier.

providerName

String

Authorizer name.

service

String

Service name of the authorizer.

price

Integer

Price.

applyTime

String

Application time.

encryptedABEKey

String

Encrypted ABE key.

status

String

Application status. The value request indicates that the application is not authorized, and the value ready indicates that the application has been processed.

reason

String

Reason.

lockProof

String

Proof.

attributesJson

String

Attribute.

Status code: 500

Table 4 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMsg

String

Error description.

Example Requests

{
  "orgID" : "ce0ac69b0c8648cd25b44a551780409767c8890b",
  "channelID" : "mychannel",
  "cryptoMethod" : "SW",
  "cert" : "-----BEGIN CERTIFICATE-----\\n...\\n-----END CERTIFICATE-----",
  "sk" : "-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----",
  "timestamp" : "2020-10-27T17:28:16+08:00",
  "applyer" : "did:example:Mb4SshJeN5ukWXkbMJK8xC",
  "provider" : "did:example:Mb4SshJeN5ukWXkbMJK8xC",
  "attrJson" : "[{\"name\":\"att1\",\"type\":\"plain\",\"value\":\"att1name\"},{\"name\":\"att2\",\"type\":\"plain\",\"value\":\"att2name\"},{\"name\":\"att3\",\"type\":\"plain\",\"value\":\"5\"}]"
}

Example Responses

Status code: 200

ABE user key order information.

{
  "applyer" : "did:hwid:mfqqdiW8V64JbPFgQsoiv",
  "applyerName" : "",
  "provider" : "did:hwid:FahQr32NgQZWjGRiCZc37C",
  "providerName" : "",
  "service" : "",
  "price" : 0,
  "applyTime" : "",
  "encryptedABEKey" : "",
  "status" : "ready",
  "reason" : "",
  "lockProof" : "",
  "attributesJson" : "[{\"name\":\"att3\",\"type\":\"comparable\",\"value\":\"3\",\"maxValue\":\"1000\"}]"
}

Status code: 500

Error response.

{
  "errorCode" : "BCS.5002046",
  "errorMsg" : "Incorrect number of arguments"
}

Status Codes

Status Code

Description

200

ABE user key order information.

500

Error response.

Error Codes

See Error Codes.