Rename key_fmt to key_file_fmt type and introduce a real key_fmt enum.