RegisterCertificate - Amazon IoT
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

RegisterCertificate

Registers a device certificate with Amazon IoT in the same certificate mode as the signing CA. If you have more than one CA certificate that has the same subject field, you must specify the CA certificate that was used to sign the device certificate being registered.

Requires permission to access the RegisterCertificate action.

Request Syntax

POST /certificate/register?setAsActive=setAsActive HTTP/1.1 Content-type: application/json { "caCertificatePem": "string", "certificatePem": "string", "status": "string" }

URI Request Parameters

The request uses the following URI parameters.

setAsActive

This parameter has been deprecated.

A boolean value that specifies if the certificate is set to active.

Valid values: ACTIVE | INACTIVE

Request Body

The request accepts the following data in JSON format.

caCertificatePem

The CA certificate used to sign the device certificate being registered.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 65536.

Pattern: [\s\S]*

Required: No

certificatePem

The certificate data, in PEM format.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 65536.

Pattern: [\s\S]*

Required: Yes

status

The status of the register certificate request. Valid values that you can use include ACTIVE, INACTIVE, and REVOKED.

Type: String

Valid Values: ACTIVE | INACTIVE | REVOKED | PENDING_TRANSFER | REGISTER_INACTIVE | PENDING_ACTIVATION

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "certificateArn": "string", "certificateId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

certificateArn

The certificate ARN.

Type: String

certificateId

The certificate identifier.

Type: String

Length Constraints: Fixed length of 64.

Pattern: (0x)?[a-fA-F0-9]+

Errors

CertificateConflictException

Unable to verify the CA certificate used to sign the device certificate you are attempting to register. This is happens when you have registered more than one CA certificate that has the same subject field and public key.

HTTP Status Code: 409

CertificateStateException

The certificate operation is not allowed.

HTTP Status Code: 406

CertificateValidationException

The certificate is invalid.

HTTP Status Code: 400

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

ResourceAlreadyExistsException

The resource already exists.

HTTP Status Code: 409

ServiceUnavailableException

The service is temporarily unavailable.

HTTP Status Code: 503

ThrottlingException

The rate exceeds the limit.

HTTP Status Code: 400

UnauthorizedException

You are not authorized to perform this operation.

HTTP Status Code: 401

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: