Ejemplo n.º 1
0
 /// <summary>
 ///     Initialize the public/private key pair by either loading the existing one or by creating a new one
 /// </summary>
 /// <returns></returns>
 private async Task InitKeys()
 {
     if (KeyUtils.PrivateKeyExists(_configuration.GetSection("BitPayConfiguration:EnvConfig:" + _env + ":PrivateKeyPath").Value))
     {
         _ecKey = await KeyUtils.LoadEcKey();
     }
     else
     {
         _ecKey = KeyUtils.CreateEcKey();
         await KeyUtils.SaveEcKey(_ecKey);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize the public/private key pair by either loading the existing one or by creating a new one
        /// </summary>
        /// <returns></returns>
        private async Task InitKeys()
        {
            if (KeyUtils.PrivateKeyExists())
            {
                _ecKey = await KeyUtils.LoadEcKey();

                // TODO: Alternatively, load your private key from a location you specify.
                //_ecKey = KeyUtils.createEcKeyFromHexStringFile("C:\\Users\\Andy\\Documents\\private-key.txt");
            }
            else
            {
                _ecKey = KeyUtils.CreateEcKey();
                await KeyUtils.SaveEcKey(_ecKey);
            }
        }