// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/types/PinBlockFormatType.java
// public enum PinBlockFormatType {
// 
// 	//ISOFORMAT0(0), ISOFORMAT3(3), IBM3624(4) ;
// 	ISOFORMAT0(0), ISOFORMAT3(3);
//     @SuppressWarnings("unused")
// 	private int value;
// 
//     private PinBlockFormatType (int value) {
//             this.value = value;
//     }	
// }
// 
// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/types/PinValidationType.java
// public enum PinValidationType {
// 	VISA_PVV(0), IBM_3624_OFFSET(1) ;
//     @SuppressWarnings("unused")
// 	private int value;
// 
//     private PinValidationType (int value) {
//             this.value = value;
//     }	
// }
// 
// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/utl/CheckDigit.java
// public class CheckDigit {
// 
// 	public static boolean validate ( String panNUmber){
// 		
// 		LuhnCheckDigit   luhn = new LuhnCheckDigit();
// 		return luhn.isValid ( panNUmber ) ;	
// 		
// 	}
// 	
// 	public static String calculate ( String panNUmber){
// 		
// 		LuhnCheckDigit   luhn = new LuhnCheckDigit();
// 		String checkdigit;
// 		try {
// 			checkdigit = luhn.calculate(  panNUmber );
// 		} catch (CheckDigitException e) {
// 			checkdigit = "CheckDigit.calculate : "+ e.getMessage() ;
// 			System.out.println(checkdigit);
// 		}
// 		return checkdigit ;	
// 		
// 	}	
// 	
// }


import com.indarsoft.cryptocard.types.PinBlockFormatType;
import com.indarsoft.cryptocard.types.PinValidationType;
import com.indarsoft.cryptocard.utl.CheckDigit;

		byte aByte = 0x00;
		if (st.length() != length) {
			return false;
		}
		for (int i = 0; i < st.length(); i++) {
			aByte = (byte) Character.getNumericValue(st.charAt(i));
			if (aByte > 0x09) {
				return false;
			}
		}
		return true;
	}
	
	/**
	 * Validation for ibmoff Pan Number. 
	 * <ul>
	 * <li> Pan number must be between 12 and 19 decimal characters
	 * <li> check digit must be OK (Luhn Algorithm)
	 * <li> In other case an CardException is generated  
	 * </ul>
	 * @param panNumber input string value       
	 * @exception CardException if a exception arrives
	 * @return boolean 
	 */	
	private boolean isvalidPanNumber(String panNumber) throws CardException{

		int panNumberLength = panNumber.length();
		if (panNumberLength < 12 || panNumberLength > 19) throw new CardException("panNumberEx1");
		if (!validateisNumericAndLength(panNumber, panNumberLength)) throw new CardException("panNumberEx1");


// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/types/PinBlockFormatType.java
// public enum PinBlockFormatType {
// 
// 	//ISOFORMAT0(0), ISOFORMAT3(3), IBM3624(4) ;
// 	ISOFORMAT0(0), ISOFORMAT3(3);
//     @SuppressWarnings("unused")
// 	private int value;
// 
//     private PinBlockFormatType (int value) {
//             this.value = value;
//     }	
// }
// 
// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/types/PinValidationType.java
// public enum PinValidationType {
// 	VISA_PVV(0), IBM_3624_OFFSET(1) ;
//     @SuppressWarnings("unused")
// 	private int value;
// 
//     private PinValidationType (int value) {
//             this.value = value;
//     }	
// }
// 
// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/utl/CheckDigit.java
// public class CheckDigit {
// 
// 	public static boolean validate ( String panNUmber){
// 		
// 		LuhnCheckDigit   luhn = new LuhnCheckDigit();
// 		return luhn.isValid ( panNUmber ) ;	
// 		
// 	}
// 	
// 	public static String calculate ( String panNUmber){
// 		
// 		LuhnCheckDigit   luhn = new LuhnCheckDigit();
// 		String checkdigit;
// 		try {
// 			checkdigit = luhn.calculate(  panNUmber );
// 		} catch (CheckDigitException e) {
// 			checkdigit = "CheckDigit.calculate : "+ e.getMessage() ;
// 			System.out.println(checkdigit);
// 		}
// 		return checkdigit ;	
// 		
// 	}	
// 	
// }


// Path: cryptocard/src/main/java/com/indarsoft/cryptocard/card/Card.java
import com.indarsoft.cryptocard.types.PinBlockFormatType;
import com.indarsoft.cryptocard.types.PinValidationType;
import com.indarsoft.cryptocard.utl.CheckDigit;

		byte aByte = 0x00;
		if (st.length() != length) {
			return false;
		}
		for (int i = 0; i < st.length(); i++) {
			aByte = (byte) Character.getNumericValue(st.charAt(i));
			if (aByte > 0x09) {
				return false;
			}
		}
		return true;
	}
	
	/**
	 * Validation for ibmoff Pan Number. 
	 * <ul>
	 * <li> Pan number must be between 12 and 19 decimal characters
	 * <li> check digit must be OK (Luhn Algorithm)
	 * <li> In other case an CardException is generated  
	 * </ul>
	 * @param panNumber input string value       
	 * @exception CardException if a exception arrives
	 * @return boolean 
	 */	
	private boolean isvalidPanNumber(String panNumber) throws CardException{

		int panNumberLength = panNumber.length();
		if (panNumberLength < 12 || panNumberLength > 19) throw new CardException("panNumberEx1");
		if (!validateisNumericAndLength(panNumber, panNumberLength)) throw new CardException("panNumberEx1");


		boolean returnedValue = CheckDigit.validate(panNumber);
