Share via


IotHubConnectionCredentials Class

Definition

Holder for client credentials that will be used for authenticating the client with IoT hub service.

public sealed class IotHubConnectionCredentials
type IotHubConnectionCredentials = class
Public NotInheritable Class IotHubConnectionCredentials
Inheritance
IotHubConnectionCredentials

Constructors

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.

Properties

AuthenticationMethod

The authentication method to be used with the IoT hub service.

AuthenticationModel

The authentication model for the device; i.e. X.509 certificates, individual client scoped SAS tokens or IoT hub level scoped SAS tokens.

CertificateChain

The full chain of certificates from the one used to sign the client certificate to the one uploaded to the service.

ClientCertificate

The client X509 certificates used for authenticating with IoT hub.

DeviceId

The device identifier of the device connecting to the service.

GatewayHostName

The optional name of the gateway service to connect to.

HostName

The host service that this client connects to. This can either be the IoT hub name or a gateway service name.

IotHubHostName

The fully-qualified DNS host name of the IoT hub service.

ModuleId

The module identifier of the module connecting to the service.

SasTokenRefresher

The token refresh logic to be used for clients authenticating with either an ClientAuthenticationWithTokenRefresh IAuthenticationMethod mechanism or through a shared access key value that can be used by the SDK to generate SAS tokens.

SasTokenRenewalBuffer

The time buffer before expiry when the token should be renewed, expressed as a percentage of the time to live.

SasTokenTimeToLive

The suggested time to live value for tokens generated for SAS authenticated clients.

SharedAccessKey

The shared access key used to connect to the IoT hub service.

SharedAccessKeyName

The shared access key name used to connect the device to the IoT hub service.

SharedAccessSignature

The shared access signature used to connect to the IoT hub service.

Methods

Equals(Object)

This overridden Equals implementation is being referenced when fetching the client identity (AmqpUnit) from an AMQP connection pool with multiplexed client connections. This implementation only uses device Id, host name, module Id and the authentication model when evaluating equality. This is the algorithm that was implemented when AMQP connection pooling was first implemented, so the algorithm has been retained as-is.

GetHashCode()

This hashing algorithm is used in two places:

  • when fetching the object hashcode for our logging implementation
  • when fetching the client identity (AmqpUnit) from an AMQP connection pool with multiplexed client connections This algorithm only uses device Id, host name, module Id and the authentication model when evaluating the hash. This is the algorithm that was implemented when AMQP connection pooling was first implemented, so the algorithm has been retained as-is.

Applies to