コード例 #1
0
        /// <summary>
        /// Creates an instance of the Device Provisioning Client.
        /// </summary>
        /// <param name="idScope">The IDScope for the Device Provisioning Service.</param>
        /// <param name="securityClient">The security client instance.</param>
        /// <param name="transport">The type of transport (e.g. HTTP, AMQP, MQTT).</param>
        /// <returns>An instance of the ProvisioningDeviceClient</returns>
        public static ProvisioningDeviceClient Create(
            string idScope,
            SecurityClient securityClient,
            ProvisioningTransportHandler transport)
        {
            if (securityClient is SecurityClientHsmX509)
            {
                CertificateInstaller.EnsureChainIsInstalled(
                    ((SecurityClientHsmX509)securityClient).GetAuthenticationCertificateChain());
            }

            return(new ProvisioningDeviceClient(DefaultGlobalDeviceEndpoint, idScope, securityClient, transport));
        }
コード例 #2
0
        /// <summary>
        /// Creates an instance of the Device Provisioning Client.
        /// </summary>
        /// <param name="globalDeviceEndpoint">The GlobalDeviceEndpoint for the Device Provisioning Service.</param>
        /// <param name="idScope">The IDScope for the Device Provisioning Service.</param>
        /// <param name="securityProvider">The security provider instance.</param>
        /// <param name="transport">The type of transport (e.g. HTTP, AMQP, MQTT).</param>
        /// <returns>An instance of the ProvisioningDeviceClient</returns>
        public static ProvisioningDeviceClient Create(
            string globalDeviceEndpoint,
            string idScope,
            SecurityProvider securityProvider,
            ProvisioningTransportHandler transport)
        {
            if (securityProvider is SecurityProviderX509 x509securityProvider)
            {
                CertificateInstaller.EnsureChainIsInstalled(x509securityProvider.GetAuthenticationCertificateChain());
            }

            return(new ProvisioningDeviceClient(globalDeviceEndpoint, idScope, securityProvider, transport));
        }