'Return a byte string that encodes the given payload length (in
bytes) in a format suitable for a DER length tag (L).'

def _lengthOctets(self, payloadLen):

    if (payloadLen > 127):
        encoding = long_to_bytes(payloadLen)
        return (bchr((len(encoding) + 128)) + encoding)
    return bchr(payloadLen)
