Nitrokey / libnitrokey

Communicate with Nitrokey devices in a clean and easy manner
https://nitrokey.com/
GNU Lesser General Public License v3.0
65 stars 34 forks source link

Add NK_config struct and read/write functions #176

Closed robinkrahl closed 4 years ago

robinkrahl commented 4 years ago

This patch adds the NK_config struct to the C API that stores the general configuration of a Nitrokey device. It also adds the NK_read_config_struct and NK_write_config_struct functions to make the API easier to use. While NK_write_config_struct is only a convenience method, NK_read_config_struct makes the API more safe as the user no longer has to read the data from a pointer to an array.

This patch also extends the test_read_write_config test case with the two new functions.

szszszsz commented 4 years ago

Works as intended, thank you!