aboutsummaryrefslogtreecommitdiff
path: root/NK_C_API.cc
diff options
context:
space:
mode:
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r--NK_C_API.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index 440e824..5571f0d 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -173,4 +173,29 @@ extern int NK_totp_get_time(){
return 0;
}
+extern int NK_change_admin_PIN(char *current_PIN, char *new_PIN){
+ auto m = NitrokeyManager::instance();
+ try {
+ m->change_admin_PIN(current_PIN, new_PIN);
+ }
+ catch (CommandFailedException & commandFailedException){
+ NK_last_command_status = commandFailedException.last_command_status;
+ return commandFailedException.last_command_status;
+ }
+ return 0;
+}
+
+extern int NK_change_user_PIN(char *current_PIN, char *new_PIN){
+ auto m = NitrokeyManager::instance();
+ try {
+ m->change_user_PIN(current_PIN, new_PIN);
+ }
+ catch (CommandFailedException & commandFailedException){
+ NK_last_command_status = commandFailedException.last_command_status;
+ return commandFailedException.last_command_status;
+ }
+ return 0;
+}
+
+
} \ No newline at end of file