All Products
Search
Document Center

Certificate Management Service:CreateClientCertificateWithCsr

Last Updated:Aug 24, 2026

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

Operation description

Before you call this operation, you must have called CreateRootCACertificate to create a root CA certificate and called CreateSubCACertificate to create a sub-CA certificate. Only sub-CA certificates can issue client certificates.

QPS limit

The single-user QPS limit for this operation is 10 calls per second. If the number of calls per second exceeds the limit, throttling is triggered. This may affect your business. Call this operation as appropriate.

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 CSR content. You can use OpenSSL or Keytool to generate a CSR. For more information, see How do I create a CSR file.

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

SanType

integer

No

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

  • 0: otherName (0): other name.

  • 1: rfc822Name (1): RFC 822 name, which is typically an email address.

  • 2: dNSName (2): DNS name (domain name).

  • 3: x400Address (3): X.400 address, an early email standard address.

  • 4: directoryName (4): directory name, which is typically an X.500 distinguished name (DN).

  • 5: ediPartyName (5): Electronic Data Interchange (EDI) party name.

  • 6: uniformResourceIdentifier (6): Uniform Resource Identifier (URI).

  • 7: iPAddress (7): IP address.

  • 8: registeredID (8): registered ID (Object Identifier, OID).

2

SanValue

string

No

The specific SAN extension information of the client certificate. You can enter multiple values separated by commas (,).

  1. otherName (0): other name

  • Example: 1.3.6.1.4.1.311.20.2.3 (OID) + user@domain.com (UPN, User Principal Name)

  • Description: A custom extension type that typically consists of a specific OID (Object Identifier) and a corresponding value. In Windows environments, it is commonly used to store UPN (User Principal Name), such as zhangsan@company.com for smart card logon.

  1. rfc822Name (1): RFC 822 name (email address)

  • Example: admin@example.com,support@company.cn

  • Description: An Internet email address that complies with the RFC 822 standard. It is commonly used in S/MIME email signing and encryption certificates to identify the sender or recipient of an email.

  • dNSName (2): DNS name (domain name)

  • Example: www.example.com,api.test.cn,*.mydomain.com (wildcard domain name)

  • Description: The most commonly used type in HTTPS website SSL/TLS certificates. A certificate can contain multiple DNS names through the SAN extension, allowing a single certificate to protect multiple subdomains or completely different domain names.

  1. x400Address (3): X.400 address

  • Example: G=Zhang; S=San; O=Company; PRMD=IT; ADMD=Telecom; C=CN

  • Description: An early email system address standard with a complex structure that includes attributes such as country (C), administration domain (ADMD), organization (O), surname (S), and given name (G). It is rarely used in modern Internet HTTPS certificates and is mostly found in traditional European government, enterprise, or military communication systems.

  1. directoryName (4): directory name

  • Example: CN=IT Department, OU=Tech, O=Company Ltd, L=Beijing, ST=Beijing, C=CN

  • Description: A standard X.500 distinguished name (DN). It is typically used to explicitly identify the full hierarchical information of an organization, department, or entity in a certificate. It is commonly found in enterprise internal root certificates or specific government digital certificates.

  1. ediPartyName (5): EDI party name

  • Example: nameAssigner=GlobalTradeOrg, partyName=SupplierA

  • Description: Used specifically in the Electronic Data Interchange (EDI) domain. It identifies a specific party in business message exchanges (such as order and invoice transmissions) and typically includes the name-assigning authority (nameAssigner) and the party name (partyName).

  1. uniformResourceIdentifier (6): Uniform Resource Identifier (URI)

  • Example: http://www.example.com/verify,https://api.test.cn/status

  • Description: A standard URL format that must include a protocol prefix (such as http:// or https://). It can point to a specific network resource address.

  1. iPAddress (7): IP address

  • Example: 192.168.1.100 (IPv4), 2001:0db8:85a3::8a2e:0370:7334 (IPv6)

  • Description: Directly binds to a server IP address. It is commonly used for internal systems without domain names, API servers, or specific services that can only be accessed through a public IP address. Note: Public IP certificates typically require strict Organization Validation (OV).

  1. registeredID (8): registered ID (Object Identifier, OID)

  • Example: 1.2.3.4.55.6.5.99, 2.5.29.17

  • Description: A unique numeric identifier assigned by international standards organizations. It is rarely used directly as a subject name in certificates and is more commonly used as a unique identity code or policy identifier within systems.

somebody@example.com

Organization

string

No

The organization name. Default value: Alibaba Inc.

Alibaba Inc

OrganizationUnit

string

No

The organizational unit name. Default value: Aliyun CDN.

Security

Country

string

No

The country code. Example: CN or US.

CN

CommonName

string

No

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

Note

If you set the CsrPemString parameter, the value of the CommonName parameter is determined by the corresponding information in the CsrPemString parameter.

aliyundoc.com

State

string

No

The name of the province or state where the certificate organization is located. Chinese characters, English characters, and other characters are supported. The default value is the name of the province or state where the sub-CA certificate organization that issues this certificate is located.

Zhejiang

Locality

string

No

The name of the city where the certificate organization is located. Chinese characters, English characters, and other characters are supported. The default value is the name of the city where the sub-CA certificate organization that issues this certificate is located.

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 signature algorithm is Sha256WithRSA.

  • RSA_2048: The signature algorithm is Sha256WithRSA.

  • RSA_4096: The signature algorithm is Sha256WithRSA.

  • ECC_256: The signature algorithm is Sha256WithECDSA.

  • ECC_384: The signature algorithm is Sha256WithECDSA.

  • ECC_512: The signature algorithm is Sha256WithECDSA.

  • SM2_256: The signature algorithm is SM3WithSM2.

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

Note

You can call DescribeCACertificate to query the key algorithm of the sub-CA certificate.

RSA_2048

ParentIdentifier

string

No

The unique identifier of the sub-CA certificate that issues this certificate.

Note

You can call DescribeCACertificateList to query the unique identifier of the sub-CA certificate.

270ae6bb538d538c70c01f81fg3****

Years

integer

No

The certificate validity period. Unit: years.

1

Months

integer

No

The certificate validity period. Unit: months.

12

Days

integer

No

The validity period of the client certificate. Unit: days. The Days, BeforeTime, and AfterTime parameters cannot all be empty. The BeforeTime and AfterTime parameters must both be empty or both be specified. The following rules apply:

  • If you set the Days parameter, you can choose to set or not set the BeforeTime and AfterTime parameters.

  • If you do not set the Days parameter, you must set the BeforeTime and AfterTime parameters.

Note
  • If you set the Days, BeforeTime, and AfterTime parameters at the same time, the validity period of the client certificate is determined by the value of the Days parameter.

  • The validity period of the client certificate cannot exceed the validity period of the sub-CA certificate. You can call DescribeCACertificate to view the validity period of the sub-CA certificate.

365

BeforeTime

integer

No

The issuance time of the client certificate in UNIX timestamp format. The default value is the time when you call this operation. Unit: seconds.

Note

The BeforeTime and AfterTime parameters must both be empty or both be specified.

1634283958

AfterTime

integer

No

The expiration time of the client certificate in UNIX timestamp format. Unit: seconds.

Note

The BeforeTime and AfterTime parameters must both be empty or both be specified.

1665819958

Immediately

integer

No

Specifies whether to immediately return the digital certificate. Valid values:

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

  • 1: returns the certificate.

  • 2: returns the certificate and its certificate chain.

1

EnableCrl

integer

No

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

  • 0: no.

  • 1: yes.

1

Tags

array<object>

No

The tag list.

object

No

The tag list.

Key

string

No

The tag key.

database

Value

string

No

The tag value.

1

ResourceGroupId

string

No

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

rg-ae******4wia

CustomIdentifier

string

No

The custom identifier, which serves as a unique key.

***e6bb538d538c70c01f81fg3****

AsynchronousFlag

boolean

No

The asynchronous processing flag. If the value is "true", the backend service issues the certificate asynchronously. After the request is submitted, you can call the ListClientCertificate operation to obtain the latest certificate.

false

When you call this operation, you must include common request parameters of Alibaba Cloud APIs in addition to the request parameters described in this topic.

For the request format, see the request examples 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 request ID. Alibaba Cloud generates a unique identifier for each API request. You can use this ID to troubleshoot issues.

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

CertSignBufKmc

string

The encrypted certificate content.

MIIDYDCCAwWgAwIBAgIU *** TmTk0CS3WNweqsjMEETyxd2pzU6DA

CertKmcRep1

string

The encrypted certificate ciphertext.

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.