All Products
Search
Document Center

Certificate Management Service:CreateClientCertificateWithCsr

Last Updated:Dec 24, 2025

Issues a client certificate based on a custom certificate signing request (CSR).

Operation description

Before you call this operation, you must create a root CA certificate by calling CreateRootCACertificate and a subordinate CA certificate by calling CreateSubCACertificate. Only subordinate CA certificates can issue client certificates.

QPS limit

This operation is limited to 10 queries per second (QPS) per user. If you exceed this limit, the system throttles your API calls, which may affect your business. We recommend that you plan your calls to avoid being throttled.

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:CreateClientCertificateWithCsr

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Csr

string

No

The content of the certificate signing request (CSR). Use OpenSSL or Keytool to generate a CSR. For more information, see Create a CSR file.

-----BEGIN CERTIFICATE REQUEST----- ...... -----END CERTIFICATE REQUEST-----

SanType

integer

No

The type of the Subject Alternative Name (SAN) extension for the client certificate. Valid values:

  • 1: Email address.

  • 6: Uniform Resource Identifier (URI).

1

SanValue

string

No

The extension for the client certificate. To specify multiple extensions, separate them with a comma.

somebody@example.com

Organization

string

No

The name of the organization. Default value: Alibaba Inc.

阿里云计算有限公司

OrganizationUnit

string

No

The name of the department. Default value: Alibaba Cloud CDN.

Security

Country

string

No

The country code, for example, CN or US.

CN

CommonName

string

No

The common name of the certificate. Chinese and English characters are supported.

Note

If you specify the Csr parameter, the value of this parameter is determined by the information in the Csr parameter.

aliyundoc.com

State

string

No

Specify the name of the province or state where the certificate organization is located. The value can contain letters. The default value is the name of the province or state of the intermediate CA's organization.

Zhejiang

Locality

string

No

The name of the city where the organization is located. Chinese and English characters are supported. By default, this parameter uses the city name of the organization that is associated with the issuing subordinate CA certificate.

Hangzhou

Algorithm

string

No

The key algorithm of the client certificate. The key algorithm is in the <Encryption algorithm>_<Key length> format. Valid values:

  • RSA_1024: The corresponding signature algorithm is Sha256WithRSA.

  • RSA_2048: The corresponding signature algorithm is Sha256WithRSA.

  • RSA_4096: The corresponding signature algorithm is Sha256WithRSA.

  • ECC_256: The corresponding signature algorithm is Sha256WithECDSA.

  • ECC_384: The corresponding signature algorithm is Sha256WithECDSA.

  • ECC_512: The corresponding signature algorithm is Sha256WithECDSA.

  • SM2_256: The corresponding signature algorithm is SM3WithSM2.

The encryption algorithm of the client certificate must be the same as that of the subordinate CA certificate, but the key length can be different. For example, if the key algorithm of the subordinate CA certificate is RSA_2048, the key algorithm of the client certificate must be one of RSA_1024, RSA_2048, and RSA_4096.

Note

Call DescribeCACertificate to query the key algorithm of the subordinate CA certificate.

RSA_2048

ParentIdentifier

string

No

The unique identifier of the subordinate CA certificate that issues the client certificate.

Note

Call DescribeCACertificateList to query the unique identifiers of subordinate CA certificates.

270ae6bb538d538c70c01f81fg3****

Years

integer

No

The validity period of the certificate, in years.

1

Months

integer

No

The validity period of the certificate, in months.

12

Days

integer

No

The validity period of the client certificate, in days. You must specify the validity period using one of the following methods:

  • Specify the Days parameter.

  • Specify both the BeforeTime and AfterTime parameters.

Note
  • If you specify Days, BeforeTime, and AfterTime at the same time, the value of Days is used.

  • The validity period of the client certificate cannot exceed that of the subordinate CA certificate. Call DescribeCACertificate to view the validity period of the subordinate CA certificate.

365

BeforeTime

integer

No

The issuance time of the client certificate. This is a UNIX timestamp in seconds. The default value is the time of the API call.

Note

The BeforeTime and AfterTime parameters must be specified together or left empty.

1634283958

AfterTime

integer

No

The expiration time of the client certificate. This is a UNIX timestamp in seconds.

Note

Specify the BeforeTime and AfterTime parameters together, or omit both.

1665819958

Immediately

integer

No

Specifies whether to return the digital certificate.

  • 0: Do not return the certificate. This is the default value.

  • 1: Return the certificate.

  • 2: Return the certificate and its certificate chain.

1

EnableCrl

integer

No

Specifies whether to include the Certificate Revocation List (CRL) address.

0: No

1: Yes

1

Tags

array<object>

No

A list of tags.

object

No

A list of tags.

Key

string

No

The tag key.

database

Value

string

No

The value of the tag.

1

ResourceGroupId

string

No

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

rg-ae******4wia

CustomIdentifier

string

No

A custom identifier. This is a unique key.

***e6bb538d538c70c01f81fg3****

In addition to the parameters described in this topic, you must also specify common request parameters when you call this operation.

For the request format, see the request example in the Examples section of this topic.

Response elements

Element

Type

Description

Example

object

CreateCertificateResponse

X509Certificate

string

The content of the client certificate.

-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----

CertificateChain

string

The CA certificate chain.

-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----\n

Identifier

string

The unique identifier of the client certificate.

200ae6bb538d538c70c01f81dcf2****

SerialNumber

string

The certificate serial number.

084bde9cd233f0ddae33adc438cfbbbd****

RequestId

string

The ID of the request. This ID is a unique identifier generated by Alibaba Cloud for the request. You can use it to troubleshoot and locate issues.

31C66C7B-671A-4297-9187-2C4477247A74

CertSignBufKmc

string

The encrypted content of the certificate.

MIIDYDCCAwWgAwIBAgIU *** TmTk0CS3WNweqsjMEETyxd2pzU6DA

CertKmcRep1

string

The ciphertext of the encrypted certificate.

userSeal=MHkCIEu94PQAahFWuFk% *** EtFw%2FkMMBjw8i5bFfSkV%2FIUrcOJD

Examples

Success response

JSON format

{
  "X509Certificate": "-----BEGIN CERTIFICATE-----\\n......\\n-----END CERTIFICATE-----",
  "CertificateChain": "-----BEGIN CERTIFICATE-----\\n......\\n-----END CERTIFICATE-----\\n-----BEGIN CERTIFICATE-----\\n......\\n-----END CERTIFICATE-----\\n",
  "Identifier": "200ae6bb538d538c70c01f81dcf2****",
  "SerialNumber": "084bde9cd233f0ddae33adc438cfbbbd****",
  "RequestId": "31C66C7B-671A-4297-9187-2C4477247A74",
  "CertSignBufKmc": "MIIDYDCCAwWgAwIBAgIU\n***\nTmTk0CS3WNweqsjMEETyxd2pzU6DA",
  "CertKmcRep1": "userSeal=MHkCIEu94PQAahFWuFk%\n***\nEtFw%2FkMMBjw8i5bFfSkV%2FIUrcOJD"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.