protected static function parseOid(&$binaryData, &$offsetIndex, $octetsToRead)
    {
        $oid = '';

        while ($octetsToRead > 0) {
            $octets = '';

            do {
                if (0 === $octetsToRead) {
                    throw new ParserException('Malformed ASN.1 Object Identifier', $offsetIndex - 1);
                }

                $octetsToRead--;
                $octet = $binaryData[$offsetIndex++];
                $octets .= $octet;
            } while (ord($octet) & 0x80);

            $oid .= sprintf('%d.', Base128::decode($octets));
        }

        // Remove trailing '.'
        return substr($oid, 0, -1) ?: '';
    }
protected static function parseOid(&$binaryData, &$offsetIndex, $octetsToRead)
    {
        $oid = '';

        while ($octetsToRead > 0) {
            $octets = '';

            do {
                if (0 === $octetsToRead) {
                    throw new ParserException('Malformed ASN.1 Object Identifier', $offsetIndex - 1);
                }

                $octetsToRead--;
                $octet = $binaryData[$offsetIndex++];
                $octets .= $octet;
            } while (ord($octet) & 0x80);

            $oid .= sprintf('%d.', Base128::decode($octets));
        }

        // Remove trailing '.'
        return substr($oid, 0, -1) ?: '';
    }
protected static function parseOid ( & $ binaryData , & $ offsetIndex , $ octetsToRead ) { $ oid = '' ; while ( $ octetsToRead > 0 ) { $ octets = '' ; do { if ( 0 === $ octetsToRead ) { throw new ParserException ( 'Malformed ASN.1 Object Identifier' , $ offsetIndex - 1 ) ; } $ octetsToRead -- ; $ octet = $ binaryData [ $ offsetIndex ++ ] ; $ octets .= $ octet ; } while ( ord ( $ octet ) & 0x80 ) ; $ oid .= sprintf ( '%d.' , Base128 :: decode ( $ octets ) ) ; } // Remove trailing '.' return substr ( $ oid , 0 , - 1 ) ? : '' ; }
Parses an object identifier except for the first octet, which is parsed
differently. This way relative object identifiers can also be parsed
using this.

@param $binaryData
@param $offsetIndex
@param $octetsToRead

@throws ParserException

@return string
Parses an object identifier except for the first octet which is parsed differently . This way relative object identifiers can also be parsed using this .