(cert, expires=0)
Checks a given certificate for expiry.

  Args:
    cert: Certificate object
    expires: int, the number of seconds to check for expiry. 0 means now
  Returns:
    boolean, whether the certificate will expire in expires seconds
  Raises:
    CertError: cert is a mandatory argument
    CertError: cert is not a PEM encoded x509 cert
Checks a given certificate for expiry.
Checks a given certificate for expiry .
def CertificateExpired(cert, expires=0):
  """Checks a given certificate for expiry.

  Args:
    cert: Certificate object
    expires: int, the number of seconds to check for expiry. 0 means now
  Returns:
    boolean, whether the certificate will expire in expires seconds
  Raises:
    CertError: cert is a mandatory argument
    CertError: cert is not a PEM encoded x509 cert
  """
  expiry = datetime.datetime.today() + datetime.timedelta(seconds=expires)
  # enddate is a list of [str, (datetime|None)], we want the datetime object
  cert_end = cert.enddate[1]
  if cert_end:
    return expiry > cert_end
  else:
    raise CertError('Certificate has a malformed enddate.')
def CertificateExpired ( cert , expires = 0 ) : expiry = datetime . datetime . today ( ) + datetime . timedelta ( seconds = expires ) # enddate is a list of [str, (datetime|None)], we want the datetime object cert_end = cert . enddate [ 1 ] if cert_end : return expiry > cert_end else : raise CertError ( 'Certificate has a malformed enddate.' )