aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 16:03:16 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 16:03:16 +0100
commitd5486ba77235a874245fbee07a75cea89fa59ea2 (patch)
tree7f2df53da4c018fbfa6ec57809bcd2fcefaf0624 /NK_C_API.h
parent102ee60cd8ee9e5ce263de1d4a775acf29f37fbc (diff)
parenta262472826830ea0a98a4da2fa8f665d359b8789 (diff)
downloadlibnitrokey-d5486ba77235a874245fbee07a75cea89fa59ea2.tar.gz
libnitrokey-d5486ba77235a874245fbee07a75cea89fa59ea2.tar.bz2
Merge branch 'wip-support_storage_v0.51'
Support for functionality added in v0.49/v0.51
Diffstat (limited to 'NK_C_API.h')
-rw-r--r--NK_C_API.h66
1 files changed, 61 insertions, 5 deletions
diff --git a/NK_C_API.h b/NK_C_API.h
index a4fb088..73022b2 100644
--- a/NK_C_API.h
+++ b/NK_C_API.h
@@ -360,10 +360,16 @@ extern "C" {
/**
* Get device's major firmware version
- * @return 7,8 for Pro and major for Storage
+ * @return major part of the version number (e.g. 0 from 0.48, 0 from 0.7 etc.)
*/
NK_C_API int NK_get_major_firmware_version();
+ /**
+ * Get device's minor firmware version
+ * @return minor part of the version number (e.g. 7 from 0.7, 48 from 0.48 etc.)
+ */
+ NK_C_API int NK_get_minor_firmware_version();
+
/**
@@ -422,21 +428,71 @@ extern "C" {
* Make unencrypted volume read-only.
* Device hides unencrypted volume for a second therefore make sure
* buffers are flushed before running.
+ * Does nothing if firmware version is not matched
+ * Firmware range: Storage v0.50, v0.48 and below
* Storage only
- * @param user_pin 20 characters
+ * @param user_pin 20 characters User PIN
* @return command processing error code
*/
- NK_C_API int NK_set_unencrypted_read_only(const char* user_pin);
+ NK_C_API int NK_set_unencrypted_read_only(const char *user_pin);
/**
* Make unencrypted volume read-write.
* Device hides unencrypted volume for a second therefore make sure
* buffers are flushed before running.
+ * Does nothing if firmware version is not matched
+ * Firmware range: Storage v0.50, v0.48 and below
* Storage only
- * @param user_pin 20 characters
+ * @param user_pin 20 characters User PIN
+ * @return command processing error code
+ */
+ NK_C_API int NK_set_unencrypted_read_write(const char *user_pin);
+
+ /**
+ * Make unencrypted volume read-only.
+ * Device hides unencrypted volume for a second therefore make sure
+ * buffers are flushed before running.
+ * Does nothing if firmware version is not matched
+ * Firmware range: Storage v0.49, v0.51+
+ * Storage only
+ * @param admin_pin 20 characters Admin PIN
+ * @return command processing error code
+ */
+ NK_C_API int NK_set_unencrypted_read_only_admin(const char* admin_pin);
+
+ /**
+ * Make unencrypted volume read-write.
+ * Device hides unencrypted volume for a second therefore make sure
+ * buffers are flushed before running.
+ * Does nothing if firmware version is not matched
+ * Firmware range: Storage v0.49, v0.51+
+ * Storage only
+ * @param admin_pin 20 characters Admin PIN
+ * @return command processing error code
+ */
+ NK_C_API int NK_set_unencrypted_read_write_admin(const char* admin_pin);
+
+ /**
+ * Make encrypted volume read-only.
+ * Device hides encrypted volume for a second therefore make sure
+ * buffers are flushed before running.
+ * Firmware range: v0.49 only, future (see firmware release notes)
+ * Storage only
+ * @param admin_pin 20 characters
+ * @return command processing error code
+ */
+ NK_C_API int NK_set_encrypted_read_only(const char* admin_pin);
+
+ /**
+ * Make encrypted volume read-write.
+ * Device hides encrypted volume for a second therefore make sure
+ * buffers are flushed before running.
+ * Firmware range: v0.49 only, future (see firmware release notes)
+ * Storage only
+ * @param admin_pin 20 characters
* @return command processing error code
*/
- NK_C_API int NK_set_unencrypted_read_write(const char* user_pin);
+ NK_C_API int NK_set_encrypted_read_write(const char* admin_pin);
/**
* Exports device's firmware to unencrypted volume.