Ejemplo n.º 1
0
        public void Refresh(bool localOnly = false)
        {
            if (localOnly)
            {
                VerKey = DidAsync.KeyForLocalDidAsync(_wallet, Did).Result;
                return;
            }

            VerKey = DidAsync.KeyForDidAsync(_pool, _wallet, Did).Result;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets or sets the meta data factory.
        /// </summary>
        /// <value>The meta data factory.</value>
        // public static IMetaDataFactory MetaDataFactory { get; set; }

        /// <summary>
        /// Initializes the <see cref="T:IndyDotNet.Did.Factory"/> class.
        /// </summary>
        //static Factory()
        //{
        //    MetaDataFactory = new DefaultStringMetaDataFactory();
        //}
        #endregion

        #region TheirDid Handlers
        /// <summary>
        /// Gets their did.
        /// </summary>
        /// <returns>The their did.</returns>
        /// <param name="pool">Pool.</param>
        /// <param name="wallet">Wallet.</param>
        /// <param name="did">Did.</param>
        public static IDid GetTheirDid(IPool pool, IWallet wallet, string did)
        {
            // if truly needed for optimzation purposes we could parallel these two tasks
            string verkey   = DidAsync.KeyForDidAsync(pool, wallet, did).Result;
            string metaData = string.Empty;

            try
            {
                metaData = DidAsync.GetDidMetadataAsync(wallet, did).Result;
            }
            catch (System.AggregateException aex)
            {
                Logger.Info($"metadata error, likely there is no metadata {aex.Message}");
            }

            return(new DidInstance(pool, wallet, did, verkey, metaData));
        }