Пример #1
0
        protected override void ExecuteCore(ConfigurationNode node)
        {
            DpapiSettingsEditorUI dpapi  = new DpapiSettingsEditorUI();
            DialogResult          result = dpapi.ShowDialog();

            if (result == DialogResult.OK)
            {
                base.ExecuteCore(node);
                DpapiSymmetricCryptoProviderNode cryptoNode = (DpapiSymmetricCryptoProviderNode)ChildNode;
                DpapiSettings settings = new DpapiSettings(dpapi.DpapiSettingsData);
                cryptoNode.DataProtectionMode = settings;
            }
        }
        public void NodeTest()
        {
            DpapiSettings settings = new DpapiSettings(null);
            settings.Entropy = new byte[16];

            string file = "etije98ts";

            FileKeyAlgorithmPairStorageProviderNode node = new FileKeyAlgorithmPairStorageProviderNode();
            node.DpapiSettings = settings;
            node.File = file;

            Assert.AreEqual(settings.Entropy.Length, node.DpapiSettings.Entropy.Length);
            Assert.AreEqual(file, node.File);
        }
Пример #3
0
        public void NodeTest()
        {
            DpapiSettings settings = new DpapiSettings(null);

            settings.Entropy = new byte[16];

            string file = "etije98ts";

            FileKeyAlgorithmPairStorageProviderNode node = new FileKeyAlgorithmPairStorageProviderNode();

            node.DpapiSettings = settings;
            node.File          = file;

            Assert.AreEqual(settings.Entropy.Length, node.DpapiSettings.Entropy.Length);
            Assert.AreEqual(file, node.File);
        }