private function _parseAttrTypeAndValue(int &$offset): array
    {
        $idx = $offset;
        $type = $this->_parseAttrType($idx);
        $this->_skipWs($idx);
        if ($idx >= $this->_len || "=" != $this->_dn[$idx++]) {
            throw new \UnexpectedValueException("Invalid type and value pair.");
        }
        $this->_skipWs($idx);
        // hexstring
        if ($idx < $this->_len && "#" == $this->_dn[$idx]) {
            ++$idx;
            $data = $this->_parseAttrHexValue($idx);
            try {
                $value = Element::fromDER($data);
            } catch (DecodeException $e) {
                throw new \UnexpectedValueException(
                    "Invalid DER encoding from hexstring.", 0, $e);
            }
        } else {
            $value = $this->_parseAttrStringValue($idx);
        }
        $offset = $idx;
        return array($type, $value);
    }
private function _parseAttrTypeAndValue(int &$offset): array
    {
        $idx = $offset;
        $type = $this->_parseAttrType($idx);
        $this->_skipWs($idx);
        if ($idx >= $this->_len || "=" != $this->_dn[$idx++]) {
            throw new \UnexpectedValueException("Invalid type and value pair.");
        }
        $this->_skipWs($idx);
        // hexstring
        if ($idx < $this->_len && "#" == $this->_dn[$idx]) {
            ++$idx;
            $data = $this->_parseAttrHexValue($idx);
            try {
                $value = Element::fromDER($data);
            } catch (DecodeException $e) {
                throw new \UnexpectedValueException(
                    "Invalid DER encoding from hexstring.", 0, $e);
            }
        } else {
            $value = $this->_parseAttrStringValue($idx);
        }
        $offset = $idx;
        return array($type, $value);
    }
private function _parseAttrTypeAndValue ( int & $ offset ) : array { $ idx = $ offset ; $ type = $ this -> _parseAttrType ( $ idx ) ; $ this -> _skipWs ( $ idx ) ; if ( $ idx >= $ this -> _len || "=" != $ this -> _dn [ $ idx ++ ] ) { throw new \ UnexpectedValueException ( "Invalid type and value pair." ) ; } $ this -> _skipWs ( $ idx ) ; // hexstring if ( $ idx < $ this -> _len && "#" == $ this -> _dn [ $ idx ] ) { ++ $ idx ; $ data = $ this -> _parseAttrHexValue ( $ idx ) ; try { $ value = Element :: fromDER ( $ data ) ; } catch ( DecodeException $ e ) { throw new \ UnexpectedValueException ( "Invalid DER encoding from hexstring." , 0 , $ e ) ; } } else { $ value = $ this -> _parseAttrStringValue ( $ idx ) ; } $ offset = $ idx ; return array ( $ type , $ value ) ; }
Parse 'attributeTypeAndValue'.

attributeType "=" attributeValue

@param int $offset
@throws \UnexpectedValueException
@return array A tuple of [type, value]. Value may be either a string or
an Element, if it's encoded as hexstring.
Parse attributeTypeAndValue .