예제 #1
0
        // *************************************
        // *          Private Methods          *
        // *************************************
        private static string uncompressedPubKeyFromKeyPair(BitCoinSharp.EcKey keys)
        {
            string keyString = keys.ToString ();

            int indexPubKeyStart = keyString.IndexOf ("pub:") + 4; // to account for the actual chars "pub:"
            int indexPubKeyEnd = keyString.LastIndexOf ("priv:") - 1; // to account for the space char before "priv:"

            string pubKeyString = keyString.Substring (indexPubKeyStart, indexPubKeyEnd - indexPubKeyStart);
            pubKeyString = checkHas64 (pubKeyString);

            return pubKeyString;
        }
예제 #2
0
        private static string privKeyFromKeyPair(BitCoinSharp.EcKey keys)
        {
            string keyString = keys.ToString ();

            int indexPrivKeyStart = keyString.IndexOf ("priv:") + 5; // to account for the actual chars "priv:"

            string privKeyString = keyString.Substring (indexPrivKeyStart);
            privKeyString = checkHas64 (privKeyString);
            return privKeyString;
        }