asSequence(); $type_id = $seq->at(0) ->asObjectIdentifier() ->oid(); $value = $seq->getTagged(0) ->asExplicit() ->asElement(); return self::create($type_id, $value); } public function string(): string { return $this->type . '/#' . bin2hex($this->element->toDER()); } /** * Get type OID. */ public function type(): string { return $this->type; } /** * Get value element. */ public function value(): Element { return $this->element; } protected function choiceASN1(): TaggedType { return ImplicitlyTaggedType::create( $this->tag, Sequence::create(ObjectIdentifier::create($this->type), ExplicitlyTaggedType::create(0, $this->element)) ); } }