aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-12-12 14:21:19 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:37 +0100
commit0b0898f2b5d88738aa8f49ce6b9ba98db1c775f7 (patch)
tree54559cb5aa6472df184e50d4bd98677dbf451af1 /NitrokeyManager.cc
parent99ac7ee964bf273708441a3012ba89c7729ceadb (diff)
downloadlibnitrokey-0b0898f2b5d88738aa8f49ce6b9ba98db1c775f7.tar.gz
libnitrokey-0b0898f2b5d88738aa8f49ce6b9ba98db1c775f7.tar.bz2
Support execution of the 0.49 commands
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 814c4a6..14e3952 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -789,6 +789,14 @@ using nitrokey::misc::strcpyT;
misc::execute_password_command<stick20::EnableHiddenEncryptedPartition>(device, hidden_volume_password);
}
+ void NitrokeyManager::set_encrypted_volume_read_only(const char* admin_pin) {
+ misc::execute_password_command<stick20::SetEncryptedVolumeReadOnly>(device, admin_pin);
+ }
+
+ void NitrokeyManager::set_encrypted_volume_read_write(const char* admin_pin) {
+ misc::execute_password_command<stick20::SetEncryptedVolumeReadWrite>(device, admin_pin);
+ }
+
//TODO check is encrypted volume unlocked before execution
//if not return library exception
void NitrokeyManager::create_hidden_volume(uint8_t slot_nr, uint8_t start_percent, uint8_t end_percent,
@@ -802,13 +810,25 @@ using nitrokey::misc::strcpyT;
}
void NitrokeyManager::set_unencrypted_read_only(const char* user_pin) {
+ //available until 0.48
misc::execute_password_command<stick20::SendSetReadonlyToUncryptedVolume>(device, user_pin);
}
void NitrokeyManager::set_unencrypted_read_write(const char* user_pin) {
+ //available until 0.48
misc::execute_password_command<stick20::SendSetReadwriteToUncryptedVolume>(device, user_pin);
}
+ void NitrokeyManager::set_unencrypted_read_only_admin_pin(const char* admin_pin) {
+ //available from 0.49
+ misc::execute_password_command<stick20::SetUnencryptedVolumeReadOnlyAdmin>(device, admin_pin);
+ }
+
+ void NitrokeyManager::set_unencrypted_read_write_admin_pin(const char* admin_pin) {
+ //available from 0.49
+ misc::execute_password_command<stick20::SetUnencryptedVolumeReadWriteAdmin>(device, admin_pin);
+ }
+
void NitrokeyManager::export_firmware(const char* admin_pin) {
misc::execute_password_command<stick20::ExportFirmware>(device, admin_pin);
}