public bool PolicyGroupMapExists(string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { using (ConfigDatabase db = this.Store.CreateReadContext()) { return(db.CertPolicyGroupMaps.Exists(policyName, groupName, policyUse, incoming, outgoing)); } }
internal void PushAddPolicyToGroup(string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing, bool checkForDupes) { try { if (!checkForDupes || !Client.Contains(policyName, groupName, policyUse, incoming, outgoing)) { Client.AddPolicyToGroup(policyName, groupName, policyUse, incoming, outgoing); WriteLine("Added {0} to {1}", policyName, groupName); WriteLine("With the following usage >"); WriteLine(" \t policyUse: {0}", policyUse.ToString()); WriteLine(" \t forIncoming: {0}", incoming); WriteLine(" \t forOutgoing: {0}", outgoing); } else { WriteLine("Policy to group association already exists"); } } catch (FaultException <ConfigStoreFault> ex) { if (ex.Detail.Error == ConfigStoreError.UniqueConstraint) { WriteLine("Policy to group association already exists"); } else { throw; } } }
public CertPolicyGroupMap(CertPolicyUse use, bool forIncoming, bool forOutgoing) : this() { m_new = true; Use = use; ForIncoming = forIncoming; ForOutgoing = forOutgoing; }
public CertPolicyGroupMap(CertPolicyUse use, bool forIncoming, bool forOutgoing): this() { m_new = true; Use = use; ForIncoming = forIncoming; ForOutgoing = forOutgoing; }
public void AddPolicyUse(string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { using (ConfigDatabase db = this.Store.CreateContext(DataLoadOptions)) { this.AddPolicyUse(db, policyName, groupName, policyUse, incoming, outgoing); db.SubmitChanges(); } }
public bool PolicyToGroupExists(string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { try { return(Store.CertPolicyGroups.PolicyGroupMapExists(policyName, groupName, policyUse, incoming, outgoing)); } catch (Exception ex) { throw CreateFault("PolicyToGroupExists", ex); } }
public CertPolicy[] GetOutgoingPoliciesByOwner(string owner, CertPolicyUse use) { try { return(Store.CertPolicies.GetOutgoingByOwner(owner, use)); } catch (Exception ex) { throw CreateFault("GetOutgoingPoliciesByOwner", ex); } }
public CertPolicy[] GetOutgoingByOwner(string owner, CertPolicyUse use) { if (string.IsNullOrEmpty(owner)) { throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName); } using (ConfigDatabase db = this.Store.CreateReadContext()) { var cpgs = db.CertPolicies.GetOutgoing(owner, use); return(cpgs.ToArray()); } }
public void AddPolicyToGroup(string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { try { CertPolicy certPolicy = Store.CertPolicies.Get(policyName); if (certPolicy == null) { throw new ConfigStoreException(ConfigStoreError.InvalidCertPolicyName); } Store.CertPolicyGroups.AddPolicyUse(policyName, groupName, policyUse, incoming, outgoing); } catch (FaultException faultEx) { throw faultEx; } catch (Exception ex) { throw CreateFault("AddPolicyToGroup", ex); } }
public CertPolicy[] GetOutgoingPoliciesByOwner(string owner, CertPolicyUse use) { try { return Store.CertPolicies.GetOutgoingByOwner(owner, use); } catch (Exception ex) { throw CreateFault("GetOutgoingPoliciesByOwner", ex); } }
public static bool Exists(this Table <CertPolicyGroupMap> table, string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { return(map(table.GetDB(), policyName, groupName, policyUse, incoming, outgoing).Any()); }
internal CertPolicyIndex(ClientSettings clientSettings, bool incoming, CertPolicyUse use) { m_clientSettings = clientSettings; m_incoming = incoming; m_use = use; }
public bool PolicyToGroupExists(string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { try { return Store.CertPolicyGroups.PolicyGroupMapExists(policyName, groupName, policyUse, incoming, outgoing); } catch (Exception ex) { throw CreateFault("PolicyToGroupExists", ex); } }
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; }
public static IEnumerable <CertPolicy> GetOutgoing(this Table <CertPolicy> table, string owner, CertPolicyUse use) { var q = from c in table.GetDB().CertPolicies join groupMap in table.GetDB().CertPolicyGroupMaps on c equals groupMap.CertPolicy join g in table.GetDB().CertPolicyGroups on groupMap.CertPolicyGroup equals g join domainMap in table.GetDB().CertPolicyGroupDomainMaps on g equals domainMap.CertPolicyGroup where domainMap.Owner == @owner && groupMap.ForOutgoing && groupMap.Use == use select c; return(q); }
public static bool Contains(this CertPolicyStoreClient client, string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { return client.PolicyToGroupExists(policyName, groupName, policyUse, incoming, outgoing); }
public static bool Exists(this Table<CertPolicyGroupMap> table, string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { return map(table.GetDB(), policyName, groupName, policyUse, incoming, outgoing).Any(); }
public static IEnumerable<CertPolicy> GetOutgoing(this Table<CertPolicy> table, string owner, CertPolicyUse use) { var q = from c in table.GetDB().CertPolicies join groupMap in table.GetDB().CertPolicyGroupMaps on c equals groupMap.CertPolicy join g in table.GetDB().CertPolicyGroups on groupMap.CertPolicyGroup equals g join domainMap in table.GetDB().CertPolicyGroupDomainMaps on g equals domainMap.CertPolicyGroup where domainMap.Owner == @owner && groupMap.ForOutgoing && groupMap.Use == use select c; return q; }
public static bool Contains(this CertPolicyStoreClient client, string policyName, string groupName, CertPolicyUse policyUse, bool incoming, bool outgoing) { return(client.PolicyToGroupExists(policyName, groupName, policyUse, incoming, outgoing)); }