Beispiel #1
0
        /// <summary>
        /// Creates the control message without packaging and sending it.
        /// </summary>
        /// <param name="context">an instance of the Context object initialized to a verity-application agent</param>
        /// <returns>the constructed message (JSON object)</returns>
        public JsonObject provisionMsg(Context context)
        {
            if (context == null)
            {
                throw new UndefinedContextException("Context cannot be NULL");
            }

            JsonObject rtn = new JsonObject();

            rtn.Add("@id", AbstractProtocol.getNewId());
            rtn.Add("@type", messageType(CREATE_EDGE_AGENT));
            rtn.Add("requesterVk", context.SdkVerKey());

            if (token != null)
            {
                var tokenObj = JsonObject.Parse(token) as JsonObject;
                rtn.Add("provisionToken", tokenObj);
            }

            return(rtn);
        }