added public methods is_ca() and is_valid()