Esempio n. 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();
            }
Esempio n. 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);
            }
Esempio n. 3
0
            public FilterAction()
            {
                name += ipSecID;

                IpSecStoreKey.CreateSubKey(name);

                filterActionKey = IpSecStoreKey.OpenSubKey(name, true);

                CreateFilterAction("ExampleLagAction");
            }
Esempio n. 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) });
                }
Esempio n. 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);
                }
Esempio n. 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);
                }
Esempio n. 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);
            }