'This returns the number of seconds this association is still
valid for, or C{0} if the association is no longer valid.
@return: The number of seconds this association is still valid
for, or C{0} if the association is no longer valid.
@rtype: C{int}'

def getExpiresIn(self, now=None):

    if (now is None):
        now = int(time.time())
    return max(0, ((self.issued + self.lifetime) - now))
