예제 #1
0
        public void LiftFileDefenseRecovery()
        {
            FileSecurity.EncryptWalletFile(_wallet, _key, _recoverypath);
            FileSecurity.LiftFileDefense(_recoverypath);

            FileAttributes attributes = File.GetAttributes(_recoverypath);

            Assert.AreEqual(FileAttributes.Normal, attributes);
        }
예제 #2
0
        public void ApplyFileDefenseRecovery()
        {
            FileSecurity.EncryptWalletFile(_wallet, _key, _recoverypath);
            FileSecurity.ApplyFileDefense(_recoverypath);

            Assert.True(File.Exists(_recoverypath));

            FileAttributes attributes = File.GetAttributes(_recoverypath);

            Assert.AreEqual(FileAttributes.Hidden | FileAttributes.ReadOnly, attributes);
        }
예제 #3
0
        public void EncryptWalletFail()
        {
            string badKey = "238085A3C30982B6DBE1";

            Assert.Throws <CryptographicException>(() => FileSecurity.EncryptWalletFile(_wallet, badKey, _path));
        }
예제 #4
0
 public void EncryptWallet()
 {
     Assert.DoesNotThrow(() => FileSecurity.EncryptWalletFile(_wallet, _key, _path));
 }