Sample3.c
This sample shows how to recover tokens using KMLIB. It restores the tokens from the backup file created by Sample2.c.
The following assumptions are made:
>Unwrap key secret_key_example exists in Slot 1. This is created when Sample1.c is run.
>Backup file backup.bin exists. This is created when Sample2.c is run
>The User pin is set to 9999 for Slot 1
So that it can be confirmed that the tokens have been restored from the backup file, delete public_key_example prior to running Sample 3.c.
Use the following ctkmu utility command to delete the file:
ctkmu d -s1 -n public_key_example
To check that the tokens have been restored, use either the ctbrowse utility or the following ctkmu utility command:
ctkmu l -s1
Documentation for the utilities can be found in the following manuals if required.
ctbrowse: ProtectToolkit-C Administration Guide
ctkmu: ProtectToolkit-C Programming Guide