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

📄 hardtokenprofilewithpinenvelope.java

📁 一套JAVA的CA证书签发系统.
💻 JAVA
字号:
/************************************************************************* *                                                                       * *  EJBCA: The OpenSource Certificate Authority                          * *                                                                       * *  This software is free software; you can redistribute it and/or       * *  modify it under the terms of the GNU Lesser General Public           * *  License as published by the Free Software Foundation; either         * *  version 2.1 of the License, or any later version.                    * *                                                                       * *  See terms of license at gnu.org.                                     * *                                                                       * *************************************************************************/ package se.anatom.ejbca.hardtoken.hardtokenprofiles;import java.awt.print.Printable;import java.awt.print.PrinterException;import java.io.IOException;import java.io.StringReader;import se.anatom.ejbca.ra.UserAdminData;/** * HardTokenProfileWithPINEnvelope is a basic class that should be inherited by all types * of hardtokenprofiles that should have PIN envelope functionality. *  * @version $Id: HardTokenProfileWithPINEnvelope.java,v 1.3 2004/04/16 07:39:00 anatom Exp $ */public abstract class HardTokenProfileWithPINEnvelope extends HardTokenProfile implements IPINEnvelopeSettings{				// Protected Constants	protected static final String PINENVELOPETYPE                = "pinenvelopetype";	protected static final String PINENVELOPEFILENAME            = "pinenvelopefilename";	protected static final String PINENVELOPEDATA                = "pinenvelopetdata";	protected static final String PINENVELOPECOPIES              = "pinenvelopetcopies";	protected static final String VISUALVALIDITY                 = "visualvalidity";	private SVGImageManipulator envelopesvgimagemanipulator = null;			    // Default Values    public HardTokenProfileWithPINEnvelope() {      super();            setPINEnvelopeType(IPINEnvelopeSettings.PINENVELOPETYPE_GENERALENVELOBE);      setPINEnvelopeTemplateFilename("");	  setNumberOfPINEnvelopeCopies(1);      setVisualValidity(356);                      }    // Public Methods mostly used by PrimeCard            public void upgrade(){      // Perform upgrade functionality       super.upgrade();     }    	/** 	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#getPINEnvelopeType()	 */	public int getPINEnvelopeType() {		return ((Integer) data.get(PINENVELOPETYPE)).intValue();	}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#setPINEnvelopeType(int)	 */	public void setPINEnvelopeType(int type) {	  data.put(PINENVELOPETYPE, new Integer(type));			}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#getPINEnvelopeTemplateFilename()	 */	public String getPINEnvelopeTemplateFilename() {				return (String) data.get(PINENVELOPEFILENAME);	}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#setPINEnvelopeTemplateFilename(java.lang.String)	 */	public void setPINEnvelopeTemplateFilename(String filename) {	  data.put(PINENVELOPEFILENAME, filename);			}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#getPINEnvelopeData()	 */	public String getPINEnvelopeData() {				return (String) data.get(PINENVELOPEDATA);	}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#setPINEnvelopeData(java.lang.String)	 */	public void setPINEnvelopeData(String templatedata) {	  data.put(PINENVELOPEDATA, templatedata);		}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#getNumberOfPINEnvelopeCopies()	 */	public int getNumberOfPINEnvelopeCopies() {				return ((Integer) data.get(PINENVELOPECOPIES)).intValue();	}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#setNumberOfPINEnvelopeCopies(int)	 */	public void setNumberOfPINEnvelopeCopies(int copies) {			  data.put(PINENVELOPECOPIES, new Integer(copies));		}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#getVisualValidity()	 */	public int getVisualValidity(){	  return ((Integer) data.get(VISUALVALIDITY)).intValue();		}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#setVisualValidity(int)	 */	public void setVisualValidity(int validity){	  data.put(VISUALVALIDITY, new Integer(validity));		}	/**	 * @see se.anatom.ejbca.hardtoken.hardtokenprofiles.IPINEnvelopeSettings#printPINEnvelope(se.anatom.ejbca.ra.UserAdminData, java.lang.String[], java.lang.String[], java.lang.String, java.lang.String)	 */	public Printable printPINEnvelope(UserAdminData userdata, String[] pincodes, String[] pukcodes, String hardtokensn, String copyoftokensn) throws IOException, PrinterException{		Printable returnval = null;	  		if(getPINEnvelopeData() != null){			if(envelopesvgimagemanipulator == null)			  envelopesvgimagemanipulator = new SVGImageManipulator(new StringReader(getPINEnvelopeData()),														  getVisualValidity(),														  getHardTokenSNPrefix()); 																  returnval = envelopesvgimagemanipulator.print(userdata, pincodes, pukcodes, hardtokensn, copyoftokensn); 																}	  	  		return returnval;		}    }

⌨️ 快捷键说明

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