package backend;

public class ConstantValues {
	/*
	 * Certificate for the terminals should not have an expdate
	 * Certificate WITOUT expdate is a byte array that looks like:
	 * cert[0] = type (0 = smartcard, 1 = rentalterm, 2 = vehicleterm)
	 * cert[1..163] = rsapublickey (length 162bytes)
	 * cert[164...292] = Signature (128bytes)
	 */
	
	/* TODO: Change exp to short
	 * Certificate with expdate is a byte array that looks like:
	 * cert[0] = type (0 = smartcard, 1 = rentalterm, 2 = vehicleterm)
	 * cert[1..163] = rsapublickey (length 162bytes)
	 * cert[164..172] = expiration date of type long (8bytes)
	 * cert[173...301] = Signature (128bytes)
	 */
	public int RSAPUBLICKEYLENGTH = 162;
	public int EXP_LENGTH = 8;
	public int PK_EXP_LENGTH = 170; //162+8
	public int SIG_LENGTH = 128;
	


}

@@ -45,659 +45,318 @@
 s %7B%0A
-%09/*%0A%09 * Certificate for the terminals should not have an expdate%0A%09 * Certificate WITOUT expdate is a byte array that looks like:%0A%09 * cert%5B0%5D = type (0 = smartcard, 1 = rentalterm, 2 = vehicleterm)%0A%09 * cert%5B1..163%5D = rsapublickey (length 162bytes)%0A%09 * cert%5B164...292%5D = Signature (128bytes)%0A%09 */%0A%09%0A%09/* TODO: Change exp to short%0A%09 * Certificate with expdate is a byte array that looks like:%0A%09 * cert%5B0%5D = type (0 = smartcard, 1 = rentalterm, 2 = vehicleterm)%0A%09 * cert%5B1..163%5D = rsapublickey (length 162bytes)%0A%09 * cert%5B164..172%5D = expiration date of type long (8bytes)%0A%09 * cert%5B173...301%5D = Signature (128bytes)%0A%09 */%0A%09public int RSAPUBLICKEYLENGTH = 162;
+%0A%09public int RSAPUBLICKEYLENGTH = 162;%0A%09public int PUBMODULUS = 128; // after you strip off the first byte (which = 0)%0A%09public int PUBEXPONENT = 3;%0A%09public int PRIVMODULUS = 128; // after you strip off the first byte (which = 0)%0A%09public int PRIVEXPONENT = 128; // after you strip off the first byte (which = 0)
 %0A%09pu

Add modulus and exponent sizes