Implemented By

Supported Methods

Description of Methods

Encrypt (input as roByteArray, String as encType) as roByteArray

Encrypts data on a device that is unique per device, channel, or model. This method takes a roByteArray with the data to be encrypted and the encryption key type (encType), which is a string that may be set to "channel", "device'", or "model".  This method returns a roByteArray containing the encrypted data. The following table summarizes the different encryption key types (encType):

deviceEncrypt data with a device unique key. This can be used to implement a secure storage-like algorithm.

Encrypt data with a channel unique key This enables you to provision credentials, API tokens, or other data from the cloud to devices securely. Channels signed with same signing key will share the encryption key.


Encrypt channel with a model unique key This is similar to the "channel" encryption type, but with the scope limited to a specific model.

Decrypt (EncryptedData as roByteArray, String as encType) as roByteArray

Decrypts data stored on a device that was previously encoded with the Encrypt method. This method takes a roByteArray with the previously encoded data to be decrypted and the encryption key type (encType).  Returns a roByteArray containing the decrypted data.