IamUser.encode()
DESCRIPTION
Encode this user instance into CBOR data that can be sent to device.
If using the IamUtil functions, this function is not necessary to use. But if you invoke the IAM CoAP backend on the device directly, this function is useful for encoding input. For instance for the /iam/pairing/local-open endpoint that accepts an encoded user (as documented on https://docs.nabto.com/developer/api-reference/coap/iam/pairing-local-open.html).
DECLARATION
public func encode() throws -> Data
THROWS ERRORS
INVALID_INPUT:
- If the user could not be encoded into CBOR data.
RETURNS
Raw CBOR data (e.g. to send to a CoAP call to a Nabto Embedded SDK device).