public void EncryptedKeyNoEC(string passphrase, string encrypted, string unencrypted, bool compressed) { var key = Key.Parse(unencrypted); var encryptedKey = new EncryptedKey(key, passphrase, Network.BitcoinMain); Assert.AreEqual(encrypted, encryptedKey.ToString()); Assert.Throws <InvalidOperationException>(() => encryptedKey.GetKey(passphrase + "wrong")); }
public void EncryptedSecretNoECmultiply(string passphrase, string encrypted, string unencrypted, bool compressed) { var key = Key.Parse(unencrypted); var encryptedKey = new EncryptedKey(key, passphrase, Network.BitcoinMain); Assert.AreEqual(encrypted, encryptedKey.ToString()); var actualKey = encryptedKey.GetKey(passphrase); Assert.AreEqual(unencrypted, actualKey.ToString(Network.BitcoinMain)); Assert.AreEqual(compressed, actualKey.IsCompressed); }