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

Querying Certificate Details

Function

This API is used to query details about a certificate.

URI

GET /v1/private-certificates/{certificate_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

certificate_id

Yes

String

ID of the private certificate you want to query.

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_id

String

ID of the private certificate

Minimum: 36

Maximum: 36

status

String

Certificate status:

  • ISSUED: The certificate is issued.

  • EXPIRED: The certificate expired.

  • REVOKED: The certificate is revoked.

issuer_id

String

ID of the parent CA.

Minimum: 36

Maximum: 36

issuer_name

String

The name of the parent CA certificate.

Minimum: 1

Maximum: 64

key_algorithm

String

Key algorithm

signature_algorithm

String

Signature algorithm

freeze_flag

Integer

Freezing tag:

  • 0: The certificate is not frozen.

  • Other values: The certificate is frozen (The type of value is reserved).

gen_mode

String

Certificate generation method.

  • GENERATE: The certificate is generated through the PCA system.

  • IMPORT: The certificate is imported externally.

  • CSR: The CSR is imported externally and issued by the internal CA. The private key is not managed in PCA.

serial_number

String

Serial number.

Minimum: 1

Maximum: 64

create_time

Long

Time the certificate was created. The value is a timestamp in milliseconds.

delete_time

Long

Time the certificate was deleted. The value is a timestamp in milliseconds.

not_before

Long

Time the certificate was created. The value is a timestamp in milliseconds.

not_after

Long

Time the certificate expires. The value is a timestamp in milliseconds.

distinguished_name

DistinguishedName object

Certificate name. For details, see data structure for the DistinguishedName field.

Table 4 DistinguishedName

Parameter

Type

Description

common_name

String

Common certificate name (CN).

Minimum: 1

Maximum: 64

country

String

Country code, which must comply with the regular expression "[A-Za-z]{2}".

Minimum: 2

Maximum: 2

state

String

State or city name.

Minimum: 1

Maximum: 128

locality

String

Country/Region.

Minimum: 1

Maximum: 128

organization

String

Organization name.

Minimum: 1

Maximum: 64

organizational_unit

String

Organization Unit (OU).

Minimum: 1

Maximum: 64

Status code: 400

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: 401

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: 403

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: 404

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

Status code: 500

Table 9 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 query details about a 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-certificates/6434f74f-2d13-4e6a-89eb-93ee313f1a43

Example Responses

Status code: 200

Request succeeded.

{
  "signature_algorithm" : "SHA256",
  "issuer_id" : "ef5d84d1-4f52-47d2-b1c8-a91a672487a0",
  "issuer_name" : "your CA name",
  "not_after" : 1665539214000,
  "not_before" : 1634295475000,
  "status" : "ISSUED",
  "freeze_flag" : 0,
  "gen_mode" : "GENERATE",
  "serial_number" : "202110151057541266081861",
  "distinguished_name" : {
    "country" : "your country abbreviation",
    "state" : "your state",
    "locality" : "your locality",
    "organization" : "your organization",
    "organizational_unit" : "your unit",
    "common_name" : "your CN"
  },
  "key_algorithm" : "RSA4096",
  "create_time" : 1634295475000,
  "delete_time" : null,
  "certificate_id" : "6434f74f-2d13-4e6a-89eb-93ee313f1a43"
}

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.