Beispiel #1
0
        public void DecreyptEncryptedKey()
        {
            var privateKeyEncrypted = new EncryptedPrivateKey("4344645752e57065f814b51713d05810b6edb40bae6d099f099775bc828e36961f7fbb5e3ee62236714ad1e980ac8986bd4ed690f576abb5268ba0915ae575e7");
            var privateKeyDecrypted = privateKeyEncrypted.Decrypt(new Password("password"));

            Assert.AreEqual("e85467d94fdf70b5713d3b3b083597e0962f38843feb10259158a3fa6dc444b6", privateKeyDecrypted);
        }
Beispiel #2
0
        public void CanEncodeAndDecodePrivateKey()
        {
            var encKey = CryptoUtils.EncodePrivateKey("9b4ed1b56be9e8106da2ef4fc681db0f9f4c22ccbad5f9bb9d3fbe68a1b20007", "simplewallet");

            var key = new EncryptedPrivateKey(encKey);

            var unencrypted = key.Decrypt(new Password("simplewallet"));

            Assert.AreEqual("9b4ed1b56be9e8106da2ef4fc681db0f9f4c22ccbad5f9bb9d3fbe68a1b20007", unencrypted);
        }