I noticed with Azure IoT hub, a device can connect either using connection string which is composed with device Primary or Secondary key in form:
HostName=<host_name>;DeviceId=<device_id>;SharedAccessKey=<primary_key or secondary key>
or can connect with connection string which is composed with a generated SAS token in form:
HostName=<host_name>;DeviceId=<device_id>;SharedAccessSignature=SharedAccessSignature sr=<device_endpoint>&sig=<generated_token>&se=1453107988
In the first form, the symmetric key is hold by device and in second form the IoT hub owns the device's symmetric key.
So, my question is when should I use which form? and why?