package backend;

import java.math.BigInteger;

public class ConstantValues {

	public int RSAPUBLICKEYLENGTH = 162;
	public int PUBMODULUS = 128; // after you strip off the first byte (which = 0)
	public int PUBEXPONENT = 3;
	public int PRIVMODULUS = 128; // after you strip off the first byte (which = 0)
	public BigInteger PUBEXPONENT_BYTE = new BigInteger("65537".getBytes());
	public int PRIVEXPONENT = 128; // after you strip off the first byte (which = 0)
	public int EXP_LENGTH = 8;
	public int PK_EXP_LENGTH = 170; //162+8
	public int SIG_LENGTH = 128;
	
	public int EXPIRATIONSTARTPOS = 129;
	
	public int CARDCERT_LENGTH = 265;
	public int TERMINALCERT_LENGTH = 257;
	public int CARDDATA_LENGTH = 260;
	


}

@@ -653,48 +653,143 @@
 265;
-%0D%0A%09public int TERMINALCERT_LENGTH = 257;
+ //137 (type, modulo, expiration) +128 (signature)%09%0D%0A%09public int TERMINALCERT_LENGTH = 257; //1 (type) + 128 (modulo) + 128 (signature)
 %0D%0A%09p
@@ -802,16 +802,20 @@
 int CARD
+CERT
 DATA_LEN
@@ -824,12 +824,129 @@
 H = 
-260;
+137; //1 (type) + 128 (modulo) + 8 (expiration)%0D%0A%09public int CARDDATA_LENGTH = 160; //16 (nonce) + 16 (Ktemp) + 128 (SKs)
 %0D%0A%09%0D

add card constant length for mutual authentication