Function desfire::fs::create_ro_data_file

Function Documentation

result desfire::fs::create_ro_data_file(tag &tag, file_id fid, mlab::bin_data const &data, key_actor<free_access_t> read_access, file_security security)

Creates a read-only data file the specified read_access in the current application. The file can only be deleted afterwards, it is not possible to write on it. Reading requires authentication depending on the value of read_access. This assumes the app is already selected, the user is already authenticated, if the security settings require so, and file fid does not exists. The caller is responsible for selecting the app and authenticating. No change in app and authentication is performed by this method.

Parameters:
  • tag – Tag on which to operate.

  • fid – The file id, in the range 0..15 (included).

  • data – Content of the file.

  • read_access – The read access to apply to file_access_rights::read.

  • security – Security to use for this file. Note that if read_access is set to free_access, this file might as well use file_security::none.

Returns:

Either mlab::result_success, or any of the error codes returned by tag::create_file, tag::write_data or tag::change_file_settings.