示例#1
0
            public Policy(string policyName, string policyDescription)
            {
                //Append the GUID to the name.
                name += ipSecID;

                //Create a subkey for the FilterList.
                IpSecStoreKey.CreateSubKey(name);

                //Open the subkey as writable.
                policySubKey = IpSecStoreKey.OpenSubKey(name, true);

                //Create the policy keys.
                CreatePolicyKey(policyName, policyDescription);

                //Create the ISAKMP Policy and keys.
                IpsecISAKMPPolicy ipsecISAKMPPolicy = new IpsecISAKMPPolicy(this);

                ipsecISAKMPPolicy.CreateISAKMPPolicyKey();

                IpsecNFA ipsecNfaPolicy = new IpsecNFA(this);

                ipsecNfaPolicy.CreateIpsecNFAKey();

                ipsecNegPol = new IpsecNegotiationPolicy(ipsecNfaPolicy);
                ipsecNegPol.CreateIpsecNegPolicy();
            }
示例#2
0
            public Rule(string ipsecName, Policy.IpsecNegotiationPolicy ipsecNegPol, FilterList ipsecFilterList, Policy ipsecPolicy)
            {
                name += ipSecID;

                IpSecStoreKey.CreateSubKey(name);

                ruleSubKey = IpSecStoreKey.OpenSubKey(name, true);
                CreateRuleKey(ipsecName, ipsecNegPol, ipsecFilterList, ipsecPolicy);
            }
示例#3
0
            public FilterAction()
            {
                name += ipSecID;

                IpSecStoreKey.CreateSubKey(name);

                filterActionKey = IpSecStoreKey.OpenSubKey(name, true);

                CreateFilterAction("ExampleLagAction");
            }
示例#4
0
                public IpsecNFA(Policy policy)
                {
                    name += ipSecID;
                    ipsecOwnersReference = new string[] { policy.policySubKey.Name.Substring(policy.policySubKey.Name.IndexOf("\\")).Remove(0, 1) };

                    IpSecStoreKey.CreateSubKey(name);
                    ipsecNFAPolicyKey = IpSecStoreKey.OpenSubKey(name, true);

                    policy.policySubKey.SetValue("ipsecNFAReference", new string[] { ipsecNFAPolicyKey.Name.Substring(ipsecNFAPolicyKey.Name.IndexOf("\\")).Remove(0, 1) });
                }
示例#5
0
                public IpsecNegotiationPolicy(IpsecNFA policy)
                {
                    ipsecOwnerReference = new string[]
                    {
                        policy.ipsecNFAPolicyKey.Name.Substring(policy.ipsecNFAPolicyKey.Name.IndexOf("\\")).Remove(0, 1)
                    };

                    name += ipSecID;
                    IpSecStoreKey.CreateSubKey(name);
                    ipsecNegPolicyKey = IpSecStoreKey.OpenSubKey(name, true);

                    policy.ipsecNFAPolicyKey.SetValue("ipsecNegotiationPolicyReference", ipsecNegPolicyKey.Name.Substring(ipsecNegPolicyKey.Name.IndexOf("\\")).Remove(0, 1), RegistryValueKind.String);
                }
示例#6
0
                public IpsecISAKMPPolicy(Policy policy)
                {
                    ipsecOwnersReference = new string[]
                    {
                        policy.policySubKey.Name.Substring(policy.policySubKey.Name.IndexOf("\\")).Remove(0, 1)
                    };

                    name += ipSecID;

                    IpSecStoreKey.CreateSubKey(name);
                    isakmpKey = IpSecStoreKey.OpenSubKey(name, true);
                    policy.policySubKey.SetValue("ipsecISAKMPReference", isakmpKey.Name.Substring(isakmpKey.Name.IndexOf("\\")).Remove(0, 1), RegistryValueKind.String);
                }
示例#7
0
            public FilterList(string filterName, string filterDescription)
            {
                //Append the GUID to the name to match the correct format.
                name += ipSecID;

                //Create a subkey for the FilterList
                IpSecStoreKey.CreateSubKey(name);

                //Open the subkey as writable.
                filterListSubKey = IpSecStoreKey.OpenSubKey(name, true);

                //Populate the registry entries
                CreateFilterListKey(filterName, filterDescription);
            }