All Products
Search
Document Center

Certificate Management Service:CreateCertificateWithCsrRequest

Last Updated:Dec 23, 2024

Purchases, applies for, and issues a domain validated (DV) certificate by using a custom certificate signing request (CSR) file. You can use extended certificate services to purchase and apply for a DV certificate with a few clicks.

Operation description

  • You can use this operation to apply for only a domain validated (DV) certificate. You cannot use this operation to apply for an organization validated (OV) certificate. We recommend that you use the CreateCertificateForPackageRequest operation to apply for a certificate. You can use the CreateCertificateForPackageRequest operation to apply for certificates of all types and specify the CSR generation method.
  • Before you call this operation, make sure that you have purchased a certificate resource plan of the required specifications. For more information about how to purchase a certificate resource plan, see Purchase a certificate resource plan. You can call the DescribePackageState operation to query the usage of a certificate resource plan of specified specifications, including the total number of certificate resource plans that you purchase, the number of certificate applications that you submit, and the number of certificates that are issued.
  • When you call this operation, you can use the ProductCode parameter to specify the specifications of the certificate that you want to apply for.
  • After you call this operation to submit a certificate application, the certificate quota of the required specifications that you purchased is consumed. After you call this operation, you must call the DescribeCertificateState operation to obtain the information that is required for domain name ownership verification and manually complete the verification. Then, your certificate application is reviewed by the certificate authority (CA). If you use the Domain Name System (DNS) verification method, you must complete the verification on your DNS service provider system. If you use the file verification method, you must complete the verification on the DNS server.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-cert:CreateCertificateWithCsrRequestcreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CsrstringYes

The content of the CSR file.
The key algorithm in the CSR file must be Rivest-Shamir-Adleman (RSA) or elliptic-curve cryptography (ECC), and the key length of the RSA algorithm must be greater than or equal to 2,048 characters. For more information about how to create a CSR file, see How do I create a CSR file?
A CSR file contains the information about your server and company. When you apply for a certificate, you must submit the CSR file to the CA. The CA signs the CSR file by using the private key of the root certificate and generates a public key file to issue your certificate.

Note The CN field in the CSR file specifies the domain name that is bound to the certificate.
-----BEGIN CERTIFICATE REQUEST----- ...... -----END CERTIFICATE REQUEST-----
ProductCodestringNo

The specifications of the certificate that you want to apply for. Valid values:

  • digicert-free-1-free (default): DigiCert single-domain DV certificate in a three-month free trial, available only on the China site (aliyun.com).
  • symantec-free-1-free: DigiCert single-domain DV certificate in a one-year free trial, available only on the China site (aliyun.com).
  • symantec-dv-1-starter: DigiCert wildcard DV certificate.
  • geotrust-dv-1-starter: GeoTrust single-domain DV certificate.
  • geotrust-dv-w-starter: GeoTrust wildcard DV certificate.
  • globalsign-dv-1-personal: GlobalSign single-domain DV certificate.
  • globalsign-dv-w-advanced: GlobalSign wildcard DV certificate.
symantec-free-1-free
UsernamestringYes

The name of the applicant.

Tom
PhonestringYes

The phone number of the applicant.

1390000****
EmailstringYes

The contact email address of the applicant.

username@example.com
ValidateTypestringYes

The method to verify the ownership of a domain name. Valid values:

  • DNS: DNS verification. If you use this method, you must add a TXT record to the DNS records of the domain name in the management platform of the domain name. You must have operation permissions on domain name resolution to verify the ownership of the domain name.
  • FILE: file verification. If you use this method, you must create a specified file on the DNS server. You must have administrative rights on the DNS server to verify the ownership of the domain name.

For more information about the verification methods, see Verify the ownership of a domain name.

DNS
Tagsarray<object>No

The tag list.

objectNo

The tags.

KeystringNo

The tag key. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with acs: or aliyun. The tag key cannot contain http:// or https://.

database
ValuestringNo

The value of the tag.

1

Response parameters

ParameterTypeDescriptionExample
object
OrderIdlong

The ID of the certificate application order.

Note You can use the ID to query the status of the certificate application. For more information, see DescribeCertificateState .
98987582437920968
RequestIdstring

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

CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D

Examples

Sample success responses

JSONformat

{
  "OrderId": 98987582437920960,
  "RequestId": "CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-09-20API Description UpdateView Change Details
HTTP status codeError codeDescription
404NotFoundPackageThe error message returned because no certificate resource plans were purchased.
404NotRemainCountThe error message returned because the certificate quota is insufficient.
403CreateCertificateRequestFailedThe error message returned because the request failed to be created.
404NotFoundOrderThe error message returned because the specified certificate order was not found.
403OrderStateErrorThe error message returned because the status of the certificate order is invalid.
403DeleteFailThe error message returned because the certificate application order failed to be deleted.
500ErrorThe error message returned because an error occurred.