

def verify_certificate(certificate):
    'Verify that the certificate has not expired.\n\n    :param certificate: the cryptography certificate object\n    :raises: SignatureVerificationError if the certificate valid time range\n             does not include now\n    '
    now = timeutils.utcnow()
    if (now < certificate.not_valid_before):
        raise exception.SignatureVerificationError(reason=(_('Certificate is not valid before: %s UTC') % certificate.not_valid_before))
    elif (now > certificate.not_valid_after):
        raise exception.SignatureVerificationError(reason=(_('Certificate is not valid after: %s UTC') % certificate.not_valid_after))

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/signature_utils.py verify_certificate/original