View Javadoc

1   /**
2    * LICENCIA LGPL:
3    * 
4    * Esta librería es Software Libre; Usted puede redistribuirla y/o modificarla
5    * bajo los términos de la GNU Lesser General Public License (LGPL) tal y como 
6    * ha sido publicada por la Free Software Foundation; o bien la versión 2.1 de 
7    * la Licencia, o (a su elección) cualquier versión posterior.
8    * 
9    * Esta librería se distribuye con la esperanza de que sea útil, pero SIN 
10   * NINGUNA GARANTÍA; tampoco las implícitas garantías de MERCANTILIDAD o 
11   * ADECUACIÓN A UN PROPÓSITO PARTICULAR. Consulte la GNU Lesser General Public 
12   * License (LGPL) para más detalles
13   * 
14   * Usted debe recibir una copia de la GNU Lesser General Public License (LGPL) 
15   * junto con esta librería; si no es así, escriba a la Free Software Foundation 
16   * Inc. 51 Franklin Street, 5º Piso, Boston, MA 02110-1301, USA o consulte
17   * <http://www.gnu.org/licenses/>.
18   *
19   * Copyright 2011 Agencia de Tecnología y Certificación Electrónica
20   */
21  package es.accv.arangi.device.model;
22  
23  import java.util.HashSet;
24  import java.util.Set;
25  
26  import org.apache.log4j.Logger;
27  
28  import es.accv.arangi.base.device.model.Pkcs11Manufacturer;
29  import es.accv.arangi.base.exception.device.IAIKDLLNotFoundException;
30  import es.accv.arangi.base.exception.device.NoSuitableDriversException;
31  
32  /**
33   * Clase para tratar las particularidades del fabricante de tarjetas Touch&Sign.
34   * 
35   * @author <a href="mailto:jgutierrez@accv.es">José M Gutiérrez</a>
36   */
37  public class Pkcs11TYSManufacturer extends Pkcs11Manufacturer {
38  
39  	/**
40  	 * Logger de la clase
41  	 */
42  	Logger logger = Logger.getLogger(Pkcs11TYSManufacturer.class);
43  	
44  	/**
45  	 * Constante con el nombre del fabricante
46  	 */
47  	public static final String MANUFACTURER_NAME = "Touch&Sign";
48  	
49  	/**
50  	 * Constante con el nombre del módulo para tratar tarjetas
51  	 */
52  	public static final String MODULE_NAME = "bit4ipki.dll";
53  	
54  	/**
55  	 * Constructor
56  	 * 
57  	 * @throws IAIKDLLNotFoundException No se encuentra la DLL de IAIK
58  	 * @throws NoSuitableDriversException El manufacturer no dispone de drivers para
59  	 * 	funcionar en el entorno (Java 32 o 64 bits)
60  	 */
61  	public Pkcs11TYSManufacturer() throws IAIKDLLNotFoundException, NoSuitableDriversException {
62  		super(MANUFACTURER_NAME, MODULE_NAME);
63  	}
64  
65  	//-- Implementación del métodos abstractos
66  	
67  	@Override
68  	protected String[] getX86LibrariesNames() {
69  		return new String[] {
70  				"bit4upki-store.dll",
71  				"bit4extplg.dll",
72  				"bit4ipki.dll",
73  				"bit4ucsp1.dll",
74  				"bit4ucsp2.dll"
75  		};
76  	}
77  	
78  	@Override
79  	protected String[] getX64LibrariesNames() {
80  		return new String[] {
81  				"bit4ipki.dll"
82  		};
83  	}
84  	
85  	@Override
86  	protected String[] getX86ResourcesNames() {
87  		return new String[] {
88  				"bit4ipki.dll.conf"
89  		};
90  	}
91  	
92  	@Override
93  	protected String[] getX64ResourcesNames() {
94  		return new String[] {
95  				"bit4ipki.dll.conf"
96  		};
97  	}
98  	
99  	@Override
100 	protected Set getTreatableManufacturerIds() {
101 		
102 		Set<String> treatableManufacturersId = new HashSet<String>();
103 		treatableManufacturersId.add("ST Incard");
104 		treatableManufacturersId.add("Bit4id");
105 		return treatableManufacturersId;
106 	}
107 
108 	@Override
109 	public int getPinLength() {
110 		return 8;
111 	}
112 
113 	@Override
114 	public int getPukLength() {
115 		return 8;
116 	}
117 
118 	@Override
119 	protected boolean runInX64() {
120 		return true;
121 	}
122 
123 	@Override
124 	protected boolean runInX86() {
125 		return true;
126 	}
127 
128 	//-- Métodos privados
129 	
130 
131 }