Updated on 2026-10-12 GMT+08:00

Creating a PIN

Function

This API is used to create a PIN, which is used to create and encrypt a DEK in the level-4 cryptography testing scenario.

Calling Method

For details, see Calling APIs.

URI

POST /v1.0/{project_id}/kms/create-pin

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

The value returned by the IAM API is used, which contains 32 characters.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

Obtain the value by calling the IAM API for obtaining the user token.

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

pin_type

No

String

Definition

PIN code type

Constraints

N/A

Range

  • PlainText

  • CipherText

Default Value

CipherText

keystore_id

No

String

Definition

Keystore ID. This parameter is mandatory when the ciphertext PIN is specified.

Constraints

N/A

Range

1: shared manage_az cluster on the management plane

2: shared cluster on the data plane (POD zone)

Others: exclusive to tenants

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

pin

String

Definition

Created PIN

Range

N/A

Example Requests

Specify the shared cluster on the management plane to create a PIN. The ciphertext PIN is returned.

{
  "pin_type" : "CipherText",
  "keystore_id" : "1"
}

Example Responses

Status code: 200

{
  "pin" : "020098009EEAFCE122CAA5927D2XXX..."
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.