示例#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 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);
                }