Exemple #1
0
        private void initKeys()
        {
            if (KeyUtils.privateKeyExists())
            {
                _ecKey = KeyUtils.loadEcKey();

                // Alternatively, load your private key from a location you specify.
                //_ecKey = KeyUtils.createEcKeyFromHexStringFile("C:\\Users\\Andy\\Documents\\private-key.txt");
            }
            else
            {
                _ecKey = KeyUtils.createEcKey();
                KeyUtils.saveEcKey(_ecKey);
            }
        }
        private void initKeys()
        {
            string path = HttpContext.Current.Server.MapPath("~/App_Start/bitpay_private.key");

            if (KeyUtils.privateKeyExists(path))
            {
                _ecKey = KeyUtils.loadEcKey(path);

                //  Alternatively, load your private key from a location you specify.
                //_ecKey = KeyUtils.createEcKeyFromHexStringFile(path);
            }
            else
            {
                _ecKey = KeyUtils.createEcKey();
                KeyUtils.saveEcKey(_ecKey, path);
            }
        }