Skip to content

/AWS1/CL_IOT=>REGISTERCERTIFICATE()

About RegisterCertificate

Registers a device certificate with 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.

Method Signature

IMPORTING

Required arguments:

iv_certificatepem TYPE /AWS1/IOTCERTIFICATEPEM /AWS1/IOTCERTIFICATEPEM

The certificate data, in PEM format.

Optional arguments:

iv_cacertificatepem TYPE /AWS1/IOTCERTIFICATEPEM /AWS1/IOTCERTIFICATEPEM

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

iv_setasactive TYPE /AWS1/IOTSETASACTIVEFLAG /AWS1/IOTSETASACTIVEFLAG

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

Valid values: ACTIVE | INACTIVE

iv_status TYPE /AWS1/IOTCERTIFICATESTATUS /AWS1/IOTCERTIFICATESTATUS

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

RETURNING

oo_output TYPE REF TO /aws1/cl_iotregcertresponse /AWS1/CL_IOTREGCERTRESPONSE

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_iot~registercertificate(
  iv_cacertificatepem = |string|
  iv_certificatepem = |string|
  iv_setasactive = ABAP_TRUE
  iv_status = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_certificatearn = lo_result->get_certificatearn( ).
  lv_certificateid = lo_result->get_certificateid( ).
ENDIF.