Issues a server 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 issue server 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 CreateServerCertificate

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

Domain String No example.com

The additional domain names and additional IP addresses of the server certificate. After you add additional domain names and additional IP addresses to a certificate, you can apply the certificate to the domain names and IP addresses.

Separate multiple domain names and multiple IP addresses with commas (,).

CommonName String Yes aliyundoc.com

The common name of the server certificate.

You can specify the domain names and IP addresses that you want to bind to the certificate. Separate multiple domain names and multiple IP addresses with commas (,).

Algorithm String Yes RSA_2048

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 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 server 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 server 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 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 intermediate CA certificate. You can call the DescribeCACertificate operation to query the validity period of an intermediate CA certificate.
ParentIdentifier String Yes 271ae6bb538d538c70c01f81dg3****

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.
BeforeTime Long No 1634283958

The issuance time of the server 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 server 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 160ae6bb538d538c70c01f81dcf2****

The unique identifier of the server 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 15C66C7B-671A-4297-9187-2C4477247A74

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

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

The certificate chain of the server certificate.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateServerCertificate
&Domain=example.com
&CommonName=aliyundoc.com
&Algorithm=RSA_2048
&Days=365
&ParentIdentifier=271ae6bb538d538c70c01f81dg3****
&BeforeTime=1634283958
&AfterTime=1665819958
&<Common request parameters>

Sample success responses

XML format

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

<CreateServerCertificateResponse>
    <Identifier>160ae6bb538d538c70c01f81dcf2****</Identifier>
    <RootX509Certificate>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </RootX509Certificate>
    <ParentX509Certificate>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </ParentX509Certificate>
    <RequestId>15C66C7B-671A-4297-9187-2C4477247A74</RequestId>
    <X509Certificate>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </X509Certificate>
    <CertificateChain>-----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
      -----BEGIN CERTIFICATE-----
      ......
      -----END CERTIFICATE-----
    </CertificateChain>
</CreateServerCertificateResponse>

JSON format

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

{
  "Identifier" : "160ae6bb538d538c70c01f81dcf2****",
  "RootX509Certificate" : "-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----",
  "ParentX509Certificate" : "-----BEGIN CERTIFICATE-----\n......\n-----END CERTIFICATE-----",
  "RequestId" : "15C66C7B-671A-4297-9187-2C4477247A74",
  "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.