CertificatesOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

IotHubClient's

<xref:certificates> attribute.

Inheritance
builtins.object
CertificatesOperations

Constructor

CertificatesOperations(*args, **kwargs)

Methods

create_or_update

Upload the certificate to the IoT hub.

Adds new or replaces existing certificate.

delete

Delete an X509 certificate.

Deletes an existing X509 certificate or does nothing if it does not exist.

generate_verification_code

Generate verification code for proof of possession flow.

Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate.

get

Get the certificate.

Returns the certificate.

list_by_iot_hub

Get the certificate list.

Returns the list of certificates.

verify

Verify certificate's private key possession.

Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate.

create_or_update

Upload the certificate to the IoT hub.

Adds new or replaces existing certificate.

create_or_update(resource_group_name: str, resource_name: str, certificate_name: str, certificate_description: _models.CertificateBodyDescription, if_match: str | None = None, *, content_type: str = 'application/json', **kwargs: Any) -> _models.CertificateDescription

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the IoT hub. Required.

resource_name
Required
str

The name of the IoT hub. Required.

certificate_name
Required
str

The name of the certificate. Required.

certificate_description
Required

The certificate body. Is either a CertificateBodyDescription type or a IO type. Required.

if_match
Required
str

ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update an existing certificate. Default value is None.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

A custom type or function that will be passed the direct response

Returns

Type Description

CertificateDescription or the result of cls(response)

Exceptions

Type Description

delete

Delete an X509 certificate.

Deletes an existing X509 certificate or does nothing if it does not exist.

delete(resource_group_name: str, resource_name: str, certificate_name: str, if_match: str, **kwargs: Any) -> None

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the IoT hub. Required.

resource_name
Required
str

The name of the IoT hub. Required.

certificate_name
Required
str

The name of the certificate. Required.

if_match
Required
str

ETag of the Certificate. Required.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

None or the result of cls(response)

Exceptions

Type Description

generate_verification_code

Generate verification code for proof of possession flow.

Generates verification code for proof of possession flow. The verification code will be used to generate a leaf certificate.

generate_verification_code(resource_group_name: str, resource_name: str, certificate_name: str, if_match: str, **kwargs: Any) -> CertificateWithNonceDescription

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the IoT hub. Required.

resource_name
Required
str

The name of the IoT hub. Required.

certificate_name
Required
str

The name of the certificate. Required.

if_match
Required
str

ETag of the Certificate. Required.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

CertificateWithNonceDescription or the result of cls(response)

Exceptions

Type Description

get

Get the certificate.

Returns the certificate.

get(resource_group_name: str, resource_name: str, certificate_name: str, **kwargs: Any) -> CertificateDescription

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the IoT hub. Required.

resource_name
Required
str

The name of the IoT hub. Required.

certificate_name
Required
str

The name of the certificate. Required.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

CertificateDescription or the result of cls(response)

Exceptions

Type Description

list_by_iot_hub

Get the certificate list.

Returns the list of certificates.

list_by_iot_hub(resource_group_name: str, resource_name: str, **kwargs: Any) -> CertificateListDescription

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the IoT hub. Required.

resource_name
Required
str

The name of the IoT hub. Required.

Keyword-Only Parameters

Name Description
cls

A custom type or function that will be passed the direct response

Returns

Type Description

CertificateListDescription or the result of cls(response)

Exceptions

Type Description

verify

Verify certificate's private key possession.

Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded certificate.

verify(resource_group_name: str, resource_name: str, certificate_name: str, if_match: str, certificate_verification_body: _models.CertificateVerificationDescription, *, content_type: str = 'application/json', **kwargs: Any) -> _models.CertificateDescription

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group that contains the IoT hub. Required.

resource_name
Required
str

The name of the IoT hub. Required.

certificate_name
Required
str

The name of the certificate. Required.

if_match
Required
str

ETag of the Certificate. Required.

certificate_verification_body
Required

The name of the certificate. Is either a CertificateVerificationDescription type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

A custom type or function that will be passed the direct response

Returns

Type Description

CertificateDescription or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.iothub.v2017_07_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\iothub\\v2017_07_01\\models\\__init__.py'>