Updated on 2022-12-22 GMT+08:00

Exporting a CSR of a CA

Function

This API is used to export a Certificate Signing Request (CSR) of a CA.

A CSR can be exported only when the corresponding CA is in the Pending activation status.

URI

GET /v1/private-certificate-authorities/{ca_id}/csr

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

ca_id

Yes

String

ID of the subordinate CA that has not been activated.

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

csr

String

Content of the CSR. The content varies depending on how you obtain the CSR:

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

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

Minimum: 1

Maximum: 4096

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 CSR of 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.

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

Example Responses

Status code: 200

Request succeeded.

{
  "csr" : "-----BEGIN CERTIFICATE REQUEST-----\r\nMIIBUDCB2AIBADBZMRAwDgYDVQQDDAdDU1IsMTIzMQswCQYDVQQGEwJjbjERMA8G\r\nA1UECAwIc2hhbmdoYWkxETAPBgNVBAcMCHNoYW5naGFpMRIwEAYDVQQKDAlzaGFu\r\nZyxoYWkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQl9M7bK+vys5x9mnfG3783aPRh\r\nP/xqLPKVsRsqniC3vPZvIz9E7SasMfZLrXVK37QWhtAEtgNG7NrQnwiOye0/8VZL\r\nVX7ildM6CZY4SlJYSa6TBUsXyGjOs514fjxbuT6gADAKBggqhkjOPQQDAgNnADBk\r\nAjBlQiPXU7TDDDwxrh+JfZEYgmr61cIQdE5GMozPDYime30zcuMnVrb9i3o/2BW+\r\n0lECMG0QWbAYh0LoqnmAYqlgTKK8nKsxm0xFuTRyfxynWi8BpCvAGx803Qpa8EJV\r\nJTTjcw==\r\n-----END CERTIFICATE REQUEST-----"
}

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.