code: def bit_size(self):
          
  
          if self._bit_size is None:
              if self.algorithm == 'rsa':
                  prime = self['private_key'].parsed['modulus'].native
              elif self.algorithm == 'dsa':
                  prime = self['private_key_algorithm']['parameters']['p'].native
              elif self.algorithm == 'ec':
                  prime = self['private_key'].parsed['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
docs: :return:
              The bit size of the private key, as an integer