Updated on 2023-06-29 GMT+08:00

Exporting a CA Certificate

Function

This API is used to export the CA certificate.

Note: You can export a certificate only when it is in the Activated or Expired state.

URI

POST /v1/private-certificate-authorities/{ca_id}/export

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

ca_id

Yes

String

ID of the CA certificate you want to export.

Minimum: 36

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the token API of IAM. The value of X-Auth-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

certificate

String

Certificate content.

NOTE:
  • If you use an API to obtain the certificate, the newline characters in it have been replaced with \r\n.

  • If you export the certificate from the console, the certificate is in PEM format.

Minimum: 1

Maximum: 4096

certificate_chain

String

The content of the certificate chain. The sequence of the certificate chain (from top to bottom) is as follows: intermediate certificate >... > root certificate.

NOTE:
  • If you use an API to obtain the certificate chain, the newline characters in it have been replaced with \r\n.

  • If you export the certificate chain from the console, the certificate chain is in PEM format.

Minimum: 1

Maximum: 2097152

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Example Requests

When you use this API to export a CA certificate, a token is required in the X-Auth-Token field in the request header. The token must have the permission to access the API.

POST https://ccm.ae-ad-1.myhuaweicloud.com/v1/private-certificate-authorities/4c0e772e-a30c-4029-b929-b7acb04143f7/export

Example Responses

Status code: 200

Request succeeded.

{
  "certificate" : "-----BEGIN CERTIFICATE-----\r\nMIIDczCCAlugAwIBAgIKKsxppf9kUcq6dDANBgkqhkiG9w0BAQsFADBOMQowCAYD\r\nVQQDDAE3MQswCQYDVQQGEwJDTjEQMA4GA1UECAwHU2ljaHVhbjEQMA4GA1UEBwwH\r\nQ2hlbmdkdTEPMA0GA1UECgwGSHVhd2VpMB4XDTIxMTAxNDA4NDMxMVoXDTIyMTAx\r\nNDA4NDQxMVowPjELMAkGA1UEAwwCWVUxCzAJBgNVBAYTAmNuMQowCAYDVQQIDAEz\r\nMQowCAYDVQQHDAE0MQowCAYDVQQKDAE1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\r\nMIIBCgKCAQEA1NZyv9qhA711c/99lNO80/uSXjoL1kEjljBtJVB7vqkDf0Ejs20A\r\nfQoHEVTuHams9XLvrllu+YTws4QO8hjbnLI9mmerRRJK0pp+tBmCS3ZFoC23c5vz\r\ny+l0t+Yc2JYhvaOFr823Yo0WC2+NB065nIKH6/duoONfD+3c5Ynkib0nBNyDV+DB\r\nhdKM0nrlqI07cNpYDWpfX5IiDL+4Oh+kY1xGLZCObgsXl34zTf6E7bxJ1/iDZjwJ\r\ndpf6OUQONmIcT49993YCrMDisjJ2OwW9e41S7D2xy/1xmPwWwnid1WHOkTfK4cyl\r\n2PHaHh3FTXIGYjVSg3yKfujauVOFpZ9bTwIDAQABo2MwYTAfBgNVHSMEGDAWgBTu\r\nY36JXjwX7XiLcwKtUto8RZa52DAdBgNVHQ4EFgQUyuAS2HonxOWDIPOgPIMFQ9rr\r\nGiMwEgYDVR0TAQH/BAgwBgEB/wIBADALBgNVHQ8EBAMCAYYwDQYJKoZIhvcNAQEL\r\nBQADggEBALea9Hf5iGCfKLpjf30KCBelEgj3ZxLSBOgsn8UkulB62FyUgnne4AmY\r\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yzKyCmnS3Wcz4ETliRG5fb7aqP56sCAwEAAaNT\r\nMFEwHwYDVR0jBBgwFoAU7mN+iV48F+14i3MCrVLaPEWWudgwHQYDVR0OBBYEFO5j\r\nfolePBfteItzAq1S2jxFlrnYMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL\r\nBQADggEBACHJruSBkb8gA0VajkTZWN7QOvUoJPA2TdOmIlnkzxyR5sXkOmsllHLp\r\njzze9LBKbkMl4/ZfWvLUde7wKJJzV208E1c3mf0iZFqRJ0Ms+o/DStVw/ap+98ML\r\n4oevJk2y/bn7IQTL2bvnEi/+iSzmz1CIlnRUyfEWBW2aVFgjrm/ZaFTiEb5jIdzm\r\ns75YNCvIvn3eKp+yOQ8fyG7mKvvn3nlRKfMTv++bLLUh9or/e/phWkUj0gtSyDEn\r\nyOnVuhxyveLwoag27U8THe5E4Ygrrg98v2eGNFyGMmtsXXKNgFSf5FBqvyED9d61\r\nZ86vYp/N2dbauF7uUUaX5RbtFANYFU0=\r\n-----END CERTIFICATE-----"
}

Status code: 400

Invalid request parameters.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 401

Token required for the requested page.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 403

Authentication failed.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 404

No resources available or found.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 500

Internal service error.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request parameters.

401

Token required for the requested page.

403

Authentication failed.

404

No resources available or found.

500

Internal service error.

Error Codes

See Error Codes.