예제 #1
0
파일: Target.php 프로젝트: sop/x509
 /**
  * Check whether target is equal to another.
  *
  * @param Target $other
  * @return bool
  */
 public function equals(Target $other)
 {
     if ($this->_type != $other->_type) {
         return false;
     }
     if ($this->toASN1()->toDER() != $other->toASN1()->toDER()) {
         return false;
     }
     return true;
 }
예제 #2
0
파일: Targets.php 프로젝트: sop/x509
 /**
  * Check whether given target is present.
  *
  * @param Target $target
  * @return boolean
  */
 public function hasTarget(Target $target)
 {
     foreach ($this->_allOfType($target->type()) as $t) {
         if ($target->equals($t)) {
             return true;
         }
     }
     return false;
 }