/** * Initialize from ASN.1. * * @param Sequence $seq * @return self */ public static function fromASN1(Sequence $seq) { $org = DisplayText::fromASN1($seq->at(0)->asString()); $numbers = array_map(function (UnspecifiedType $el) { return $el->asInteger()->number(); }, $seq->at(1)->asSequence()->elements()); return new self($org, ...$numbers); }
/** * * @param UnspecifiedType $el * @return self */ public static function fromQualifierASN1(UnspecifiedType $el) { $seq = $el->asSequence(); $ref = null; $text = null; $idx = 0; if ($seq->has($idx, Element::TYPE_SEQUENCE)) { $ref = NoticeReference::fromASN1($seq->at($idx++)->asSequence()); } if ($seq->has($idx, Element::TYPE_STRING)) { $text = DisplayText::fromASN1($seq->at($idx)->asString()); } return new self($text, $ref); }