Use this API operation to retrieve a public key ID and its value.
HTTP API call
Description
Before encrypting the value of the input field, call this operation to obtain the latest supported public key ID and its value.
Prerequisites
- You have activated Alibaba Cloud Model Studio and obtained an API key. For more information, see Obtain and configure an API key.
- Set the API key as an environment variable to reduce the threat of key leakage. For instructions, see Set an API key as an environment variable (to be unpublished and merged into "Get and configure an API key"). You can also configure the API key in your code, but this increases the threat of leakage.
API call
Request parameters
Parameter passing | Field | Data type | Required | Description | Example |
|---|---|---|---|---|---|
Header | Authorization | String | Yes | The API key for authentication. | "Authorization":"Bearer d1**2a" |
Response parameters
Field | Data type | Required | Description |
|---|---|---|---|
request_id | String | Yes | The request ID. |
public_key | String | No | The value of the RSA public key. |
public_key_id | String | No | The ID of the RSA public key. |
Error response parameters
Name | Type | Required | Description |
|---|---|---|---|
request_id | String | Yes | The request ID. |
code | String | No | The error code and error message. For more information, see Error messages. |
message | String | No |
Request example
- curl
- Python SDK