Exemple #1
0
        /////////////////private methods///////////////////
        private void InitKeys()
        {
            // load from storage if exists
            if (resourceDataAccess.FileExists())
            {
                this.ecKey = KeyUtils.LoadNBEcKey(this.resourceDataAccess);
            }
            else
            {
                // create a new private key and store

                this.ecKey = KeyUtils.CreateNBEcKey();
                byte[] priv = this.ecKey.ToBytes();
                KeyUtils.SaveEcKey(this.ecKey, this.resourceDataAccess);
            }
        }
Exemple #2
0
        public void NBitcoinKey_Generation_Test()
        {
            Key nbKey = KeyUtils.CreateNBEcKey();

            Assert.NotNull(nbKey);
        }