Example #1
0
 /**
  *
  * @param string $data
  * @param bool $critical
  * @return self
  */
 protected static function _fromDER($data, $critical)
 {
     $targets = array_map(function (UnspecifiedType $el) {
         return Targets::fromASN1($el->asSequence());
     }, Sequence::fromDER($data)->elements());
     return new self($critical, ...$targets);
 }
Example #2
0
 /**
  * Check whether validation configuration has matching targets.
  *
  * @param Targets $targets Set of eligible targets
  * @return boolean
  */
 private function _hasMatchingTarget(Targets $targets)
 {
     foreach ($this->_config->targets() as $target) {
         if ($targets->hasTarget($target)) {
             return true;
         }
     }
     return false;
 }