Share via


IotHubConnectionCredentials Constructors

Definition

Overloads

IotHubConnectionCredentials(String)

Creates an instance of this class using a connection string.

IotHubConnectionCredentials(IAuthenticationMethod, String, String)

Creates an instance of this class based on an authentication method, the host name of the IoT hub and an optional gateway host name.

IotHubConnectionCredentials(String)

Creates an instance of this class using a connection string.

public IotHubConnectionCredentials (string iotHubConnectionString);
new Microsoft.Azure.Devices.Client.IotHubConnectionCredentials : string -> Microsoft.Azure.Devices.Client.IotHubConnectionCredentials
Public Sub New (iotHubConnectionString As String)

Parameters

iotHubConnectionString
String

The IoT hub device connection string.

Exceptions

iotHubConnectionString, IoT hub host name or device Id is null.

iotHubConnectionString, IoT hub host name or device Id are an empty string or consist only of white-space characters.

Either shared access key or shared access signature where presented together with X509 certificates for authentication.

Applies to

IotHubConnectionCredentials(IAuthenticationMethod, String, String)

Creates an instance of this class based on an authentication method, the host name of the IoT hub and an optional gateway host name.

public IotHubConnectionCredentials (Microsoft.Azure.Devices.Client.IAuthenticationMethod authenticationMethod, string iotHubHostName, string gatewayHostName = default);
new Microsoft.Azure.Devices.Client.IotHubConnectionCredentials : Microsoft.Azure.Devices.Client.IAuthenticationMethod * string * string -> Microsoft.Azure.Devices.Client.IotHubConnectionCredentials
Public Sub New (authenticationMethod As IAuthenticationMethod, iotHubHostName As String, Optional gatewayHostName As String = Nothing)

Parameters

authenticationMethod
IAuthenticationMethod

The authentication method that is used. It includes ClientAuthenticationWithSharedAccessKeyRefresh, ClientAuthenticationWithSharedAccessSignature, ClientAuthenticationWithX509Certificate or Microsoft.Azure.Devices.Client.HsmAuthentication.EdgeModuleAuthenticationWithHsm.

iotHubHostName
String

The fully-qualified DNS host name of IoT hub.

gatewayHostName
String

The fully-qualified DNS host name of the gateway (optional).

Exceptions

iotHubHostName, device Id or authenticationMethod is null.

CertificateChain is used over a protocol other than MQTT over TCP or AMQP over TCP.

Either shared access key or shared access signature where presented together with X509 certificates for authentication.

CertificateChain could not be installed.

Applies to