IndividualEnrollment Constructors

定义

重载

IndividualEnrollment(String json)

CONSTRUCTOR

This constructor creates an instance of the enrollment filling the class with the information provided in the JSON. It is used by the SDK to parse enrollment responses from the provisioning service.

The following JSON is a sample of the IndividualEnrollment response, received from the provisioning service.

    {
       "registrationId":"validRegistrationId",
       "deviceId":"ContosoDevice-123",
       "attestation":{
           "type":"tpm",
           "tpm":{
               "endorsementKey":"validEndorsementKey"
           }
       },
       "iotHubHostName":"ContosoIoTHub.azure-devices.net",
       "provisioningStatus":"enabled"
       "createdDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
       "lastUpdatedDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
       "etag": "\"00000000-0000-0000-0000-00000000000\""
    }
    
  

IndividualEnrollment(String registrationId, Attestation attestation)

CONSTRUCTOR

This constructor creates an instance of the enrollment with the minimum set of information required by the provisioning service. A valid enrollment must contain the registrationId, which uniquely identify this enrollment, and the attestation mechanism, which can be TPM, X509 or SymmetricKey.

Other parameters can be added by calling the setters on this class.

When serialized, an IndividualEnrollment will look like the following example:

    {
       "registrationId":"validRegistrationId",
       "attestation":{
           "type":"tpm",
           "tpm":{
               "endorsementKey":"validEndorsementKey"
           }
       }
    }
    
  

IndividualEnrollment(String json)

CONSTRUCTOR

This constructor creates an instance of the enrollment filling the class with the information provided in the JSON. It is used by the SDK to parse enrollment responses from the provisioning service.

The following JSON is a sample of the IndividualEnrollment response, received from the provisioning service.

    {
       "registrationId":"validRegistrationId",
       "deviceId":"ContosoDevice-123",
       "attestation":{
           "type":"tpm",
           "tpm":{
               "endorsementKey":"validEndorsementKey"
           }
       },
       "iotHubHostName":"ContosoIoTHub.azure-devices.net",
       "provisioningStatus":"enabled"
       "createdDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
       "lastUpdatedDateTimeUtc": "2017-09-28T16:29:42.3447817Z",
       "etag": "\"00000000-0000-0000-0000-00000000000\""
    }
    
  

public IndividualEnrollment(String json)

参数

json
String

theString 

</code> with the JSON received from the provisioning service. </p>

异常

IllegalArgumentException

If the provided JSON is null, empty, or invalid.

IndividualEnrollment(String registrationId, Attestation attestation)

CONSTRUCTOR

This constructor creates an instance of the enrollment with the minimum set of information required by the provisioning service. A valid enrollment must contain the registrationId, which uniquely identify this enrollment, and the attestation mechanism, which can be TPM, X509 or SymmetricKey.

Other parameters can be added by calling the setters on this class.

When serialized, an IndividualEnrollment will look like the following example:

    {
       "registrationId":"validRegistrationId",
       "attestation":{
           "type":"tpm",
           "tpm":{
               "endorsementKey":"validEndorsementKey"
           }
       }
    }
    
  

public IndividualEnrollment(String registrationId, Attestation attestation)

参数

registrationId
String

theString 

</code> with an unique id for this enrollment. </p>

异常

IllegalArgumentException

If one of the provided parameters is not correct.

适用于