activationerrormessage = "AUTHENTICATIONERROR" + ": " + catafe.getMessage();
activationerrormessage = "AUTHENTICATIONERROR"; activationerrorreason = catafe.getMessage();
    public void parseRequest(HttpServletRequest request) throws Exception{    	  generalerrormessage = null;    	  activationerrormessage = null;       	  activationmessage = null;    	  ishardcatoken = false;    	     	  if( request.getParameter(CA_PARAMETER) != null ){    	    caid = Integer.parseInt(request.getParameter(CA_PARAMETER));    	             	        	    if(request.getParameter(BUTTON_ACTIVATE) != null || request.getParameter(BUTTON_MAKEOFFLINE) != null){    	      // Get currentstate    	      status = SecConst.CA_OFFLINE;    	      try{    	      	cainfo = cabean.getCAInfo(caid);    	      	status = cainfo.getCAInfo().getStatus();    	      	if( cainfo.getCAInfo().getCATokenInfo() instanceof HardCATokenInfo ){    	      		ishardcatoken = true;    	      	}    	      } catch(AuthorizationDeniedException e){    	      	generalerrormessage = "NOTAUTHORIZEDTOVIEWCA";    	      	return;    	      }     	          	      // If Activate button is pressed, the admin is authorized and the current status is offline then activate.    	      if(request.getParameter(BUTTON_ACTIVATE) != null &&    	      	 can_activate &&    	      	 ishardcatoken &&				 status == SecConst.CA_OFFLINE){    	             	         String authorizationcode = request.getParameter(PASSWORD_AUTHENTICATIONCODE);    	         if(authorizationcode != null && !authorizationcode.trim().equals("")){    	         	try{    	         	  cabean.getCADataHandler().activateCAToken(caid,authorizationcode);    	         	  activationmessage = "CAACTIVATIONSUCCESSFUL";    	         	}catch(CATokenAuthenticationFailedException catafe){    	         		activationerrormessage = "AUTHENTICATIONERROR" + ": " + catafe.getMessage();    	         	}catch(CATokenOfflineException catoe){    	         		activationerrormessage = "ERROR" + ": " + catoe.getMessage();    	         	}    	         }else{    	         	activationerrormessage = "MUSTENTERAUTHCODE";    	         }    	      }    	      // If Activate button is pressed, the admin is authorized and the current status is offline then activate.    	      if(request.getParameter(BUTTON_MAKEOFFLINE) != null &&    	      	 can_activate &&    	      	 ishardcatoken &&				 status == SecConst.CA_ACTIVE){    	             	      	 try{    	      	   cabean.getCADataHandler().deactivateCAToken(caid);    	      	   activationmessage = "MAKEOFFLINESUCCESSFUL";    	      	 }catch(Exception e){    	      	 	throw e;    	      	 }    	      }   	        	    }    	        	        	        	        	        	      	      	        	    try{    	      cainfo = cabean.getCAInfo(caid);    	      status = cainfo.getCAInfo().getStatus();  	       	  if( cainfo.getCAInfo().getCATokenInfo() instanceof HardCATokenInfo ){	      		ishardcatoken = true;	      	  }    	      ocspcert = cainfo.getOCSPSignerCertificate();    	    } catch(AuthorizationDeniedException e){    	    	generalerrormessage = "NOTAUTHORIZEDTOVIEWCA";    	    }    	    if(cainfo==null){    	      generalerrormessage = "CADOESNTEXIST";	    	    }    	  }else{    	  	generalerrormessage = "YOUMUSTSPECIFYCAID";    	  }      }