DeviceRegistrationParser Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.provisioning.device.internal.parser.DeviceRegistrationParser

public class DeviceRegistrationParser

Constructor Summary

Constructor Description
DeviceRegistrationParser(String registrationId, String customPayload)

Constructor for Device Registration for X509 flow

DeviceRegistrationParser(String registrationId, String customPayload, String endorsementKey, String storageRootKey)

Constructor for Device Registration for TPM flow

Method Summary

Modifier and Type Method and Description
String toJson()

Generates JSON output for this class. Expected format : For TPM :

"{\"registrationId\":\"[RegistrationID value]\"," +
 "\"tpm\":{" +

 "\"endorsementKey\":\"[Endorsement Key value]\"," +

 "\"storageRootKey\":\"[Storage root key value]\"" +

 "}

 "\"payload\":\"[Custom Data]\""

 }"

</code></pre> For X509: <pre><code>"{\"registrationId\":\"[RegistrationID value]\"," +

 }"

</code></pre></p>

Constructor Details

DeviceRegistrationParser

public DeviceRegistrationParser(String registrationId, String customPayload)

Constructor for Device Registration for X509 flow

Parameters:

registrationId -

Registration Id to be sent to the service. Cannot be anull 

</code> or empty value. </p>
customPayload -

Custom Payload being sent to the DPS service. Can be anull 

</code> or empty value. </p>

Throws:

IllegalArgumentException -

If the provided registration id wasnull 

</code> or empty. </p>

DeviceRegistrationParser

public DeviceRegistrationParser(String registrationId, String customPayload, String endorsementKey, String storageRootKey)

Constructor for Device Registration for TPM flow

Parameters:

registrationId -

Registration Id to be sent to the service. Cannot be anull 

</code> or empty value. </p>
customPayload -

Custom Payload being sent to the DPS service. Can be anull 

</code> or empty value. </p>
endorsementKey -

endorsement key to be sent to the service. Cannot be anull 

</code> or empty value. </p>
storageRootKey -

Storage Root Key to be sent to the service. Can be anull 

</code> value. </p>

Throws:

IllegalArgumentException - is thrown if any of the input parameters are invalid.

Method Details

toJson

public String toJson()

Generates JSON output for this class. Expected format : For TPM :

"{\"registrationId\":\"[RegistrationID value]\"," +
 "\"tpm\":{" +

 "\"endorsementKey\":\"[Endorsement Key value]\"," +

 "\"storageRootKey\":\"[Storage root key value]\"" +

 "}

 "\"payload\":\"[Custom Data]\""

 }"

</code></pre> For X509: <pre><code>"{\"registrationId\":\"[RegistrationID value]\"," +

 }"

</code></pre></p>

Returns:

A string that is JSON formatted.

Applies to