<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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 """

    try:
        cert_str = pem_format(key)
        cert = crypto.load_certificate(crypto.FILETYPE_PEM, cert_str)
        assert cert.has_expired() == 0
        assert not OpenSSLWrapper().certificate_not_valid_yet(cert)
        return True
    except AssertionError:
        return False
    except AttributeError:
        return False