Creating a Pre-Shared Key

Description

This API is used to create a pre-shared key. After the pre-shared key is created, it is bound to the master key and returned to the user immediately. The pre-shared key cannot be obtained from AI-VAULT again. The pre-shared key returned to the user has been encrypted using a password.

URL

POST https://ip:port/AIVAULT/v1/createPSK

Request Header

Table 1 Request header

Parameter

Type

Description

DomainID

UInt

Key domain ID, which indicates the domain of an organization, an application, or a model. The value ranges from 1 to 500.

  1. Parameters in this request header are set by users.
  2. Domain IDs are used to differentiate applications or models. A maximum of 500 domains are supported.

Request Parameters

Table 2 Request parameters

Parameter

Mandatory/Optional

Type

Description

PSKName

Mandatory

String

Pre-shared key name, which must be unique under the same domain ID. The value contains 1 to 128 characters, allowing only digits, letters, underscores (_), and hyphens (-).

MKName

Mandatory

String

Master key name, which must be unique in the same domain. It contains 1 to 128 characters, allowing only digits, letters, underscores (_), and hyphens (-).

PSKRemarks

Optional

String

Remarks. The value contains a maximum of 256 characters, allowing only digits, letters, spaces, underscores (_), and hyphens (-).

Password

Mandatory

String

User password. The password must contain 40 to 64 characters and contain at least two types of the following characters: digits, uppercase letters, lowercase letters, and special characters. The password cannot be the same as PSKName or PSKName in reverse order.

Request Example

https://ip:port/AIVAULT/v1/createPSK
{
    "PSKName":"test",
    "MKName":"test",
    "PSKRemarks":"test",
    "Password":"******"
}

Response Description

Table 3 Responses

Level-1 Parameter

Level-2 Parameter

Type

Description

status

\

String

Error code

msg

\

String

Error message

data

\

Object

Packet list

\

PSK

String

Pre-shared key ciphertext

Response Example

{
    "status":"00000000",
    "msg":"ok",
    "data":{
          "PSK":    "******"
}

For details about the error codes, see Error Codes.

For details about the status codes, see Status Codes.