Updated on 2024-01-26 GMT+08:00

Verify a Device CA Certificate

Function

This API is used by an application to verify a device CA certificate on the IoT platform to check whether the user has the private key of the CA certificate.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

POST /v5/iot/{project_id}/certificates/{certificate_id}/action

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

certificate_id

Yes

String

Unique CA certificate ID, allocated by the platform when the certificate is uploaded.

Minimum: 1

Maximum: 36

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

action_id

Yes

String

Operation performed on the certificate. Currently, only verify (certificate verification) is supported.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. You can obtain the token by calling the IAM API Obtaining a User Token Through Password Authentication. X-Subject-Token in the response header returned by the API is the desired user token. For details about how to obtain the token, see Token Authentication.

Instance-Id

No

String

Instance ID. Unique identifier of each instance in the physical multi-tenant scenario. Mandatory for professional editions and recommended in other cases. Log in to the IoTDA console and choose Overview in the navigation pane to view the instance ID. For details, see Viewing Instance Details.

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

verify_content

Yes

String

Certificate content to verify.

Minimum: 1

Maximum: 65535

Response Parameters

None

Example Requests

Verifies a device CA certificate.

POST https://{endpoint}/v5/iot/{project_id}/certificates/{certificate_id}/action

{
  "verify_content" : "-----BEGIN CERTIFICATE-----\nMIIDnzCCAocCCQCs5+qyyItl5TANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMC\nQ04xETAPBgNVBAgMCEd1YW5kb25nMREwDwYDVQQHDAhTaGVuemhlbjEPMA0GA1UE\nCgwGSHVhd2VpMQwwCgYDVQQLDANpb3QxEjAQBgNVBAMMCTEyMzQ1Njc4OTEaMBgG\nCSqGSIb3DQEJARYLZGprYUBxcS5jb20wHhcNMTkxMjE5MTMyMTM3WhcNMjEwNTAy\nMTMyMTM3WjCBnzELMAkGA1UEBhMCQ04xEjAQBgNVBAgMCUd1YW5nZG9uZzERMA8G\nA1UEBwwIU2hlbnpoZW4xDzANBgNVBAoMBm9yaWdpbjENMAsGA1UECwwEdW5pdDEt\nMCsGA1UEAwwkMmM4YjU5MDUtYjM0YS00YjY0LTgxMTItZjZjMDQ3YWUwNjVjMRow\nGAYJKoZIhvcNAQkBFgtqbGtqQHFxLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP\nADCCAQoCggEBAM72QUzoadvLfxGjt3UFoZ4MJbblqnRbouO4KpOVHBXyS2yQVl4C\nWWMhLh4pp2efNUSqKuXHjY3r68PquyNnYk8zO59zVc7JHvjGkBvo7DgPRAhEKPLJ\nIpRzkmlCBbxwTNCjc3FovGb/sHHNlpGncCKUzMfPGNZuBiuemskuEXL/eMHxDPbX\nYWn4Wq0wt+28PKUL5jybY7nsXSNnmAPFTO0CAmq0meUukubT/jHDCQ78ihQ/iqw1\nRNq88aCqRleoHiGg5nWkjL+05GXqUrqVVnZNL+YqcXzuVMs5XgyhNM2AsuH2g3D8\nZuF6Dj9qY1n/v/Cp/DGpxP3A74SlplnFD/0CAwEAATANBgkqhkiG9w0BAQsFAAOC\nAQEAh1SF1Z/p8nT7k8868lLNBZrIcErMlkFdghn2HRYyw5iilDXL28lJEBax2X1M\nNl2fD/rov9gwxhyrBZD2YkevL8k+DXcVpVEoozwpUR3p79YEyT0E3jI67G/EiB2h\n+o7+deDlH7d7Li/ZOSQC6JTSLshBhi+B8CQmYYt6YCjN7Rswbf1Z8bsQNrcsxW36\nZM3uG3i9GrEktypTNXMRUbG5gngaFKbRGGUPWNYdNXQeXUW9cpj8HAyndESEwAYz\ntLKHdnM874P8ZAmRkijZoToOCMcT0s8l8SoYUR7iWI0E08KYzAPgLX9Xvw42GCEF\nb2TJfnOIwhu8gFf7cwlCGC+gRA==\n-----END CERTIFICATE-----"
}

Example Responses

None

Status Codes

Status Code

Description

200

OK

400

Bad Request

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.