}
/**
- * Constructor for policy using existing rules.
+ * Constructor for policy using existing rules. The lifetime of the policy rules
+ * must be at least as long as the policy object.
*
* @param rules reference to array of policy rules to use
* @param metadataProvider locked MetadataProvider instance
}
/**
+ * Adds a SecurityPolicyRule to the policy. The lifetime of the policy rule
+ * must be at least as long as the policy object.
+ *
+ * @param rule SecurityPolicyRule to add
+ */
+ void addRule(const SecurityPolicyRule* rule) {
+ m_rules.push_back(rule);
+ }
+
+ /**
* Sets a locked MetadataProvider for the policy.
*
* @param metadata a locked MetadataProvider or NULL
*
* @return the effective IssuerMatchingPolicy
*/
- const IssuerMatchingPolicy* getIssuerMatchingPolicy() const {
- return m_matchingPolicy ? m_matchingPolicy : &m_defaultMatching;
+ const IssuerMatchingPolicy& getIssuerMatchingPolicy() const {
+ return m_matchingPolicy ? *m_matchingPolicy : m_defaultMatching;
}
/**
*
* @param matchingPolicy the IssuerMatchingPolicy to use
*/
- void getIssuerMatchingPolicy(IssuerMatchingPolicy* matchingPolicy) {
+ void setIssuerMatchingPolicy(IssuerMatchingPolicy* matchingPolicy) {
delete m_matchingPolicy;
m_matchingPolicy = matchingPolicy;
}