provisioning - Device’s Activation Code best practice -
quoting documentation:
once pre-registered, device can activate sending activation code xively api. signals xively device has woken first time, , requesting provisioned feed id , api key can use. device’s activation code generated using hmac-sha1 hash combines device’s serial number parent product’s product secret makes impossible extract product secret activation code, or fraudulently impersonate device in provisioning process.
what best practice:
- keeping activation code on each device memory: time consuming program @ factory time
- computing activation code on device wakeup via
hmac-sha1(serialnumber, productid)
.
in case second make more sense, cannot find how hmac calculated api docs. string concatenation? padding?
everything errordeveloper said absolutely correct.
one additional thing keep in mind product secret listed on product (or device) page in hex pair format. not need convert string hex, rather use current string hex string. can see how done in arduino code posted errordeveloper.
Comments
Post a Comment