':return:
The bit size of the private key, as an integer'

@property
def bit_size(self):

    if (self._bit_size is None):
        if (self.algorithm == u'rsa'):
            prime = self[u'private_key'].parsed[u'modulus'].native
        elif (self.algorithm == u'dsa'):
            prime = self[u'private_key_algorithm'][u'parameters'][u'p'].native
        elif (self.algorithm == u'ec'):
            prime = self[u'private_key'].parsed[u'private_key'].native
        self._bit_size = int(math.ceil(math.log(prime, 2)))
        modulus = (self._bit_size % 8)
        if (modulus != 0):
            self._bit_size += (8 - modulus)
    return self._bit_size
