All Products
Search
Document Center

Certificate Management Service:CreateServerCertificateWithCsr

Last Updated:Aug 19, 2026

Issues a single server certificate based on a custom 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 server certificates.

QPS limit

The single-user QPS limit for this operation is 10 calls per second. If the limit is exceeded, the API call is throttled, which may affect your business. Call this operation appropriately.

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

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Csr

string

Yes

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

Domain

string

No

The extended domain name or extended IP address of the server certificate. After you add extended information to the certificate, you can apply the certificate to multiple domain names or IP addresses.

You can enter multiple domain names and IP addresses at the same time. Separate multiple values with commas (,).

example.com

Organization

string

No

The organization name. Default value: Alibaba Inc.

Alibaba Cloud

OrganizationUnit

string

No

The department name. Default value: Aliyun CDN.

IT

Country

string

No

The country code, such as CN.

CN

CommonName

string

No

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

Note

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

mtcsq.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 organization of the sub-CA certificate 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 organization of the sub-CA certificate that issues this certificate is located.

Hangzhou

Algorithm

string

No

The key algorithm of the server 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 server 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 server certificate must be 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

Yes

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.

270oe6bb538d538c70c01f81hfd3****

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 server certificate. Unit: days. The Days, BeforeTime, and AfterTime parameters cannot all be empty, and the BeforeTime and AfterTime parameters must both be empty or both be set. The following describes how to set this parameter:

  • 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 server certificate is determined by the value of the Days parameter.

  • The validity period of the server 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 server certificate in 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 set.

1634283958

AfterTime

integer

No

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

Note

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

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 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.

account

Value

string

No

The tag value.

test

ResourceGroupId

string

No

The resource group ID.

rg-aek****wia

CustomIdentifier

string

No

The custom identifier, which is a unique key.

***e6bb538d538c70c01f81hfd3****

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 example in the Examples section of this topic.

Response elements

Element

Type

Description

Example

object

CreateCertificateResponse

X509Certificate

string

The content of the server 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 server certificate.

180ae6bb538d538c70c01f81dcf2****

SerialNumber

string

The certificate serial number.

084bde9cd233f0ddae33adc438cfbbbd****

RequestId

string

The request ID. Alibaba Cloud generates a unique identifier for each request. You can use the request ID to troubleshoot issues.

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

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": "180ae6bb538d538c70c01f81dcf2****",
  "SerialNumber": "084bde9cd233f0ddae33adc438cfbbbd****",
  "RequestId": "55C66C7B-671A-4297-9187-2C4477247A74"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.