def bitstrength(cert):
    """
    Calculates a certificates public key bit length.

    :param cert:
    :return: Integer
    """
    try:
        return cert.public_key().key_size
    except AttributeError:
        capture_exception()
        current_app.logger.debug("Unable to get bitstrength.")

    Calculates a certificates public key bit length.

    :param cert:
    :return: Integer
    
lemur/common/defaults.py