All Products
Search
Document Center

Certificate Management Service:DescribeCertificatePrivateKey

Last Updated:Dec 17, 2025

Retrieves the encrypted private key of a single client certificate or server-side certificate.

Operation description

This API applies only to certificates that are issued from a system-generated Certificate Signing Request (CSR). You can use this API to retrieve the encrypted private key of a client certificate or a server-side certificate. Before you call this API, you must have issued a client or server-side certificate by calling one of the following APIs:

To keep the private key secure during transmission, this API uses a password that you set to encrypt the private key. The API then returns the encrypted private key. After you retrieve the encrypted private key, you can decrypt it using one of the following methods:

  • If the certificate uses the RSA encryption algorithm, run the openssl rsa -in <encrypted_private_key_file> -passin pass:<private_key_password> -out <decrypted_private_key_file> command to decrypt the private key. You must run this command on a computer that has OpenSSL or BabaSSL installed.

  • If the certificate uses the ECC encryption algorithm, run the openssl ec -in <encrypted_private_key_file> -passin pass:<private_key_password> -out <decrypted_private_key_file> command to decrypt the private key. You must run this command on a computer that has OpenSSL or BabaSSL installed.

  • If the certificate uses the SM2 encryption algorithm, run the openssl ec -in <encrypted_private_key_file> -passin pass:<private_key_password> -out <decrypted_private_key_file> command to decrypt the private key. You must run this command on a computer that has BabaSSL installed.

Note

You can call DescribeClientCertificate to query the encryption algorithm of the client or server-side certificate.

QPS limit

This API has a queries per second (QPS) limit of 10 for each user. If you exceed this limit, your API calls are throttled. Throttling can affect your business. Plan your calls accordingly.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-cert:DescribeCertificatePrivateKey

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Identifier

string

Yes

The unique identifier of the client or server-side certificate for which you want to get the private key.

Note

Call ListClientCertificate to query the unique identifiers of all client and server-side certificates.

bc37133bb7ed68c7938d928fd26d****

EncryptedCode

string

Yes

The password to encrypt the private key. The password can contain uppercase letters, lowercase letters, digits, and special characters, such as ,.+-_#. The maximum length is 32 bytes.

Warning Remember the password you set. You need this password to decrypt the encrypted private key. If you forget the password, you cannot decrypt the private key that you get from this API call. You must call this API again to get a new encrypted key.

!Demo@WS3ed

ResourceGroupId

string

No

The ID of the resource group to which the certificate belongs.

test

In addition to the API-specific request parameters in this topic, you must specify common request parameters when you make an API call.

For the request format, see the request example in the Examples section.

Response elements

Element

Type

Description

Example

object

GetCertificatePrivateKeyResponse.

EncryptedData

string

The encrypted content of the private key.

-----BEGIN ENCRYPTED PRIVATE KEY----- …… -----END ENCRYPTED PRIVATE KEY-----

RequestId

string

The ID of the request.

09470F19-CEE8-5C63-BF2C-02B5E3F07A17

Examples

Success response

JSON format

{
  "EncryptedData": "-----BEGIN ENCRYPTED PRIVATE KEY----- …… -----END ENCRYPTED PRIVATE KEY-----",
  "RequestId": "09470F19-CEE8-5C63-BF2C-02B5E3F07A17"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.