Listing all entity properties identifying unique entity instance? Is there a generic way of knowing what collection of properties on an entity identify it as a unique instance?

For example, a node has a node id, and a revision id. Some entities do not have the revision id, other entities might require further keys.

Usecase example: Storing various entities in an external system, one wants to be sure to store enough data to be able to uniquely identify the resources in that system.
I have always assumed that when you do

$entity_info = entity_get_info('foo');
$table = $entity_info['base table'];
$schema = drupal_get_schema($table);


and then examine $schema['primary key'] and $schema['unique keys'] you get a tuple to represent uniqueness.

I would also assume that you can do

$entity_info = entity_get_info('foo');
$keys = $entity_info['entity keys'];


and this would represent a tuple to uniquely identify an entity.  However, this gets a little confusing.  For example, if you have UUID installed, then there is a uuid and revision uuid in the results.  These are not needed within one system, but will guarantee uniqueness between systems.