Issues a client certificate based on a certificate signing request (CSR) that is automatically generated.

Usage notes

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 be used to issue client certificates.

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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateClientCertificate

The operation that you want to perform. Set the value to CreateClientCertificate.

SanType Integer No 2

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

  • 1: an email address
  • 2: a domain name
  • 6: a Uniform Resource Identifier (URI)
  • 7: an IP address
SanValue String No example.com

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

CommonName String Yes aliyun

The common name of the client certificate. The value can contain letters.

Algorithm String Yes RSA_2048

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 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.
Days Integer No 365

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

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.
ParentIdentifier String Yes 273ae6bb538d538c70c01f81jh2****

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

Note You can call the DescribeCACertificateList operation to query the unique identifier of an intermediate CA certificate.
BeforeTime Long No 1634283958

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.
AfterTime Long No 1665819958

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.

All Alibaba Cloud API operations must include common request parameters. For more information about common request parameters, see Common parameters.

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

Response parameters

Parameter Type Example Description
Identifier String 190ae6bb538d538c70c01f81dcf2****

The unique identifier of the client certificate.

RootX509Certificate String -----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----

The content of the root CA certificate.

ParentX509Certificate String -----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----

The content of the intermediate CA certificate.

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

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

X509Certificate String -----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----

The content of the client certificate.

CertificateChain String -----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----\n

The certificate chain of the client certificate.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateClientCertificate
&SanType=2
&SanValue=example.com
&CommonName=aliyun
&Algorithm=RSA_2048
&Days=365
&ParentIdentifier=273ae6bb538d538c70c01f81jh2****
&BeforeTime=1634283958
&AfterTime=1665819958
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateClientCertificateResponse>
    <Identifier>190ae6bb538d538c70c01f81dcf2****</Identifier>
    <RootX509Certificate>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </RootX509Certificate>
    <ParentX509Certificate>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </ParentX509Certificate>
    <RequestId>8C467B38-3910-447D-87BC-AC049166F216</RequestId>
    <X509Certificate>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </X509Certificate>
    <CertificateChain>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
      -----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </CertificateChain>
</CreateClientCertificateResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Identifier" : "190ae6bb538d538c70c01f81dcf2****",
  "RootX509Certificate" : "-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----",
  "ParentX509Certificate" : "-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----",
  "RequestId" : "8C467B38-3910-447D-87BC-AC049166F216",
  "X509Certificate" : "-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----",
  "CertificateChain" : "-----BEGIN CERTIFICATE-----\n......\n----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----\n"
}

Error codes

For a list of error codes, visit the API Error Center.