def is_selfsigned(cert):
    """
    Returns True if the certificate is self-signed.
    Returns False for failed verification or unsupported signing algorithm.
    """
    try:
        check_cert_signature(cert, cert.public_key())
        # If verification was successful, it's self-signed.
        return True
    except InvalidSignature:
        return False

    Returns True if the certificate is self-signed.
    Returns False for failed verification or unsupported signing algorithm.
    
lemur/common/utils.py