All Products
Search
Document Center

Certificate Management Service:CreateClientCertificate

Last Updated:Jul 09, 2024

Issues a client certificate by using a system-generated certificate signing request (CSR) file.

Operation description

Before you call this operation, make sure that you have created a root certificate authority (CA) certificate by calling the CreateRootCACertificate operation and an intermediate CA certificate by calling the CreateSubCACertificate operation. Only intermediate CA certificates can issue client certificates.

QPS limits

You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
SanTypeintegerNo

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

  • 1: an email address
  • 6: a Uniform Resource Identifier (URI)
1
SanValuestringNo

The content of the extension. You can specify multiple SAN extensions. If you want to specify multiple SAN extensions, separate them with commas (,).

somebody@example.com
OrganizationstringNo

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

Alibaba Cloud
OrganizationUnitstringNo

The name of the department. Default value: Aliyun CDN.

IT
CountrystringNo

The country in which the organization is located. Default value: CN.

CN
CommonNamestringNo

The name of the client certificate user. In most cases, the user of a client certificate is an individual, a company, an organization, or an application. We recommend that you enter the common name of a user. Examples: Bob, Alibaba, Alibaba Cloud password platform, and Tmall Genie.

aliyun
StatestringNo

The province, municipality, or autonomous region in which the organization is located. The value can contain letters. The default value is the name of the province, municipality, or autonomous region in which the organization is located. The organization is associated with the intermediate CA certificate from which the certificate is issued.

Zhejiang
LocalitystringNo

The name of the city in which the organization is located. The value can contain letters. The default value is the name of the city in which the organization is located. The organization is associated with the intermediate CA certificate from which the certificate is issued.

Hangzhou
AlgorithmstringNo

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 with the encryption algorithm of the intermediate certificate authority (CA) certificate. The key length can be different. For example, if the key algorithm of the intermediate 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 the [DescribeCACertificate] operation to query the key algorithm of an intermediate CA certificate.
RSA_2048
ParentIdentifierstringNo

The unique identifier of the intermediate CA certificate from which the server certificate is issued.

Note You can call the [DescribeCACertificateList] operation to query the unique identifier of an intermediate CA certificate.
273ae6bb538d538c70c01f81jh2****
YearsintegerNo

The validity period of the client certificate. Unit: years.

5
MonthsintegerNo

The validity period of the client certificate. Unit: months.

1
DaysintegerNo

The validity period of the client certificate. Unit: day. You must specify at least one of the Days, BeforeTime, and AfterTime parameters. The BeforeTime and AfterTime parameters must be both empty or both specified. The following list describes how to specify these parameters:

  • If you specify the Days parameter, you can specify both the BeforeTime and AfterTime parameters or leave them both 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 determined by the value of the Days parameter.

  • The validity period of the client certificate cannot exceed the validity period of the intermediate CA certificate. You can call the DescribeCACertificate operation to query the validity period of an intermediate CA certificate.

365
BeforeTimelongNo

The issuance time of the client certificate. This 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
AfterTimelongNo

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

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

Specifies whether to return the certificate. Valid values:

  • 0: does not return the certificate. This is the default value.
  • 1: returns the certificate.
  • 2: returns the certificate and the certificate chain of the certificate.
1
EnableCrllongNo

include the CRL address.

  • 0- No
  • 1- Yes
1

All Alibaba Cloud API requests must include common request parameters.

For more information about sample requests, see the "Examples" section of this topic.

Response parameters

ParameterTypeDescriptionExample
object

CreateCertificateResponse

X509Certificatestring

The content of the client certificate.

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

The certificate chain of the client certificate.

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

The unique identifier of the client certificate.

190ae6bb538d538c70c01f81dcf2****
SerialNumberstring

The serial number of the certificate.

0f29522da2dae7a1c4b6ab7132ad3c06
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

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

Examples

Sample success responses

JSONformat

{
  "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": "0f29522da2dae7a1c4b6ab7132ad3c06",
  "RequestId": "8C467B38-3910-447D-87BC-AC049166F216"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-05The request parameters of the API has changedView Change Details
2023-07-13The request parameters of the API has changedView Change Details