You need to enable JavaScript to run this app.
Key Management System

Key Management System

Copy page
Download PDF
Key management
GetPublicKey - get the public key of the specified asymmetric key
Copy page
Download PDF
GetPublicKey - get the public key of the specified asymmetric key

Get the public key of the specified asymmetric key

Debug

Request parameters

The table below lists only the unique request parameters of this interface and some common parameters. For more information, see common parameters.

Parameter
Type
Required
Example value
Description
Action
String
yes

GetPublicKey

the action to perform, value: GetPublicKey.

Version
String
yes

2021-02-18

API version, value: 2021-02-18.

KeyringName
String
No

keyring-test

Keyring name, length 2 - 31 characters. Valid characters: [a-zA-Z0-9-_]

KeyName
String
No

key-test

Primary key name, length 2 - 31 characters. Valid characters: [a-zA-Z0-9-_]

KeyID
String
No

39a0e7c6-b7dd-4c83-b400-3449bb95403a

Primary key ID, choose one of two options:
KeyringName and KeyName
KeyID

response parameters

The following table lists only the response parameters unique to this interface. For more information, see response structure.

const columns = [ 
  { 
    width: '25%', 
title: 'Parameter', 
    dataIndex: 'Name', 
    className: 'openapi-doc-parameter-table-name', 
  }, 
  { 
    width: 130, 
title: 'Type', 
    dataIndex: 'DataType', 
    className: 'openapi-doc-parameter-table-type' 
  }, 
  { 
    width: '25%', 
title: 'Example Value', 
    dataIndex: 'Example', 
    className: 'openapi-doc-parameter-table-example' 
  }, 
  { 
title: 'Description', 
    dataIndex: 'Description', 
    className: 'openapi-doc-parameter-table-description' 
  }, 
]; 

const data = [ 
  { 
    rowKey: "->KeyID", 
    Name: "KeyID", 
    DataType: "String", 
    Example: <RenderMd content={"39a0e7c6-b7dd-4c83-b400-3449bb95403a"} />, 
Description: <RenderMd content={"Unique identifier of the main key, in UUID format"} /> 
    children: [ 
    ] 
  }, 
  { 
    rowKey: "->PublicKey", 
    Name: "PublicKey", 
    DataType: "String", 
    Example: <RenderMd content={"MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEy1ywbEU17uqak8PNqv54BDdtE7+n CGXuj8nKmhPNl3AmN8z2roAowQYORs4JTTfmmLq0jvIU0hBCsSS3aY=="} />, 
Description: <RenderMd content={"Public key in PEM format.\n-----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEy1ywbEU17uqak8PNqv54BDdtE7+n CGXuj8nKmhPNl3AmN8z2roAowQYORs4JTTfmmLq0jvIU0hBCsSS3aY****== -----END PUBLIC KEY-----"} />, 
    children: [ 
    ] 
  }, 
]; 

return (<Table 
  rowKey="rowKey" 
  className="openapi-doc-parameter-table" 
  columns={columns} 
  data={data} 
  border={ { cell: true, wrapper: true } } 
  scroll={ { x: "auto" } } 
  pagination={false} 
/>);

Request example

GET /?Action=GetPublicKey&Version=2021-02-18&KeyringName=demo&KeyName=demo HTTP/1.1 
Host: kms.cn-beijing.volcengineapi.com 
X-Date: 20240709T013058Z 
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240709/cn-beijing/kms/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f


Response example

{ 
  "ResponseMetadata": { 
    "RequestId": "20240709093134130030112119297E09", 
    "Action": "GetPublicKey", 
    "Version": "2021-02-18", 
    "Service": "kms", 
    "Region": "cn-beijing" 
  }, 
  "Result": { 
    "KeyID": "39a0e7c6-b7dd-4c83-b400-3449bb95403a", 
    "PublicKey": "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEy1ywbEU17uqak8PNqv54BDdtE7+n CGXuj8nKmhPNl3AmN8z2roAowQYORs4JTTfmmLq0jvIU0hBCsSS3aY==", 
  } 
}

Error codes

The following table lists error codes related to this interface and business logic. For common error codes, see the Common Error Codes document.

Status Code
Error Code
Error Message
Description
400
MissingParameter

The request is missing %s parameter.

400
InvalidParameter

The request parameter %s is invalid.

403
AccessDenied

User is not authorized to do this action

403
Reject.Throttling.CMK

The request of CMK: %s upper limit is exceeded.

404
Not Found

Not found %s [%s].

500
UndefinedError

Undefined Internal Error. Pls Contact With Admin.

Last updated: 2025.06.27 15:24:17