CreateClientCertificate

Updated at:

Issues a single client certificate based on a system-generated certificate signing request (CSR).

Operation description

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

QPS limits

The QPS limit for a single user is 10 queries per second. If the limit is exceeded, API calls are throttled, which may affect your services. Call this operation at a reasonable frequency.

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

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

SanType

integer

No

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

  • 1: Email address.

  • 6: Uniform Resource Identifier (URI).

1

SanValue

string

No

The specific extension information of the client certificate. You can specify multiple extensions. Separate multiple extensions with commas (,).

somebody@example.com

Organization

string

No

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

Alibaba Cloud

OrganizationUnit

string

No

The name of the organizational unit. Default value: Aliyun CDN.

IT

Country

string

No

The country or region. Default value: CN.

CN

CommonName

string

No

The name of the certificate subject. The subject of a client authentication certificate is typically a natural person, company, organization, or application. Enter the common name of the subject. Examples: Zhang San, Alibaba, Alibaba Cloud Cryptography Platform, and Tmall Genie.

aliyun

State

string

No

The name of the province, municipality, or autonomous region where the organization is located. Chinese and English characters are supported. The default value is the name of the province, municipality, or autonomous region where the organization of the subordinate CA certificate that issues the certificate is located.

Zhejiang

Locality

string

No

The name of the city where the organization is located. Chinese and English characters are supported. The default value is the name of the city where the organization of the subordinate CA certificate that issues the 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: Corresponds to the Sha256WithRSA signature algorithm.

  • RSA_2048: Corresponds to the Sha256WithRSA signature algorithm.

  • RSA_4096: Corresponds to the Sha256WithRSA signature algorithm.

  • ECC_256: Corresponds to the Sha256WithECDSA signature algorithm.

  • ECC_384: Corresponds to the Sha256WithECDSA signature algorithm.

  • ECC_512: Corresponds to the Sha256WithECDSA signature algorithm.

  • SM2_256: Corresponds to the SM3WithSM2 signature algorithm.

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 RSA_1024, RSA_2048, or RSA_4096.

Note

You can 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 certificate. The private CA instance (PrivateCaInstanceId) bound to the subordinate CA must be valid and not expired.

Note

You can call [DescribeCACertificateList] to query the unique identifier of the subordinate CA certificate.

273ae6bb538d538c70c01f81jh2****

Years

integer

No

The purchase duration of the certificate. Unit: years.

5

Months

integer

No

The purchase duration of the certificate. Unit: months.

1

Days

integer

No

The validity period of the client certificate. Unit: days. The Days, BeforeTime, and AfterTime parameters cannot be left empty at the same time. The BeforeTime and AfterTime parameters must be both empty or both specified. The configuration instructions are as follows:

  • If you specify the Days parameter, you can choose to specify both the BeforeTime and AfterTime parameters or leave them empty.

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

Note
  • If you specify the Days, BeforeTime, and AfterTime parameters at the same time, the validity period of the client certificate is subject to the value of the Days parameter.

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

365

BeforeTime

integer

No

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

Note

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

1634283958

AfterTime

integer

No

The expiration time of the client certificate. The value is a UNIX timestamp. Unit: seconds.

Note

The BeforeTime and AfterTime parameters must be both empty or both 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) URL. Valid values:

  • 0: No.

  • 1: Yes.

1

Tags

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The tag key.

account

Value

string

No

The tag value.

1

ResourceGroupId

string

No

The ID of the resource group.

rg-aek****wia

CustomIdentifier

string

No

The custom identifier, which serves as a unique key.

****6bb538d538c70c01f81jh2****

AliasName

string

No

The name of the issued certificate.

cert-name

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

create-client-cert-20261110-3a8f6c1d

AsynchronousFlag

boolean

No

The asynchronous processing flag. If you set this parameter to true, the backend service applies for 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 the common request parameters of Alibaba Cloud APIs in addition to the operation-specific request parameters.

For more information about the request format, see the request examples in the Examples section.

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.

190ae6bb538d538c70c01f81dcf2****

SerialNumber

string

The certificate serial number.

084bde9cd233f0ddae33adc438cfbbbd****

RequestId

string

The ID of the request, which is a unique identifier generated by Alibaba Cloud for the request. You can use the ID to troubleshoot issues.

8C467B38-3910-447D-87BC-AC049166F216

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": "190ae6bb538d538c70c01f81dcf2****",
  "SerialNumber": "084bde9cd233f0ddae33adc438cfbbbd****",
  "RequestId": "8C467B38-3910-447D-87BC-AC049166F216"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.