DescribeCertificatePrivateKey
Retrieves the private key (in encrypted format) of a single client certificate or server certificate.
Operation description
This operation applies only to certificates issued based on a system-generated certificate signing request (CSR). It is used to retrieve the private key (in encrypted format) of a client certificate or server certificate. Before you call this operation, you must call one of the following operations to issue a client certificate or server certificate:
To ensure the security of the private key during transmission, this operation encrypts the private key by using a private key password (an encryption string) that you specify, and returns the encrypted private key. After you obtain the private key in encrypted format, you can decrypt the private key by using one of the following methods:
If the encryption algorithm of the certificate is RSA, run the
openssl rsa -in <Encrypted private key file> -passin pass:<Private key password> -out <Decrypted private key file>command on a computer where OpenSSL or BabaSSL is installed to decrypt the private key.If the encryption algorithm of the certificate is ECC, run the
openssl ec -in <Encrypted private key file> -passin pass:<Private key password> -out <Decrypted private key file>command on a computer where OpenSSL or BabaSSL is installed to decrypt the private key.If the encryption algorithm of the certificate is SM2, run the
openssl ec -in <Encrypted private key file> -passin pass:<Private key password> -out <Decrypted private key file>command on a computer where BabaSSL is installed to decrypt the private key.
You can call the DescribeClientCertificate operation to query the encryption algorithm type of the client certificate or server certificate.
QPS limit
The queries per second (QPS) limit on this operation is 10 per user. If the limit is exceeded, API calls are throttled, which may affect your business. Call this operation as needed.
Try it now
Test
RAM authorization
|
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 certificate or server certificate whose private key you want to retrieve. Note
You can call the ListClientCertificate operation to query the unique identifiers of all client and server certificates. END_ENTITY certificates are not supported by this operation. If you pass the identifier of an END_ENTITY certificate, NotFound is returned. The private keys of some CLIENT or SERVER certificates cannot be exported due to isolation policies. In this case, OperationDenied.NotSupport is returned. We recommend that you filter out END_ENTITY certificates based on the CertificateType parameter in the response of the ListClientCertificate operation before you call this operation. |
bc37133bb7ed68c7938d928fd26d**** |
| EncryptedCode |
string |
Yes |
The password used to encrypt the private key. It can contain uppercase letters, lowercase letters, digits, and special characters such as Warning Remember the password that you specify. You will need this password to decrypt the private key in encrypted format. If you forget the password, you cannot decrypt the private key obtained in this call, and you must call this operation again.
|
!Demo@WS3ed |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the certificate belongs. |
test |
In addition to the operation-specific request parameters described in this topic, you must also include the common request parameters of Alibaba Cloud API.
For more information about the request format, see the Examples section in this topic.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The GetCertificatePrivateKeyResponse. |
||
| EncryptedData |
string |
The content of the encrypted 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.