示例#1
0
 /**
  *
  * @param ValidatorState $state
  * @return ValidatorState
  */
 private function _calculatePolicyIntersection(ValidatorState $state)
 {
     // (i) If the valid_policy_tree is NULL, the intersection is NULL
     if (!$state->hasValidPolicyTree()) {
         return $state;
     }
     // (ii) If the valid_policy_tree is not NULL and
     // the user-initial-policy-set is any-policy, the intersection
     // is the entire valid_policy_tree
     $initial_policies = $this->_config->policySet();
     if (in_array(PolicyInformation::OID_ANY_POLICY, $initial_policies)) {
         return $state;
     }
     // (iii) If the valid_policy_tree is not NULL and the
     // user-initial-policy-set is not any-policy, calculate
     // the intersection of the valid_policy_tree and the
     // user-initial-policy-set as follows
     return $state->validPolicyTree()->calculateIntersection($state, $initial_policies);
 }
示例#2
0
文件: PolicyTree.php 项目: sop/x509
 /**
  * Delete nodes as specified in 6.1.4 (b)(2).
  *
  * @param Certificate $cert
  * @param ValidatorState $state
  */
 protected function _deleteMappings(Certificate $cert, ValidatorState $state)
 {
     $idps = $cert->tbsCertificate()->extensions()->policyMappings()->issuerDomainPolicies();
     // delete each node of depth i in the valid_policy_tree
     // where ID-P is the valid_policy
     foreach ($this->_nodesAtDepth($state->index()) as $node) {
         if (in_array($node->validPolicy(), $idps)) {
             $node->remove();
         }
     }
     $this->_pruneTree($state->index() - 1);
 }