refactor import_keys to take directly an open file.