'Check whether the certificate has expired.
:return: True if the certificate has expired, false otherwise'

def has_expired(self):

    now = int(time())
    notAfter = _lib.X509_get_notAfter(self._x509)
    return (_lib.ASN1_UTCTIME_cmp_time_t(_ffi.cast('ASN1_UTCTIME*', notAfter), now) < 0)
