is_valid_certificate

igwn_auth_utils.x509.is_valid_certificate(cert, timeleft=600)

Return True if cert contains a valid X.509 certificate.

Parameters:
  • cert (cryptography.x509.Certificate, str, file) – the certificate object or file (object or path) to validate

  • timeleft (float, optional) – the minimum required time until expiry (seconds)

Returns:

isvalid – whether the certificate is valid

Return type:

bool