Skip to content

register_ca_certificate

register_ca_certificate(
    ca_certificate: CertificatePem,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    verification_certificate: Optional[CertificatePem] = None,
    set_as_active: Optional[SetAsActive] = None,
    allow_auto_registration: Optional[AllowAutoRegistration] = None,
    registration_config: Optional[RegistrationConfig] = None,
    tags: Optional[TagList] = None,
    certificate_mode: Optional[CertificateMode] = None,
) -> RegisterCACertificateResponse

Registers a CA certificate with Amazon Web Services IoT Core. There is no limit to the number of CA certificates you can register in your Amazon Web Services account. You can register up to 10 CA certificates with the same CA subject field per Amazon Web Services account.

Requires permission to access the RegisterCACertificate action.

Parameters:

  • ca_certificate (CertificatePem) –

    The CA certificate.

  • verification_certificate (Optional[CertificatePem], default: None ) –

    The private key verification certificate. If certificateMode is SNI_ONLY, the verificationCertificate field must be empty. If certificateMode is DEFAULT or not provided, the verificationCertificate field must not be empty.

  • set_as_active (Optional[SetAsActive], default: None ) –

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

    Valid values: ACTIVE | INACTIVE

  • allow_auto_registration (Optional[AllowAutoRegistration], default: None ) –

    Allows this CA certificate to be used for auto registration of device certificates.

  • registration_config (Optional[RegistrationConfig], default: None ) –

    Information about the registration configuration.

  • tags (Optional[TagList], default: None ) –

    Metadata which can be used to manage the CA certificate.

    For URI Request parameters use format: ...key1=value1&key2=value2...

    For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."

    For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."

  • certificate_mode (Optional[CertificateMode], default: None ) –

    Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the verificationCertificate field is not provided, set certificateMode to be SNI_ONLY. If the verificationCertificate field is provided, set certificateMode to be DEFAULT. When certificateMode is not provided, it defaults to DEFAULT. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see certificate mode.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def register_ca_certificate(
    self,
    ca_certificate: "capo_iot.types.certificate_pem.CertificatePem",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    verification_certificate: Optional[
        "capo_iot.types.certificate_pem.CertificatePem"
    ] = None,
    set_as_active: Optional["capo_iot.types.set_as_active.SetAsActive"] = None,
    allow_auto_registration: Optional[
        "capo_iot.types.allow_auto_registration.AllowAutoRegistration"
    ] = None,
    registration_config: Optional[
        "capo_iot.types.registration_config.RegistrationConfig"
    ] = None,
    tags: Optional["capo_iot.types.tag_list.TagList"] = None,
    certificate_mode: Optional[
        "capo_iot.types.certificate_mode.CertificateMode"
    ] = None,
) -> (
    "capo_iot.types.register_ca_certificate_response.RegisterCACertificateResponse"
):
    """<p>Registers a CA certificate with Amazon Web Services IoT Core. There is no limit to the number of CA certificates you can register in your Amazon Web Services account. You can register up to 10 CA certificates with the same <code>CA subject field</code> per Amazon Web Services account.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">RegisterCACertificate</a> action.</p>

    Args:
        ca_certificate: <p>The CA certificate.</p>
        verification_certificate: <p>The private key verification certificate. If <code>certificateMode</code> is <code>SNI_ONLY</code>, the <code>verificationCertificate</code> field must be empty. If <code>certificateMode</code> is <code>DEFAULT</code> or not provided, the <code>verificationCertificate</code> field must not be empty. </p>
        set_as_active: <p>A boolean value that specifies if the CA certificate is set to active.</p> <p>Valid values: <code>ACTIVE | INACTIVE</code> </p>
        allow_auto_registration: <p>Allows this CA certificate to be used for auto registration of device certificates.</p>
        registration_config: <p>Information about the registration configuration.</p>
        tags: <p>Metadata which can be used to manage the CA certificate.</p> <note> <p>For URI Request parameters use format: ...key1=value1&key2=value2...</p> <p>For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."</p> <p>For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."</p> </note>
        certificate_mode: <p>Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the <code>verificationCertificate</code> field is not provided, set <code>certificateMode</code> to be <code>SNI_ONLY</code>. If the <code>verificationCertificate</code> field is provided, set <code>certificateMode</code> to be <code>DEFAULT</code>. When <code>certificateMode</code> is not provided, it defaults to <code>DEFAULT</code>. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode"> certificate mode</a>. </p>

    Raises:
        capo_iot.errors.certificate_validation_exception.CertificateValidationException: <p>The certificate is invalid.</p>
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
        capo_iot.errors.registration_code_validation_exception.RegistrationCodeValidationException: <p>The registration code is invalid.</p>
        capo_iot.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The resource already exists.</p>
        capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_iot.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.unauthorized_exception.UnauthorizedException: <p>You are not authorized to perform this operation.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.register_ca_certificate_request.RegisterCACertificateRequest]",
    ) -> OperationResponse[
        "capo_iot.types.register_ca_certificate_response.RegisterCACertificateResponse"
    ]:
        import capo_iot._operations.aws_iot_service.register_ca_certificate

        output, http_response = (
            capo_iot._operations.aws_iot_service.register_ca_certificate.register_ca_certificate(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterCACertificate")
    )
    input_: capo_iot.types.register_ca_certificate_request.RegisterCACertificateRequest = {
        "ca_certificate": ca_certificate
    }
    if verification_certificate is not None:
        input_["verification_certificate"] = verification_certificate
    if set_as_active is not None:
        input_["set_as_active"] = set_as_active
    if allow_auto_registration is not None:
        input_["allow_auto_registration"] = allow_auto_registration
    if registration_config is not None:
        input_["registration_config"] = registration_config
    if tags is not None:
        input_["tags"] = tags
    if certificate_mode is not None:
        input_["certificate_mode"] = certificate_mode

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output