aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 20d1a98..ac1074b 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -138,9 +138,22 @@ namespace nitrokey{
}
}
+
string NitrokeyManager::get_serial_number() {
- auto response = GetStatus::CommandTransaction::run(device);
- return response.data().get_card_serial_hex();
+ switch (device->get_device_model()) {
+ case DeviceModel::PRO: {
+ auto response = GetStatus::CommandTransaction::run(device);
+ return nitrokey::misc::toHex(response.data().card_serial_i);
+ }
+ break;
+
+ case DeviceModel::STORAGE:
+ {
+ auto response = stick20::GetDeviceStatus::CommandTransaction::run(device);
+ return nitrokey::misc::toHex(response.data().ActiveSmartCardID_u32);
+ }
+ break;
+ }
}
stick10::GetStatus::ResponsePayload NitrokeyManager::get_status(){