20
3.11
F_LD_KEY
This function loads/updates a triple DES key into a key file.
Compatible with ISO7816 or Gemplus command set
Gemplus
Function call:
void F_LD_KEY( S_LD_KEY* );
Data structure of S_LD_KEY
typedef struct
{
int Class;
int Mode;
unsigned char ShortId;
int KeyNum;
int KeyType;
int KeyVer;
unsigned char KeyValue[16];
int IdOk;
unsigned char Sw12[2];
} S_LD_KEY;
Input parameter :
Class
: 0 = NORMAL
1 = SECURE
Mode
: 0 = direct select
1 = implicit select
ShortId
: short EF identifier, This is needed if Mode=1.
KeyNum
: key number 0,2,4,6 only.
KeyType
: 0 = ADM
1 = pay
2 = Log
; 3 = Authen
16 = sign
KeyVer
:key version for AP
KeyValue[] :holds key data,[0]=K15,[1]=K14,[15]=K0
Output parameter :
This function updates the following parameters.
IdOk : 0 = OK
1 = Timeout
2 = No card
; 3 = EDC error
5 = Parity error
7 = see SW1-SW2
Sw12[] :SW1-SW2