コード例 #1
0
        public void CanCreateDpapiSymmetricCryptoProviderNodeByData()
        {
            INodeCreationService             nodeCreationService = ServiceHelper.GetNodeCreationService(ServiceProvider);
            DpapiSymmetricCryptoProviderNode dpapiProviderNode   = nodeCreationService.CreateNodeByDataType(typeof(DpapiSymmetricCryptoProviderData)) as DpapiSymmetricCryptoProviderNode;

            Assert.IsNotNull(dpapiProviderNode);
        }
コード例 #2
0
        public void DpapiSymmetricCryptoProviderNodeTest()
        {
            DataProtectionScope scope = DataProtectionScope.LocalMachine;
            string name = "some name";

            DpapiSymmetricCryptoProviderNode node = new DpapiSymmetricCryptoProviderNode();
            node.ProtectionScope = scope;
            node.Name = name;

            Assert.AreEqual(scope, node.ProtectionScope);
            Assert.AreEqual(name, node.Name);

            DpapiSymmetricCryptoProviderData data = (DpapiSymmetricCryptoProviderData)node.SymmetricCryptoProviderData;
            Assert.AreEqual(name, data.Name);
            Assert.AreEqual(scope, data.Scope);
        }
コード例 #3
0
        public void DpapiSymmetricCryptoProviderDataTest()
        {
            DataProtectionScope scope = DataProtectionScope.LocalMachine;
            string name = "some name";

            DpapiSymmetricCryptoProviderData data = new DpapiSymmetricCryptoProviderData();

            data.Name  = name;
            data.Scope = scope;

            Assert.AreEqual(name, data.Name);
            Assert.AreEqual(scope, data.Scope);

            DpapiSymmetricCryptoProviderNode node = new DpapiSymmetricCryptoProviderNode(data);

            Assert.AreEqual(name, node.Name);
            Assert.AreEqual(scope, node.ProtectionScope);
        }
コード例 #4
0
 public void PassingNullInDpapiSymmetricCryptoProviderNodeThrows()
 {
     DpapiSymmetricCryptoProviderNode node = new DpapiSymmetricCryptoProviderNode(null);
 }
コード例 #5
0
        public void DpapiSymmetricCryptoProviderNodeName()
        {
            DpapiSymmetricCryptoProviderNode dpapiProviderNode = new DpapiSymmetricCryptoProviderNode();

            Assert.AreEqual("DPAPI Symmetric Cryptography Provider", dpapiProviderNode.Name);
        }
コード例 #6
0
 public void PassingNullInDpapiSymmetricCryptoProviderNodeThrows()
 {
     DpapiSymmetricCryptoProviderNode node = new DpapiSymmetricCryptoProviderNode(null);
 }
コード例 #7
0
        public void DpapiSymmetricCryptoProviderNodeName()
        {
            DpapiSymmetricCryptoProviderNode dpapiProviderNode = new DpapiSymmetricCryptoProviderNode();

            Assert.AreEqual("DPAPI Symmetric Cryptography Provider", dpapiProviderNode.Name);
        }