Esempio n. 1
0
 public static byte[] FillEmv(byte[] init_update_response, KeySessionType key)
 {
     byte[] data = new byte[16];
     // 6 rightmost bytes of init update response (which is 10 bytes)
     Array.Copy(init_update_response, 4, data, 0, 6);
     data[6] = (byte)0xF0;
     data[7] = (byte)key;
     Array.Copy(init_update_response, 4, data, 8, 6);
     data[14] = (byte)0x0F;
     data[15] = (byte)key;
     return(data);
 }
Esempio n. 2
0
 public static byte[] FillVisa2(byte[] init_update_response, KeySessionType key)
 {
     byte[] data = new byte[16];
     Array.Copy(init_update_response, 0, data, 0, 4);
     Array.Copy(init_update_response, 8, data, 4, 2);
     data[6] = (byte)0xF0;
     data[7] = 0x01;
     Array.Copy(init_update_response, 0, data, 8, 4);
     Array.Copy(init_update_response, 8, data, 12, 2);
     data[14] = (byte)0x0F;
     data[15] = 0x01;
     return(data);
 }
Esempio n. 3
0
 public void SetKey(KeySessionType type, GPKey k)
 {
     keys.Add(type, k);
 }
Esempio n. 4
0
 public ISecretKey GetKeyFor(KeySessionType type)
 {
     return(keys[type].GetKey());
 }
Esempio n. 5
0
 public GPKey GetKey(KeySessionType type)
 {
     return(keys[type]);
 }