public static function fromASN1(TaggedType $el): self
    {
        switch ($el->tag()) {
            case self::TYPE_NAME:
                return TargetName::fromChosenASN1($el->asExplicit()->asTagged());
            case self::TYPE_GROUP:
                return TargetGroup::fromChosenASN1(
                    $el->asExplicit()->asTagged());
            case self::TYPE_CERT:
                throw new \RuntimeException("targetCert not supported.");
        }
        throw new \UnexpectedValueException(
            "Target type " . $el->tag() . " not supported.");
    }
public static function fromASN1(TaggedType $el): self
    {
        switch ($el->tag()) {
            case self::TYPE_NAME:
                return TargetName::fromChosenASN1($el->asExplicit()->asTagged());
            case self::TYPE_GROUP:
                return TargetGroup::fromChosenASN1(
                    $el->asExplicit()->asTagged());
            case self::TYPE_CERT:
                throw new \RuntimeException("targetCert not supported.");
        }
        throw new \UnexpectedValueException(
            "Target type " . $el->tag() . " not supported.");
    }
public static function fromASN1 ( TaggedType $ el ) : self { switch ( $ el -> tag ( ) ) { case self :: TYPE_NAME : return TargetName :: fromChosenASN1 ( $ el -> asExplicit ( ) -> asTagged ( ) ) ; case self :: TYPE_GROUP : return TargetGroup :: fromChosenASN1 ( $ el -> asExplicit ( ) -> asTagged ( ) ) ; case self :: TYPE_CERT : throw new \ RuntimeException ( "targetCert not supported." ) ; } throw new \ UnexpectedValueException ( "Target type " . $ el -> tag ( ) . " not supported." ) ; }
Parse from ASN.1.

@param TaggedType $el
@throws \UnexpectedValueException
@return self
Parse from ASN . 1 .