Creates a certificate.
Operation description
To create a certificate, you must specify the type of the asymmetric key. Certificates Manager generates a private key and returns a certificate signing request (CSR). Submit the CSR in the Privacy Enhanced Mail (PEM) format to a certificate authority (CA) to obtain the formal certificate and certificate chain. Then, call the UploadCertificate operation to import the certificate into Certificates Manager.
In this example, a certificate is created and the CSR is obtained.
Debugging
Authorization information
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Subject | string | Yes | The certificate subject, which is the owner of the certificate. Specify the value in the distinguished name (DN) format, as defined in RFC 2253. A DN is a sequence of relative distinguished names (RDNs). RDNs are key-value pairs in the format of The Subject parameter consists of the following fields:
| CN=userName,OU=kms,O=aliyun,C=CN |
| SubjectAlternativeNames | object | No | The subject alternative names. A domain name list is supported. A maximum of 10 domain names are supported. | ["test1.example.com","test2.example.com"] |
| KeySpec | string | Yes | The type of the key. Valid values:
| RSA_2048 |
| ExportablePrivateKey | boolean | No | Specifies whether the private key of the certificate can be exported for use. Valid values:
| true |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "15a735a1-8fe6-45cc-a64c-3c4ff839334e",
"Csr": "-----BEGIN CERTIFICATE REQUEST-----\\nMIIDADCCAegCAQAwgboxCzAJBgNVBAYTAkNOMREwDwYDVQQIEwhaaGVqaWFuZzER\\n****\\nmkj4rg==\\n-----END CERTIFICATE REQUEST-----\\n",
"CertificateId": "9a28de48-8d8b-484d-a766-dec4****",
"Arn": "acs:kms:cn-hangzhou:154035569884****:certificate/98e85c94-52d0-40c9-b3b2-afda52f4****"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 404 | InvalidAccessKeyId.NotFound | The specified AccessKey ID does not exist. | The AccessKey ID is not found. |
For a list of error codes, visit the Service error codes.
