def validCertTime(cert):
    '''Verify that TLS certificate *cert*'s time is not earlier than
    cert.notBefore and not later than cert.notAfter.

    :param OpenSSL.crypto.X509 cert: TLS Certificate to verify times of
    :returns: **bool** **True** if cert.notBefore < now < cert.notAfter,
        **False** otherwise
    '''
    now = datetime.now()
    try:
        validAfter = datetime.strptime(cert.get_notBefore(), '%Y%m%d%H%M%SZ')
        validUntil = datetime.strptime(cert.get_notAfter(), '%Y%m%d%H%M%SZ')
        return validAfter < now < validUntil
    except __HOLE__:
        return False
dataset/ETHPy150Open nskinkel/oppy/oppy/crypto/util.py/validCertTime