1 13 14 package org.ejbca.core.model.hardtoken.types; 15 16 import org.ejbca.core.model.SecConst; 17 import org.ejbca.core.model.ra.raadmin.GlobalConfiguration; 18 19 20 26 public class EIDHardToken extends HardToken { 27 public static final String INITIALBASICPIN = "INITIALBASICPIN"; 29 public static final String BASICPUK = "BASICPUK"; 30 public static final String INITIALSIGNATUREPIN = "INITIALSIGNATUREPIN"; 31 public static final String SIGNATUREPUK = "SIGNATUREPUK"; 32 public static final int THIS_TOKENTYPE = SecConst.TOKEN_EID; 33 34 35 public static String [] FIELDS = null; 36 public static int[] DATATYPES = null; 37 public static String [] FIELDTEXTS = null; 38 39 static { 40 if(GlobalConfiguration.HARDTOKEN_DIPLAYSENSITIVEINFO){ 41 FIELDS = new String [] {INITIALBASICPIN, BASICPUK, EMPTYROW_FIELD, INITIALSIGNATUREPIN, SIGNATUREPUK}; 42 DATATYPES = new int[] { STRING, STRING, EMPTYROW, STRING, STRING }; 43 FIELDTEXTS = new String [] { INITIALBASICPIN, BASICPUK, EMPTYROW_FIELD, INITIALSIGNATUREPIN, SIGNATUREPUK}; 44 }else{ 45 FIELDS = new String [] {}; 46 DATATYPES = new int[] {}; 47 FIELDTEXTS = new String [] {}; 48 } 49 } 50 51 53 56 public EIDHardToken() { 57 setInitialBasicPIN(""); 58 setBasicPUK(""); 59 setInitialSignaturePIN(""); 60 setSignaturePUK(""); 61 62 data.put(TOKENTYPE, new Integer (THIS_TOKENTYPE)); 63 } 64 65 public int getNumberOfFields() { 67 return EIDHardToken.FIELDS.length; 68 } 69 70 77 public String getFieldText(int index) { 78 return EIDHardToken.FIELDTEXTS[index]; 79 } 80 81 88 public String getFieldPointer(int index) { 89 return EIDHardToken.FIELDS[index]; 90 } 91 92 99 public int getFieldDataType(int index) { 100 return EIDHardToken.DATATYPES[index]; 101 } 102 103 public String getInitialBasicPIN() { 105 return (String ) data.get(INITIALBASICPIN); 106 } 107 108 113 public void setInitialBasicPIN(String initialbasicpin) { 114 data.put(INITIALBASICPIN, initialbasicpin); 115 } 116 117 122 public String getBasicPUK() { 123 return (String ) data.get(BASICPUK); 124 } 125 126 131 public void setBasicPUK(String basicpuk) { 132 data.put(BASICPUK, basicpuk); 133 } 134 135 140 public String getInitialSignaturePIN() { 141 return (String ) data.get(INITIALSIGNATUREPIN); 142 } 143 144 149 public void setInitialSignaturePIN(String initialsignaturepin) { 150 data.put(INITIALSIGNATUREPIN, initialsignaturepin); 151 } 152 153 158 public String getSignaturePUK() { 159 return (String ) data.get(SIGNATUREPUK); 160 } 161 162 167 public void setSignaturePUK(String signaturepuk) { 168 data.put(SIGNATUREPUK, signaturepuk); 169 } 170 171 } 173 | Popular Tags |