'Sets the certificate serial number.'

def serial_number(self, number):

    if (not isinstance(number, six.integer_types)):
        raise TypeError('Serial    number    must    be    of    integral    type.')
    if (self._serial_number is not None):
        raise ValueError('The    serial    number    may    only    be    set    once.')
    if (number < 0):
        raise ValueError('The    serial    number    should    be    non-negative.')
    if (utils.bit_length(number) > 160):
        raise ValueError('The    serial    number    should    not    be    more    than    160    bits.')
    return CertificateBuilder(self._issuer_name, self._subject_name, self._public_key, number, self._not_valid_before, self._not_valid_after, self._extensions)
