Function desfire::fs::create_app

Function Documentation

result desfire::fs::create_app(tag &tag, app_id aid, any_key master_key, key_rights const &rights, std::uint8_t extra_keys = 0)

Creates a new AES128 app with the given master_key, allowing for a certain number of extra_keys. The caller is responsible for selecting the root app and authenticating. On successful exit, the tag will have aid selected and master_key authenticated.

Parameters:
  • tag – Tag on which to operate.

  • aid – Application id to create. Make sure it does not exist.

  • master_key – The key number is ignored, the key is used as master key with key number zero.

  • rights – These key rights will be applied to the app after the key has been changed.

  • extra_keys – Number of extra keys to allow in the app. Note that if you set key_rights::allowed_to_change_keys to desfire::no_key in rights, you will never be able to change any of the extra keys.

Returns:

Either mlab::result_success or any of the error codes returned by tag::select_application, tag::create_application, tag::change_app_settings, tag::authenticate, tag::change_key.