def active_cert(key):
    """
    Verifies that a key is active that is present time is after not_before
    and before not_after.

    :param key: The Key
    :return: True if the key is active else False
    """
    cert_str = pem_format(key)
    certificate = importKey(cert_str)
    try:
        not_before = to_time(str(certificate.get_not_before()))
        not_after = to_time(str(certificate.get_not_after()))
        assert not_before < utc_now()
        assert not_after > utc_now()
        return True
    except __HOLE__:
        return False
    except AttributeError:
        return False
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/sigver.py/active_cert