Esempio n. 1
0
File: Name.php Progetto: sop/x501
 /**
  * Initialize from ASN.1.
  *
  * @param Sequence $seq
  * @return self
  */
 public static function fromASN1(Sequence $seq)
 {
     $rdns = array_map(function (UnspecifiedType $el) {
         return RDN::fromASN1($el->asSet());
     }, $seq->elements());
     return new self(...$rdns);
 }
Esempio n. 2
0
 /**
  * Initialize from TaggedType.
  *
  * @param TaggedType $el
  * @throws \UnexpectedValueException
  * @return self
  */
 public static function fromTaggedType(TaggedType $el)
 {
     switch ($el->tag()) {
         case self::TAG_FULL_NAME:
             return new FullName(GeneralNames::fromASN1($el->asImplicit(Element::TYPE_SEQUENCE)->asSequence()));
         case self::TAG_RDN:
             return new RelativeName(RDN::fromASN1($el->asImplicit(Element::TYPE_SET)->asSet()));
         default:
             throw new \UnexpectedValueException("DistributionPointName tag " . $el->tag() . " not supported.");
     }
 }
Esempio n. 3
0
 protected function _valueASN1()
 {
     return $this->_rdn->toASN1();
 }