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); }
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); }
public void SetKey(KeySessionType type, GPKey k) { keys.Add(type, k); }
public ISecretKey GetKeyFor(KeySessionType type) { return(keys[type].GetKey()); }
public GPKey GetKey(KeySessionType type) { return(keys[type]); }