Example #1
0
        /// <summary>
        /// Creates my did.
        /// </summary>
        /// <returns>The my did.</returns>
        /// <param name="pool">Pool.</param>
        /// <param name="wallet">Wallet.</param>
        /// <param name="seed">instance of IdentitySeed. If null then LibIndy will use default seed data</param>
        public static IDid CreateMyDid(IPool pool, IWallet wallet, IdentitySeed seed)
        {
            // LibIndy doesnt follow rules of json.  an empty seed value is
            // communicated by "{}".  TODO:  override ToJson for IdentitySeed
            string seedJson = (null != seed ? seed.ToJson() : "{}");
            CreateAndStoreMyDidResult result = DidAsync.CreateAndStoreMyDidAsync(wallet, seedJson).Result;

            return(new DidInstance(pool, wallet, result.Did, result.VerKey, string.Empty));
        }
Example #2
0
        private static void CreateAndStoreMyDidCallbackMethod(int xcommand_handle, int err, string did, string verkey)
        {
            var taskCompletionSource = PendingCommands.Remove <CreateAndStoreMyDidResult>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var callbackResult = new CreateAndStoreMyDidResult(did, verkey);

            taskCompletionSource.SetResult(callbackResult);
        }