code: def getDaysToExpire(self):
          
  
          delta = 0
          today = DateTime()
          valid_from = self.getValidFrom() or today
          valid_to = self.getValidTo()
  
          # one of the fields is not set, return 0 days
          if not valid_from or not valid_to:
              return 0
          # valid_from comes after valid_to?
          if valid_from > valid_to:
              return 0
          # calculate the time between today and valid_to, even if valid_from
          # is in the future.
          else:
              delta = valid_to - today
  
          return int(math.ceil(delta))
docs: Returns the days until this certificate expires
  
          :returns: Days until the certificate expires
          :rtype: int