// PKIErrorMsg.js

// newFunction
function getErrorMsg(errCode) {
	var intErrCode = parseInt(errCode);
	var strErrorMsg = "";
	switch(intErrCode)
	{
		case 1:
		  strErrorMsg = "Transaction fail."
		  break;
		case 5:
		   strErrorMsg = "Transaction authenticaion required."
		  break;
		case 10:
		   strErrorMsg = "Identity (P12) is not found.."
		  break;
	 	case 11:
	   	   strErrorMsg = "Certificert not found."
	  	  break;
	  	case 12:
	   	   strErrorMsg = "User not found."
	  	  break;
	  	case 13:
	   	   strErrorMsg = "Token not found."
	  	  break;
	  	case 14:
	   	   strErrorMsg = "Pin number incorrect."
	  	  break;
	  	case 15:
	   	   strErrorMsg = "Pin locked."
	  	  break;
	  	case 16:
	   	   strErrorMsg = "Issuer cert not found."
	  	  break;
		case 20:
	   	   strErrorMsg = "Authentication fail."
	  	  break;
		case 21:
	   	   strErrorMsg = "Verification fail."
	  	  break;
		case 22:
	   	   strErrorMsg = "Not encrypted for user."
	  	  break;
		case 30:
	   	   strErrorMsg = "Required web services not available/time out."
	  	  break;
	  	case 31:
	   	   strErrorMsg = "Insufficient request information to complete the operation."
	  	  break;
	  	case 32:
	   	   strErrorMsg = "Insufficient S3 Pre-reqsite configurtion."
	  	  break;
	  	case 40:
	   	   strErrorMsg = "Certificert expired."
	  	  break;
	  	case 41:
	   	   strErrorMsg = "Certificert revoked."
	  	  break;
	  	case 42:
	   	   strErrorMsg = "Certificert invalid CA signature."
	  	  break;
	  	case 43:
	   	   strErrorMsg = "Certificert not yet valid."
	  	  break;
	    case 50:
	   	   strErrorMsg = "Data format error."
	  	  break;
	    case 60:
	   	   strErrorMsg = "File not found."
	  	  break;
	    case 61:
	   	   strErrorMsg = "Signature invalid."
	  	  break;
	     case 62:
	   	   strErrorMsg = "Exceeded maximum file limit."
	  	  break;
		default:
		  strErrorMsg = "Error code "+errCode+" found."
	}
	
	return strErrorMsg;
}
