Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request with some new features and improvements #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<module>uji-format-facturae</module>
<module>uji-keystore</module>
<module>uji-ui-applet</module>
<module>uji-dist</module>
</modules>

<licenses>
Expand Down Expand Up @@ -110,17 +111,4 @@
</plugins>
</build>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<uji.keytool.keystore>../uji.keystore</uji.keytool.keystore>
<uji.keytool.alias>uji</uji.keytool.alias>
<uji.keytool.password>cryptoapplet</uji.keytool.password>
</properties>
</profile>
</profiles>
</project>
Binary file removed tools/samples/MicrosoftCryptoApi_0_3.dll
Binary file not shown.
44 changes: 0 additions & 44 deletions uji-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,50 +30,6 @@
<target>1.6</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<goals>
<goal>sign</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<keystore>${uji.keytool.keystore}</keystore>
<alias>${uji.keytool.alias}</alias>
<storepass>${uji.keytool.password}</storepass>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<index>true</index>
<manifestEntries>
<Implementation-Title>${project.groupId}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
<Specification-Vendor>Universitat Jaume I</Specification-Vendor>
<Application-Name>CryptoApplet</Application-Name>
<Caller-Allowable-Codebase>*</Caller-Allowable-Codebase>
<Implementation-Vendor>Universitat Jaume I</Implementation-Vendor>
<Application-Library-Allowable-Codebase>*</Application-Library-Allowable-Codebase>
<Permissions>all-permissions</Permissions>
<Specification-Title>${project.name}</Specification-Title>
<Specification-Version>${project.version}</Specification-Version>
<Codebase>*</Codebase>
<Trusted-Library>true</Trusted-Library>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.security.KeyStore;
import java.security.KeyStoreException;
Expand Down Expand Up @@ -200,8 +201,10 @@ else if (OS.isWindowsUpperEqualToNT())
{
try
{
Provider provider = new sun.security.pkcs11.SunPKCS11(
new ByteArrayInputStream(newDevice.toString().getBytes()));
// loading 'sun.security.pkcs11.SunPKCS11' reflectively as it is not available (as of June 2015) in the still current, Oracle's 64-bit JRE 1.7.0_79 on Windows, see http://docs.oracle.com/javase/7/docs/technotes/guides/security/p11guide.html#Requirements
Class<?> sunPkcs11Class = Class.forName("sun.security.pkcs11.SunPKCS11");
Constructor sunPkcs11ClassConstructor = sunPkcs11Class.getConstructor(InputStream.class);
Provider provider = (Provider) sunPkcs11ClassConstructor.newInstance(new ByteArrayInputStream(newDevice.toString().getBytes()));
Security.addProvider(provider);

KeyStore.getInstance("PKCS11", provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public boolean isDisableNativePasswordDialog()
@Override
public String toString()
{
return ("name = " + name + "\r" + "library = " + library + "\r\nslot = " + slot + "\r\n");
String library = this.library.replace("\\", "/");
if (OS.isJavaUpperEqualTo8()) { // see es.uji.security.keystore.mozilla.Mozilla.getPkcs11ConfigInputStream()
library = "\"" + library + "\"";
}
// including slot id only if explicitly specified, otherwise it will default to the first slot returned by 'C_GetSlotList', see http://docs.oracle.com/javase/8/docs/technotes/guides/security/p11guide.html#Config
return ("name = " + name + "\r" + "library = " + library + "\r\n" + (slot != null ? "slot = " + slot + "\r\n" : ""));
}
}
13 changes: 12 additions & 1 deletion uji-config/src/main/java/es/uji/security/crypto/config/OS.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,18 @@ public static boolean isJavaUpperEqualTo6(){
String version = System.getProperty("java.version");
return (version.indexOf("1.6") > -1 || version.indexOf("1.7") > -1 || version.indexOf("1.8") > -1);
}


public static boolean isJavaUpperEqualTo8() {
String javaSpecVersion = System.getProperty("java.specification.version"); // expected 1.7, 1.8, etc
int numericJavaSpecVersion = Integer.parseInt(javaSpecVersion.replace(".", ""));
return numericJavaSpecVersion >= 18;
}

// TODO check if there is already another way to detect x86_64 platforms in this project
public static boolean is64BitJava() {
return System.getProperty("os.arch").contains("64");
}

/*public static void main(String[] args){
String[] all= OS.getAllSystemLibDirectories();
for (String i: all){
Expand Down
5 changes: 3 additions & 2 deletions uji-config/src/main/resources/i18n.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ DNIE_PASSWORD_TITLE= Contrasenya de Dnie
DNIE_PIN= Dnie PIN

# Information
ABOUT_DESCRIPTION=<html><img src="http://subverting.org/images/uji.jpg"><br><br>Applet desenvolupat per l'Universitat Jaume I<br>dins del projecte de desplegament de l'admnistraci� electr�nica<br>&#169;2007 Universitat Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
ABOUT_DESCRIPTION=<html><img src\="http\://static.uji.es/templates/common/latest/img/logo_uji_vertical.png"><br><br>Applet desenvolupat per l'Universitat Jaume I<br>dins del projecte de desplegament de l'admnistraci� electr�nica<br>&\#169;2007 Universitat Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
HELP_DESCRIPTION=<html><br>Seleccioneu un certificat amb funcionalitat de<br>signatura (digitalSignature).<br><br>Depenent de la font del certificat apareixer�<br>un camp contrasenya demanant la contrasenya<br> de la font. Intoru�u el PIN en cas necesari i<br> premeu el bot� de signar.<br><br><html>

INFORMATION=Informaci�
Expand Down Expand Up @@ -63,7 +63,7 @@ ERROR_CANNOT_GET_INPUT_DATA=<html><font color='red'>No s'han pogut obtindre les
ERROR_CANNOT_SET_OUTPUT_DATA=<html><font color='red'>No s'ha pogut enviar la signatura al servidor.
ERROR_SSL= <html><font color='red'>Error de conexi� segura

ERR_CAPI_DLL_INSTALL=No s'ha pogut descarregar MicrosoftCryptoApi_0_3.dll
ERR_CAPI_DLL_INSTALL=No s'ha pogut descarregar MicrosoftCryptoApi DLL
ERR_FILE_INSTALL=No s'ha pogut descarregar el fitxer a instalar.
ERROR_INVALID_DLL= S'ha detectat en el sistema l'instal�laci� d'una biblioteca modificada
ERROR_CERTIFICATE_EXPIRED= El seu certificat ha expirat o encara no �s v�lid
Expand Down Expand Up @@ -128,3 +128,4 @@ ERROR_DDOC_CERTEXPIRED=El certificat amb el qual intenta signar ha expirat
ERROR_DDOC_CACERTREAD=No es pot comprovar la validesa del seu certificat.
ERROR_DDOC_CERTGENERIC=No es pot comprovar la validesa del seu certificat.
ERROR_DDOC_CERT_NOT_ALLOWED=<html><font color='red'>No es permet signar amb el teu certificat en aquest lloc, contacta amb l'administrador per a m�s informaci�.</font></html>
ERROR_PKCS11_UNSUPPORTED_IN_JAVA_7_64_BIT_ON_WIN=Aquesta funcionalitat per a Java de 64 bits en Windows nom�s es suporta en Java 8 i superior.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# FIXME "CA" country code here is not referring to Canada, as expected for ISO 3166 alpha-2 compliance
#Traducci�n de es a ca (google-api-translate-java-0.94.jar)
#Tue Jan 18 10:29:30 CET 2011
ERROR_RAW_SIGNATURE=No s'ha pogut calcular la signatura
Expand Down Expand Up @@ -39,13 +40,13 @@ ERROR_INCORRECT_PWD=<html> <font color\='red'>Contrasenya incorrecta, torna a in
ERROR_INVALID_DLL=S'ha detectat en el sistema la instal.laci\u00F3 d'una biblioteca modificada.
ERROR_DDOC_TSDIGEST=No s'ha pogut calcular el resum de la marca de temps.
ERROR_DDOC_TSARESPONSE=S'ha obtingut una marca de temps inv\u00E0lida.
ABOUT_DESCRIPTION=<html><img src\=&quot;http\://subverting.org/images/uji.jpg&quot;><br><br> Applet desenvolupat per la Universitat Jaume I <br> dins del projecte de desplegament de la Admnistraci&oacute; electr&ograve;nica <br> &copy; 2007 Universitat Jaume I <br><br> This program is Licensed under GPLv2 terms <br> For technical contactar send an email to paul.applet @ nisu.org <br></center></html>
ABOUT_DESCRIPTION=<html><img src\="http\://static.uji.es/templates/common/latest/img/logo_uji_vertical.png"><br><br> Applet desenvolupat per la Universitat Jaume I <br> dins del projecte de desplegament de la Admnistraci&oacute; electr&ograve;nica <br> &copy; 2007 Universitat Jaume I <br><br> This program is Licensed under GPLv2 terms <br> For technical contactar send an email to paul.applet @ nisu.org <br></center></html>
ERROR_STORE_EMPTY=No hi ha cap certificat al magatzem
HELP_DESCRIPTION=<html><br> Seleccioneu un certificat amb funcionalitat de<br> signatura (digitalSignature). <br><br> Depenent de la font del certificat apareixer\u00E0 <br> un camp contrasenya demanant la contrasenya <br> de la font. Introduir el PIN en cas necessari i <br> pr\u00E9mer el bot\u00F3 de signar. <br><br><html>
PROGRESS_WINDOW_TITLE=Realitzant operaci\u00F3.
ERR_FILE_INSTALL=No s'ha pogut instal.lar el fitxer a descarregar.
ERROR_DDOC_NOKEY=No s'ha pogut recuperar la refer\u00E8ncia a la clau privada.
ERR_CAPI_DLL_INSTALL=No s'ha pogut descarregar MicrosoftCryptoApi_0_3.dll
ERR_CAPI_DLL_INSTALL=No s'ha pogut descarregar MicrosoftCryptoApi DLL
ERROR_CERTIFICATE_NOT_SELECTED=<html> <font color\='red'>\u00C9s obligatori seleccionar un certificat de la llista</font> </html>
MENU_FILE=Arxiu
LABEL_PIN_CLAUER=PIN per clauer\:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ DNIE_PASSWORD_TITLE= Contrasenya de Dnie
DNIE_PIN= Dnie PIN

# Information
ABOUT_DESCRIPTION=<html><img src="http://subverting.org/images/uji.jpg"><br><br>Applet desenvolupat per l'Universitat Jaume I<br>dins del projecte de desplegament de l'admnistraci� electr�nica<br>&#169;2007 Universitat Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
ABOUT_DESCRIPTION=<html><img src\="http\://static.uji.es/templates/common/latest/img/logo_uji_vertical.png"><br><br>Applet desenvolupat per l'Universitat Jaume I<br>dins del projecte de desplegament de l'admnistraci� electr�nica<br>&\#169;2007 Universitat Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
HELP_DESCRIPTION=<html><br>Seleccioneu un certificat amb funcionalitat de<br>signatura (digitalSignature).<br><br>Depenent de la font del certificat apareixer�<br>un camp contrasenya demanant la contrasenya<br> de la font. Intoru�u el PIN en cas necesari i<br> premeu el bot� de signar.<br><br><html>

INFORMATION=Informaci�
CONTENT=Contingut
CERTIFICATE_CONTENT_FIELD= Al seleccionar el certificat aci apareixer� l'informaci� relacionada.
COMPUTING_SIGNATURE=<html><font color='green'>Calculant la signatura ...</font></html>
INFO_SELECT_CERT=<html><font color='green'>Seleccione el seu certificat i premi sobre el bot� signar</font></html>
INFO_SELECT_CERT=<html><font color\='green'>Seleccione el seu certificat i premi sobre el bot� signar</font></html>
SIGN_PROCESS_OK=Signatura completada corr�ctament
SELECT_A_CERTIFICATE=<html><font color='green'>Seleccione el seu certificat y presione el bot� de signar</font></html>
SELECT_A_CERTIFICATE=<html><font color\='green'>Seleccione el seu certificat y presione el bot� de signar</font></html>
PROGRESS_VIEW_CERTIFICATES=<html>S'estan carregant els seus certificats personals, aquesta operaci� pot trigar uns segons, per favor esperi.</html>
PROGRESS_RELOADING_CERTIFICATES=<html>S'est� actualitzant la llista amb els teus certificats personals, per favor esperi.</html>
PROGRESS_SIGN=<html>S'est� realitzant la signatura electr�nica, aquesta operaci� pot trigar uns segons, per favor, esperi.</html>
Expand All @@ -59,7 +59,7 @@ ERROR_CANNOT_GET_INPUT_DATA=<html><font color='red'>No s'han pogut obtindre les
ERROR_CANNOT_SET_OUTPUT_DATA=<html><font color='red'>No s'ha pogut enviar la signatura al servidor.


ERR_CAPI_DLL_INSTALL=No s'ha pogut descarregar MicrosoftCryptoApi_0_3.dll
ERR_CAPI_DLL_INSTALL=No s'ha pogut descarregar MicrosoftCryptoApi DLL
ERR_FILE_INSTALL=No s'ha pogut descarregar el fitxer a instalar.
ERROR_INVALID_DLL= S'ha detectat en el sistema l'instal�laci� d'una biblioteca modificada
ERROR_OPEN_CERTIFICATE_STORE=No s'ha pogut obrir el magatzem de certificats. Comprova que la clau d'acc�s introdu�da siga corr�cta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ DNIE_PASSWORD_TITLE= Dnie password
DNIE_PIN= Dnie PIN

# Information
ABOUT_DESCRIPTION=<html><img src="http://subverting.org/images/uji.jpg"><br><br>Applet developed by Universitat Jaume I<br>within the Universty's eGovernment project<br>&#169;2007 University Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
ABOUT_DESCRIPTION=<html><img src\="http\://static.uji.es/templates/common/latest/img/logo_uji_vertical.png"><br><br>Applet developed by Universitat Jaume I<br>within the Universty's eGovernment project<br>&\#169;2007 University Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
HELP_DESCRIPTION=<html><br>Select a certificate with signature <br> purpose (digitalSignature).<br><br>Depending of the certificate's source It will appear <br>a password field asking for the source's<br> password . Insert the PIN if necessary and<br> press the sign button.<br><br><html>

INFORMATION=Information
CONTENT=Content
CERTIFICATE_CONTENT_FIELD=On certificate selection the related information will appear.
COMPUTING_SIGNATURE=<html><font color='green'>Computing the signature ...</font></html>
COMPUTING_SIGNATURE=<html><font color\='green'>Computing the signature ...</font></html>
INFO_SELECT_CERT=<html><font color\='green'>Select your certificate and press the sign button</font></html>

SIGN_PROCESS_OK=The signing process is complete
SELECT_A_CERTIFICATE=<html><font color='green'>Choose your certificate and press sign button.</font></html>
SELECT_A_CERTIFICATE=<html><font color\='green'>Choose your certificate and press sign button.</font></html>
PROGRESS_VIEW_CERTIFICATES=<html>Your personal certificates are being loaded. This operation can take a few seconds. Please wait.</html>
PROGRESS_RELOADING_CERTIFICATES=<html>Your certificate list is being updated. Please wait.</html>
PROGRESS_SIGN=<html>Electronic signing is in process. This operation can take a few seconds. Please wait.</html>
Expand All @@ -60,7 +60,7 @@ ERROR_CANNOT_SET_OUTPUT_DATA=<html><font color='red'>Cannot send the signature t
ERROR_SSL= <html><font color='red'>Secure conection error


ERR_CAPI_DLL_INSTALL=MicrosoftCryptoApi_0_3.dll could not be downloaded
ERR_CAPI_DLL_INSTALL=MicrosoftCryptoApi DLL could not be downloaded
ERR_FILE_INSTALL=The file to be installed could not be downloaded.
ERROR_INVALID_DLL= A modified library version han been detected.

Expand Down Expand Up @@ -126,3 +126,4 @@ ERROR_DDOC_CERTEXPIRED=The certificate that you are using to sign has expired.
ERROR_DDOC_CACERTREAD=The validity of your certificate can not be checked.
ERROR_DDOC_CERTGENERIC=The validity of your certificate can not be checked.
ERROR_DDOC_CERT_NOT_ALLOWED=<html><font color='red'>It is not allowed to sign here with your certificate, contact with the administrator for further information.</font></html>
ERROR_PKCS11_UNSUPPORTED_IN_JAVA_7_64_BIT_ON_WIN=This functionality for 64-bit Java on Windows is supported only in Java 8 and above.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DNIE_PASSWORD_TITLE= Contrase\u00F1a de Dnie
DNIE_PIN= Dnie PIN

# Information
ABOUT_DESCRIPTION=<html><img src="http://subverting.org/images/uji.jpg"><br><br>Applet desarrollado por la Universidad Jaume I<br>dentro del proyecto de despliegue de la administraci�n electr�nica<br>&#169;2007 Universitat Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
ABOUT_DESCRIPTION=<html><img src\="http\://static.uji.es/templates/common/latest/img/logo_uji_vertical.png"><br><br>Applet desarrollado por la Universidad Jaume I<br>dentro del proyecto de despliegue de la administraci�n electr�nica<br>&\#169;2007 Universitat Jaume I<br><br>This program is licensed under GPLv2 terms<br>For technical contact send an email to [email protected]<br></center></html>
HELP_DESCRIPTION=<html><br>Seleccione un certificado con funcionalidad de<br>firma (digitalSignature).<br><br>Dependiendo de la fuente del certificado aparecer�<br>un campo contrase�a solicitando la contrase�a<br> de la fuente. Introducir el PIN en caso necesario y<br> pulsar el bot�n de firmar.<br><br><html>
INFORMATION=Informaci�n
INFO_SELECT_CERT=<html><font color='green'>Seleccione su certificado y presione sobre el bot�n firmar</font></html>
Expand All @@ -54,7 +54,7 @@ ERROR_CANNOT_SET_OUTPUT_DATA=<html><font color='red'>No se ha podido enviar la f
ERROR_SSL= <html><font color='red'>Error de conexi�n segura


ERR_CAPI_DLL_INSTALL=No se ha podido descargar MicrosoftCryptoApi_0_3.dll
ERR_CAPI_DLL_INSTALL=No se ha podido descargar MicrosoftCryptoApi DLL
ERR_FILE_INSTALL=No se ha podido instalar el fichero a descargar.
ERROR_INVALID_DLL= Se ha detectado en el sistema la instalaci�n de una biblioteca modificada.

Expand Down Expand Up @@ -120,3 +120,7 @@ ERROR_DDOC_CERTEXPIRED=El certificado con el que se intenta firmar ha expirado.
ERROR_DDOC_CACERTREAD=No se puede comprobar la validez de su certificado.
ERROR_DDOC_CERTGENERIC=No se puede comprobar la validez de su certificado.
ERROR_DDOC_CERT_NOT_ALLOWED=<html><font color='red'>No se permite firmar con tu certificado en este sitio, contacta con el administrador para m�s informaci�n.</font></html>
SELECT_A_CERTIFICATE=<html><font color\='green'>Seleccione su certificado y presione el bot�n firmar.</font></html>
CERTIFICATE_CONTENT_FIELD=Al seleccionar el certificado, aqu� aparecer� la informaci�n relacionada.
COMPUTING_SIGNATURE=<html><font color\='green'>Calculando la firma ...</font></html>
ERROR_PKCS11_UNSUPPORTED_IN_JAVA_7_64_BIT_ON_WIN=Esta funcionalidad para Java de 64 bits en Windows s�lo se soporta en Java 8 y superior.
Loading