locked
Why do devices have primary key and secondary key? Are they symmetric keys? RRS feed

  • Question

  • Why do devices have primary key and secondary key? Are they symmetric keys?
    Friday, December 16, 2016 7:26 AM

All replies

  • Not sure why but based on the docs here it looks like they are symmetric https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-bulk-identity-mgmt.

    // Create a new ExportImportDevice
      var deviceToAdd = new ExportImportDevice()
      {
        Id = Guid.NewGuid().ToString(),
        Status = DeviceStatus.Enabled,
        Authentication = new AuthenticationMechanism()
        {
          SymmetricKey = new SymmetricKey()
          {
            PrimaryKey = CryptoKeyGenerator.GenerateKey(32),
            SecondaryKey = CryptoKeyGenerator.GenerateKey(32)
          }
        },
        ImportMode = ImportMode.Create
      };
    

    Sunday, December 18, 2016 11:31 PM