aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-12-20 20:00:44 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:38 +0100
commitc93fdb6625ee952e5cf17e4caaeddf2975276f90 (patch)
tree00d682c674c74c0678b252030b49e3f8d24c97a9 /NitrokeyManager.cc
parentc0ee79f93a97b511661f99d45606e2c433d15344 (diff)
downloadlibnitrokey-c93fdb6625ee952e5cf17e4caaeddf2975276f90.tar.gz
libnitrokey-c93fdb6625ee952e5cf17e4caaeddf2975276f90.tar.bz2
Implement command for testing smartcard status
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index d4a13d1..fff5d64 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -752,6 +752,16 @@ using nitrokey::misc::strcpyT;
return device->get_device_model();
}
+ bool NitrokeyManager::is_smartcard_in_use(){
+ try{
+ stick20::CheckSmartcardUsage::CommandTransaction::run(device);
+ }
+ catch(const CommandFailedException & e){
+ return e.reason_smartcard_busy();
+ }
+ return false;
+ }
+
int NitrokeyManager::get_minor_firmware_version(){
switch(device->get_device_model()){
case DeviceModel::PRO:{