⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edithardtokenprofilejsphelper.java

📁 一个免费的CA,基于EJB平台的,老师叫我们测试,现把之共享出来让大家参考
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
					   enhprof.setCertWritable(EnhancedEIDProfile.CERTUSAGE_ENC, value.equals(CHECKBOX_VALUE));				   }else{					   enhprof.setCertWritable(EnhancedEIDProfile.CERTUSAGE_SIGN, false);					   enhprof.setCertWritable(EnhancedEIDProfile.CERTUSAGE_AUTH, false);					   enhprof.setCertWritable(EnhancedEIDProfile.CERTUSAGE_ENC, false);				   }				   				   value = request.getParameter(SELECT_CERTIFICATEPROFILE + "0");				   if(value!= null)					 enhprof.setCertificateProfileId(EnhancedEIDProfile.CERTUSAGE_SIGN, Integer.parseInt(value));				   				   value = request.getParameter(SELECT_CA + "0");				   if(value!= null)					 enhprof.setCAId(EnhancedEIDProfile.CERTUSAGE_SIGN, Integer.parseInt(value));				   value = request.getParameter(SELECT_PINTYPE + "0");				   if(value!= null)					 enhprof.setPINType(EnhancedEIDProfile.CERTUSAGE_SIGN, Integer.parseInt(value));				   value = request.getParameter(SELECT_MINPINLENGTH + "0");				   if(value!= null)				   	 enhprof.setMinimumPINLength(EnhancedEIDProfile.CERTUSAGE_SIGN, Integer.parseInt(value));                   enhprof.setIsKeyRecoverable(EnhancedEIDProfile.CERTUSAGE_SIGN, false);                     				   value = request.getParameter(SELECT_CERTIFICATEPROFILE + "1");				   if(value!= null)					 enhprof.setCertificateProfileId(EnhancedEIDProfile.CERTUSAGE_AUTH, Integer.parseInt(value));				   				   value = request.getParameter(SELECT_CA + "1");				   if(value!= null)					 enhprof.setCAId(EnhancedEIDProfile.CERTUSAGE_AUTH, Integer.parseInt(value));				   value = request.getParameter(SELECT_PINTYPE + "1");				   if(value!= null)					 enhprof.setPINType(EnhancedEIDProfile.CERTUSAGE_AUTH, Integer.parseInt(value));				   value = request.getParameter(SELECT_MINPINLENGTH + "1");				   if(value!= null)				   	 enhprof.setMinimumPINLength(EnhancedEIDProfile.CERTUSAGE_AUTH, Integer.parseInt(value));				   enhprof.setIsKeyRecoverable(EnhancedEIDProfile.CERTUSAGE_AUTH, false);				   value = request.getParameter(SELECT_CERTIFICATEPROFILE + "2");				   if(value!= null)					 enhprof.setCertificateProfileId(EnhancedEIDProfile.CERTUSAGE_ENC, Integer.parseInt(value));				   				   value = request.getParameter(SELECT_CA + "2");				   if(value!= null)					 enhprof.setCAId(EnhancedEIDProfile.CERTUSAGE_ENC, Integer.parseInt(value));				   value = request.getParameter(SELECT_PINTYPE + "2");				   if(value!= null)					 enhprof.setPINType(EnhancedEIDProfile.CERTUSAGE_ENC, Integer.parseInt(value));							   value = request.getParameter(SELECT_MINPINLENGTH + "2");				   if(value!= null)				   	 enhprof.setMinimumPINLength(EnhancedEIDProfile.CERTUSAGE_ENC, Integer.parseInt(value));				   				   value = request.getParameter(CHECKBOX_KEYRECOVERABLE + "2");					if(value != null)                              					enhprof.setIsKeyRecoverable(EnhancedEIDProfile.CERTUSAGE_ENC, value.equals(CHECKBOX_VALUE));					else					  enhprof.setIsKeyRecoverable(EnhancedEIDProfile.CERTUSAGE_ENC, false);					value = request.getParameter(CHECKBOX_REUSEOLDCERT + "2");					if(value != null)                              						enhprof.setReuseOldCertificate(EnhancedEIDProfile.CERTUSAGE_ENC, value.equals(CHECKBOX_VALUE));					else						enhprof.setReuseOldCertificate(EnhancedEIDProfile.CERTUSAGE_ENC, false);				   													 }             				 				 				 if(request.getParameter(BUTTON_SAVE) != null){				   if(!handler.changeHardTokenProfile(profile,profiledata)){					   profilemalformed = true;									   }				   includefile=PAGE_HARDTOKENPROFILES;				 }				 				 if(request.getParameter(BUTTON_UPLOADENVELOPETEMP) != null){				   uploadmode = UPLOADMODE_ENVELOPE;				   includefile=PAGE_UPLOADTEMPLATE;				 }				 if(request.getParameter(BUTTON_UPLOADVISUALTEMP) != null){				   uploadmode =	UPLOADMODE_VISUAL;				   includefile=PAGE_UPLOADTEMPLATE;				 }						 if(request.getParameter(BUTTON_UPLOADRECEIPTTEMP) != null){				    uploadmode = UPLOADMODE_RECEIPT;					includefile=PAGE_UPLOADTEMPLATE;				 }				 if(request.getParameter(BUTTON_UPLOADADRESSLABELTEMP) != null){					uploadmode = UPLOADMODE_ADRESSLABEL;					includefile=PAGE_UPLOADTEMPLATE;				}						 				 			   }			   if(request.getParameter(BUTTON_CANCEL) != null){				  // Don't save changes.				 includefile=PAGE_HARDTOKENPROFILES;			   }			 }		  }		}				if( action.equals(ACTION_CHANGE_PROFILETYPE)){		  this.profilename = request.getParameter(HIDDEN_HARDTOKENPROFILENAME);		  String value = request.getParameter(SELECT_HARDTOKENTYPE);		  if(value!=null){        			int profiletype = Integer.parseInt(value);			switch(profiletype){          			  case SwedishEIDProfile.TYPE_SWEDISHEID :				profiledata = new SwedishEIDProfile();				break;			  case EnhancedEIDProfile.TYPE_ENHANCEDEID:				profiledata =  new EnhancedEIDProfile();				      				break;  				  case TurkishEIDProfile.TYPE_TURKISHEID:				profiledata =  new TurkishEIDProfile();				      				break; 			}   		  }		  includefile=PAGE_HARDTOKENPROFILE;		}		if( action.equals(ACTION_UPLOADENVELOPETEMP)){          if(buttonupload){          	if(profiledata instanceof IPINEnvelopeSettings){          	  try{	                BufferedReader br = new BufferedReader(new InputStreamReader(file,"UTF8"));				String filecontent = "";				String nextline = "";				while(nextline!=null){				  nextline = br.readLine();				  if(nextline != null)				    				    filecontent += nextline + "\n";				}                			    ((IPINEnvelopeSettings) profiledata).setPINEnvelopeData(filecontent);			    ((IPINEnvelopeSettings) profiledata).setPINEnvelopeTemplateFilename(filename);			    fileuploadsuccess = true;			  }catch(IOException ioe){			    fileuploadfailed = true;              	 			  }            	 			}          }		  includefile=PAGE_HARDTOKENPROFILE;		}		if( action.equals(ACTION_UPLOADVISUALTEMP)){			if(profiledata instanceof IVisualLayoutSettings){			  try{			  			    BufferedReader br = new BufferedReader(new InputStreamReader(file,"UTF8"));			    String filecontent = "";			    String nextline = "";			    while(nextline!=null){				  nextline = br.readLine();				  if(nextline != null)				    				    filecontent += nextline + "\n";			    }			    ((IVisualLayoutSettings) profiledata).setVisualLayoutData(filecontent);			    ((IVisualLayoutSettings) profiledata).setVisualLayoutTemplateFilename(filename);			    fileuploadsuccess = true;			  }catch(IOException ioe){				fileuploadfailed = true;              	 			  }			}		  includefile=PAGE_HARDTOKENPROFILE;		}		if( action.equals(ACTION_UPLOADRECEIPTTEMP)){			if(profiledata instanceof IReceiptSettings){			  try{			  			    BufferedReader br = new BufferedReader(new InputStreamReader(file,"UTF8"));			    String filecontent = "";			    String nextline = "";			    while(nextline!=null){				  nextline = br.readLine();				  if(nextline != null)				    				    filecontent += nextline + "\n";			    }			    ((IReceiptSettings) profiledata).setReceiptData(filecontent);			    ((IReceiptSettings) profiledata).setReceiptTemplateFilename(filename);			    fileuploadsuccess = true;			  }catch(IOException ioe){				fileuploadfailed = true;              	 			  }			}		  includefile=PAGE_HARDTOKENPROFILE;		}		if( action.equals(ACTION_UPLOADADRESSLABELTEMP)){			if(profiledata instanceof IAdressLabelSettings){			  try{			  			    BufferedReader br = new BufferedReader(new InputStreamReader(file,"UTF8"));			    String filecontent = "";			    String nextline = "";			    while(nextline!=null){				  nextline = br.readLine();				  if(nextline != null)				    				    filecontent += nextline + "\n";			    }			    ((IAdressLabelSettings) profiledata).setAdressLabelData(filecontent);			    ((IAdressLabelSettings) profiledata).setAdressLabelTemplateFilename(filename);			    fileuploadsuccess = true;			  }catch(IOException ioe){				fileuploadfailed = true;              	 			  }			}		  includefile=PAGE_HARDTOKENPROFILE;		}									  }      	          return includefile;	    }        public int getProfileType(){    	      int retval = SwedishEIDProfile.TYPE_SWEDISHEID;            if(profiledata instanceof SwedishEIDProfile)        retval = SwedishEIDProfile.TYPE_SWEDISHEID;	      	  if(profiledata instanceof EnhancedEIDProfile)      	retval = EnhancedEIDProfile.TYPE_ENHANCEDEID;		  	  if(profiledata instanceof TurkishEIDProfile)	      	retval = TurkishEIDProfile.TYPE_TURKISHEID;	      		  return retval;    	    }        // Private fields.    private HardTokenInterfaceBean hardtokenbean;    private boolean initialized=false;	public boolean  hardtokenprofileexists       = false;	public boolean  profilemalformed       = false;	public boolean  hardtokenprofiledeletefailed = false;    public boolean  issuperadministrator = false;    public boolean  fileuploadsuccess = false;	public boolean  fileuploadfailed  = false;    public HardTokenProfile profiledata = null;	public String profilename = null;	public int uploadmode = 0;	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -