Querying the List of Private Certificates
Function
This API is used to query the private certificate list.
URI
GET /v1/private-certificates
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
limit |
No |
Integer |
The number of returned records. The default value is 10. Minimum: 0 Maximum: 1000 |
name |
No |
String |
The name of the private certificate. The set of certificates whose names contain the name field is returned. Minimum: 1 Maximum: 64 |
offset |
No |
Integer |
Index position. The query starts from the next data record indexed by this parameter. Minimum: 0 |
status |
No |
String |
The private certificate status. You can query private certificates by status.
|
sort_key |
No |
String |
Sorting attribute. The following attributes are available now:
|
sort_dir |
No |
String |
Sorting direction. The options are as follows:
|
Request 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
Parameter |
Type |
Description |
---|---|---|
total |
Integer |
Total number of private certificates. Minimum: 0 Maximum: 1000000 |
certificates |
Array of Certificates objects |
For details, see data structure for the Certificates field. |
Parameter |
Type |
Description |
---|---|---|
certificate_id |
String |
ID of the private certificate Minimum: 36 Maximum: 36 |
status |
String |
Certificate status:
|
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:
|
gen_mode |
String |
Certificate generation method.
|
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. |
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
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code Minimum: 3 Maximum: 36 |
error_msg |
String |
Error message Minimum: 0 Maximum: 1024 |
Status code: 500
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 the private certificate list, 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
Example Responses
Status code: 200
Request succeeded.
{ "total" : 2, "certificates" : [ { "signature_algorithm" : "SHA256", "issuer_id" : "ef5d84d1-4f52-47d2-b1c8-a91a672487a0", "issuer_name" : "12", "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" }, { "signature_algorithm" : "SHA256", "issuer_id" : "ef5d84d1-4f52-47d2-b1c8-a91a672487a0", "issuer_name" : "12", "not_after" : 1665539214000, "not_before" : 1634110315000, "status" : "ISSUED", "freeze_flag" : 0, "gen_mode" : "GENERATE", "serial_number" : "202110130731541908887138", "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" : 1634110316000, "delete_time" : null, "certificate_id" : "1cbb5a52-806b-469c-b182-7446e1851a1c" } ] }
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.