Azure IoT RegistryManager,阻止重用证书

时间:2017-02-23 16:47:33

标签: c# azure iot

如果证书的指纹已经在另一台设备上使用,我试图找到是否可以使用RegistryManager让它不注册设备。

_registryManager = RegistryManager.CreateFromConnectionString(_connectionString);
            Microsoft.Azure.Devices.Device device;

            try
            {
                Console.WriteLine("Registering Device using X.509 certificate for authentication");
                device = await _registryManager.AddDeviceAsync(new Microsoft.Azure.Devices.Device(deviceId)
                {
                    Authentication = new AuthenticationMechanism()
                    {
                        X509Thumbprint = new X509Thumbprint()
                        {
                            PrimaryThumbprint = certificate2.Thumbprint
                        }
                    }
                }).ConfigureAwait(false);
            }

因此,如果调用上面的代码并且另一个设备具有该指纹,我希望它失败。或者,我希望能够查看所有现有的指纹,以便我可以在注册前手动检查。

我无法通过RegistryManager看到任何方法。

0 个答案:

没有答案
相关问题