Example #1
0
        private void OnPolicyAdded(CertPolicy policyGroup)
        {
            CertPolicyGroupMap map = new CertPolicyGroupMap(true);

            map.CertPolicyGroup = this;
            map.CertPolicy      = policyGroup;
        }
Example #2
0
        private void OnPolicyGroupRemoved(CertPolicyGroup policyGroup)
        {
            CertPolicyGroupMap map =
                CertPolicyGroupMap.SingleOrDefault(pg => pg.CertPolicy == this && pg.CertPolicyGroup == policyGroup);

            if (map != null)
            {
                map.Remove();
            }
        }
Example #3
0
        protected void AddPolicyUse(ConfigDatabase db, string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (String.IsNullOrEmpty(policyName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidCertPolicyName);
            }
            if (String.IsNullOrEmpty(groupName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidCertPolicyGroupName);
            }
            CertPolicyGroup group  = db.CertPolicyGroups.Get(groupName);
            CertPolicy      policy = db.CertPolicyGroups.GetPolicy(policyName);

            group.CertPolicies.Add(policy);
            CertPolicyGroupMap map = group.CertPolicyGroupMaps.First(m => m.IsNew);

            map.Use         = policyUse;
            map.ForIncoming = incoming;
            map.ForOutgoing = outgoing;
        }
Example #4
0
 public static void ExecDeleteGroupMap(this Table<CertPolicyGroup> table, CertPolicyGroupMap map)
 {
     table.Context.ExecuteCommand(Sql_DeleteCertPolicyGroupMap, map.CertPolicy.ID, map.CertPolicyGroup.ID);
 }
 public static void ExecDeleteGroupMap(this Table <CertPolicyGroup> table, CertPolicyGroupMap map)
 {
     table.Context.ExecuteCommand(Sql_DeleteCertPolicyGroupMap, map.CertPolicy.ID, map.CertPolicyGroup.ID);
 }
Example #6
0
 private void OnPolicyGroupAdded(CertPolicyGroup policyGroup)
 {
     CertPolicyGroupMap map = new CertPolicyGroupMap(true);
     map.CertPolicy = this;
     map.CertPolicyGroup = policyGroup;
 }
Example #7
0
 public static void Add(this ICollection<CertPolicy> policies, CertPolicy policy, CertPolicyGroupMap certPolicyGroupMap)
 {
     policies.Add(policy);
     
     // Find the new map and add Use attributes
     foreach (var certPolicy in policies)
     {
         foreach (var policyGroupMap in certPolicy.CertPolicyGroupMap)
         {
             if (policyGroupMap.CertPolicy.ID == certPolicyGroupMap.CertPolicy.ID
                 && policyGroupMap.CertPolicyGroup.ID == certPolicyGroupMap.CertPolicyGroup.ID)
             {
                 policyGroupMap.Use = certPolicyGroupMap.Use;
                 policyGroupMap.ForIncoming = certPolicyGroupMap.ForIncoming;
                 policyGroupMap.ForOutgoing = certPolicyGroupMap.ForOutgoing;
                 return;
             }
         }
     }
 }
Example #8
0
        public static void Add(this ICollection <CertPolicy> policies, CertPolicy policy, CertPolicyGroupMap certPolicyGroupMap)
        {
            policies.Add(policy);

            // Find the new map and add Use attributes
            foreach (var certPolicy in policies)
            {
                foreach (var policyGroupMap in certPolicy.CertPolicyGroupMap)
                {
                    if (policyGroupMap.CertPolicy.ID == certPolicyGroupMap.CertPolicy.ID &&
                        policyGroupMap.CertPolicyGroup.ID == certPolicyGroupMap.CertPolicyGroup.ID)
                    {
                        policyGroupMap.Use         = certPolicyGroupMap.Use;
                        policyGroupMap.ForIncoming = certPolicyGroupMap.ForIncoming;
                        policyGroupMap.ForOutgoing = certPolicyGroupMap.ForOutgoing;
                        return;
                    }
                }
            }
        }