diff --git a/.svn/entries b/.svn/entries
deleted file mode 100644
index e192f99..0000000
--- a/.svn/entries
+++ /dev/null
@@ -1,117 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T03:16:43.485564Z
-4669
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-frontend
-dir
-
-tools
-dir
-
-clients
-dir
-
-appletFirma
-dir
-
-transport.xsd
-file
-
-
-
-
-2022-07-28T03:40:48.334827Z
-4f536f6eb1bf511b9104963f7b7a495c
-2014-07-18T11:55:42.487555Z
-1
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4147
-
-base
-dir
-
-centralwebservices
-dir
-
-pom.xml
-file
-
-
-
-
-2022-07-28T03:40:48.334827Z
-1d49d454883b8d88c61293062edf98e0
-2014-12-31T05:29:42.479725Z
-3704
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-26244
-
-reports-jsf
-dir
-
diff --git a/.svn/text-base/pom.xml.svn-base b/.svn/text-base/pom.xml.svn-base
deleted file mode 100644
index 992e7f0..0000000
--- a/.svn/text-base/pom.xml.svn-base
+++ /dev/null
@@ -1,687 +0,0 @@
-
-
- 4.0.0
- com.fp
- FlipBean
- Maia
- 2.1
- pom
-
- ISO-8859-1
- /app/maia
-
-
- base
- clients
- frontend
-
-
- Mantis
- http://190.57.146.125/mantis
-
-
-
- flipbean
- Flipbean
- flipbean.s.a@gmail.com
-
- Project Manager
- Architect
-
-
-
-
- scm:svn:svn+ssh://maia/repo/fuentes/sources
- http://192.168.2.201/svn/fuentes/sources
-
-
- MAIA
- http://190.57.146.125/tech
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 2.3.2
-
- true
- ${project.build.sourceEncoding}
- 1.7
- 1.7
-
-
-
-
- org.apache.maven.plugins
- maven-ejb-plugin
- 2.3
-
- 3.0
-
-
-
-
- org.apache.maven.plugins
- maven-site-plugin
- 3.0
-
-
-
-
- org.apache.maven.wagon
- wagon-ssh-external
- 2.2
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-project-info-reports-plugin
- 2.4
-
-
-
- cim
- dependencies
- dependency-convergence
- dependency-management
- index
- issue-tracking
- license
- mailing-list
- plugin-management
- project-team
- scm
- summary
-
-
-
-
-
-
- maven-javadoc-plugin
- 2.8
-
- 1.5
- es_EC
- ${cfg.path}/stylesheet.css
- gr.spinellis.umlgraph.doclet.UmlGraphDoc
-
-
- gr.spinellis
- UmlGraph
- 4.4
-
- -inferrel -inferdep -quiet -hide java.*
- -collpackages java.util.* -qualify -postfixpackage
- -nodefontsize 9 -nodefontpackagesize 7 -attributes
- -operations -enumerations -enumconstants -visibility
-
-
-
-
- org.apache.maven.plugins
- maven-pmd-plugin
- 2.5
-
- true
- ISO-8859-1
- 30
- 1.5
-
- ${cfg.path}/Rules.xml
-
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
- 2.8
-
- ${cfg.path}/checkstyle.xml
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
- 2.3.2
-
- low
- Max
- ${cfg.path}/findbugs.xml
-
-
-
- org.apache.maven.plugins
- maven-surefire-report-plugin
- 2.10
-
-
- org.apache.maven.plugins
- maven-jxr-plugin
- 2.3
-
-
-
-
-
- maia
- scpexe://gfiallos@localhost/app/maia/bin
-
-
- maia
- scpexe://root@localhost/srv/www/htdocs/tech
-
-
-
-
- release
-
-
-
- /app/maia/bin
- bpmlib
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.1.2
-
- /app/maia/bin
- ${project.artifactId}-src
- true
-
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
-
-
- true
-
-
-
- jboss
-
- true
-
-
- true
-
-
-
- up
-
- false
-
-
- true
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 2.3.2
-
- /app/maia/bin
-
-
-
-
-
-
-
-
-
-
-
- junit
- junit
- test
-
-
-
-
-
- org.apache.maven.wagon
- wagon-ssh
- 2.2
-
-
- org.apache.ant
- ant-launcher
- 1.7.0
-
-
- org.apache.ant
- ant
- 1.7.0
-
-
-
-
-
- org.hibernate
- hibernate-core
- 4.0.1.Final
- provided
-
-
- org.hibernate
- hibernate-search
- 4.0.0.Final
- provided
-
-
- org.hibernate
- hibernate-entitymanager
- 4.0.1.Final
- provided
-
-
- org.hibernate
- hibernate-validator
- 4.2.0.Final
- provided
-
-
-
- javax.servlet
- servlet-api
- 2.5
-
-
- javax.servlet
- jsp-api
- 2.0
-
-
- org.jboss.spec.javax.ejb
- jboss-ejb-api_3.1_spec
- 1.0.1.Final
- provided
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.2
-
-
- groovy
- groovy-all
- 1.6.4
-
-
- commons-beanutils
- commons-beanutils
- 1.7.0
- provided
-
-
- commons-collections
- commons-collections
- 3.2.1
- provided
-
-
- log4j
- log4j
- 1.2.14
-
-
- net.sf.json-lib
- json-lib
- 2.2.3
- provided
-
-
- xom
- xom
- 1.2.5
- provided
-
-
-
- xalan
- xalan
- 2.7.1
- provided
-
-
- xerces
- xercesImpl
- 2.9.1
- test
-
-
- xerces
- xmlParserAPIs
- 2.6.2
- test
-
-
- xml-apis
- xml-apis
- 1.3.04
- test
-
-
- jdom
- jdom
- 1.1
- test
-
-
- msv
- xsdlib
- 20050913
- test
-
-
- msv
- relaxngDatatype
- 20050913
- test
-
-
- xpp3
- xpp3
- 1.1.3.3
- test
-
-
- stax
- stax-api
- 1.0.1
- test
-
-
- pull-parser
- pull-parser
- 2.1.10
- test
-
-
- net.sourceforge.jtds
- jtds
- 1.2.4
- test
-
-
- com.jaspersoft.ireports
- jaspersoft-ireport
- 4.7.0
-
-
- com.jaspersoft.ireports
- ireport-jasperserver
- 4.7.0
-
-
- net.sf.jasperreports
- jasperreports
- 4.7.0
-
-
- org.codeartisans.thirdparties.swing
- org-openide-util
- 8.6.2
-
-
- com.jaspersoft.jasperserver
- jasperserver-common-ws
- 4.7.0
-
-
- javax.xml
- jaxrpc-api
- 1.1
-
-
- commons-digester
- commons-digester
- 2.1
-
-
- com.lowagie
- itext
- 2.1.7
-
-
- oracle
- JDBC
- 6.0
-
-
- jaxme
- jaxme-api
- 0.3.1
- test
-
-
- jaxen
- jaxen
- 1.1.1
- test
-
-
-
- junit
- junit
- 4.0
-
-
- jline
- jline
- 0.9.94
-
-
-
-
- org.codehaus.btm
- btm
- 2.1.2
- test
-
-
- org.mvel
- mvel2
- 2.1.Beta3
- provided
-
-
- commons-lang
- commons-lang
- 2.6
- jar
- provided
-
-
- commons-logging
- commons-logging
- 1.1.1
- jar
- provided
-
-
- net.sf.ezmorph
- ezmorph
- 1.0.6
- jar
- provided
-
-
- org.apache.velocity
- velocity-tools
- 2.0
- jar
- compile
-
-
- org.apache.velocity
- velocity
- 1.6.4
- jar
- compile
-
-
-
- org.apache.xmlbeans
- xmlbeans
- 2.3.0
- jar
- compile
-
-
- org.antlr
- antlr
- 3.3
- jar
- provide
-
-
- org.antlr
- antlr-runtime
- 3.3
- jar
- provide
-
-
- org.antlr
- stringtemplate
- 3.2.1
- jar
- provide
-
-
- jboss
- jboss-ejb-api
- 4.2.1.GA
-
-
-
- com.fp.base
- facadeclient
- 2.1
-
-
- com.fp.base
- facade
- 2.1
-
-
- commons-fileupload
- commons-fileupload
- 1.2.2
- compile
-
-
- axis
- axis
- 1.4
-
-
- axis
- axis-wsdl4j
- 1.5.1
-
-
- commons-codec
- commons-codec
- 1.4
-
-
- commons-discovery
- commons-discovery
- 0.4
-
-
- commons-httpclient
- commons-httpclient
- 3.1
-
-
- wsdl4j
- wsdl4j
- 1.6.2
-
-
- commons-io
- commons-io
- 1.4
- provided
-
-
- javax.mail
- mail
- 1.4.4
- jar
- compile
-
-
- javax.activation
- activation
- 1.1.1
- jar
- compile
-
-
- jep
- jep
- 2.4.1
- jar
- compile
-
-
- org.jboss.spec
- jboss-javaee-6.0
- 3.0.0.Final
- pom
- import
-
-
-
-
-
diff --git a/.svn/text-base/transport.xsd.svn-base b/.svn/text-base/transport.xsd.svn-base
deleted file mode 100644
index fea28aa..0000000
--- a/.svn/text-base/transport.xsd.svn-base
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
- Cabecera de mensajes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Mensaje de Negocio, Altas y Bajas
-
-
-
-
-
-
-
-
-
-
- Mensaje de negocio
-
-
-
-
-
-
- Multiregistro A, B
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Objeto de negocio
-
-
-
-
-
-
-
-
-
-
- Registros de una tabla
-
-
-
-
-
-
-
-
-
- Campo de un registro
-
-
-
-
- Nombre de un campo suelto
-
-
-
-
- Valor del campo
-
-
-
-
-
diff --git a/appletFirma/.svn/entries b/appletFirma/.svn/entries
deleted file mode 100644
index 6941597..0000000
--- a/appletFirma/.svn/entries
+++ /dev/null
@@ -1,68 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-lib
-dir
-
-src
-dir
-
-pom.xml
-file
-
-
-
-
-2022-07-28T03:40:24.126723Z
-bd2a0d053d394874dc41aafd42d7188b
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1497
-
diff --git a/appletFirma/.svn/prop-base/pom.xml.svn-base b/appletFirma/.svn/prop-base/pom.xml.svn-base
deleted file mode 100644
index 138f983..0000000
--- a/appletFirma/.svn/prop-base/pom.xml.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/.svn/text-base/pom.xml.svn-base b/appletFirma/.svn/text-base/pom.xml.svn-base
deleted file mode 100644
index d16a16a..0000000
--- a/appletFirma/.svn/text-base/pom.xml.svn-base
+++ /dev/null
@@ -1,51 +0,0 @@
-
- 4.0.0
-
- com.fp.firma
- appletFirma
- 2.1
- jar
-
- appletFirma
- http://maven.apache.org
-
-
- UTF-8
-
-
-
-
- junit
- junit
- 4.1
- test
-
-
-
- org.bouncycastle
- bcmail-jdk15on
- 1.51
-
-
- org.bouncycastle
- bcprov-jdk15on
- 1.49
-
-
- org.bouncycastle
- bcprov-ext-jdk15on
- 1.49
-
-
- org.bouncycastle
- bcpkix-jdk15on
- 1.49
-
-
- com.itextpdf
- itextpdf
- 5.5.3
-
-
-
diff --git a/appletFirma/lib/.svn/entries b/appletFirma/lib/.svn/entries
deleted file mode 100644
index 8775b1b..0000000
--- a/appletFirma/lib/.svn/entries
+++ /dev/null
@@ -1,62 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/lib
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-itextpdf-5.5.3.jar
-file
-
-
-
-
-2022-07-28T03:40:23.429719Z
-1f8b7633f9f21668d178566e9e85fe7c
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2237618
-
diff --git a/appletFirma/lib/.svn/prop-base/itextpdf-5.5.3.jar.svn-base b/appletFirma/lib/.svn/prop-base/itextpdf-5.5.3.jar.svn-base
deleted file mode 100644
index dbc918b..0000000
--- a/appletFirma/lib/.svn/prop-base/itextpdf-5.5.3.jar.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 24
-application/octet-stream
-END
diff --git a/appletFirma/lib/.svn/text-base/itextpdf-5.5.3.jar.svn-base b/appletFirma/lib/.svn/text-base/itextpdf-5.5.3.jar.svn-base
deleted file mode 100644
index 0cff7af..0000000
Binary files a/appletFirma/lib/.svn/text-base/itextpdf-5.5.3.jar.svn-base and /dev/null differ
diff --git a/appletFirma/src/.svn/entries b/appletFirma/src/.svn/entries
deleted file mode 100644
index f948539..0000000
--- a/appletFirma/src/.svn/entries
+++ /dev/null
@@ -1,34 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-test
-dir
-
-main
-dir
-
diff --git a/appletFirma/src/main/.svn/entries b/appletFirma/src/main/.svn/entries
deleted file mode 100644
index d553017..0000000
--- a/appletFirma/src/main/.svn/entries
+++ /dev/null
@@ -1,34 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-java
-dir
-
-resources
-dir
-
diff --git a/appletFirma/src/main/java/.svn/entries b/appletFirma/src/main/java/.svn/entries
deleted file mode 100644
index e3c9d30..0000000
--- a/appletFirma/src/main/java/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-com
-dir
-
diff --git a/appletFirma/src/main/java/com/.svn/entries b/appletFirma/src/main/java/com/.svn/entries
deleted file mode 100644
index 5b92ddd..0000000
--- a/appletFirma/src/main/java/com/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-fp
-dir
-
diff --git a/appletFirma/src/main/java/com/fp/.svn/entries b/appletFirma/src/main/java/com/fp/.svn/entries
deleted file mode 100644
index d38b438..0000000
--- a/appletFirma/src/main/java/com/fp/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-firma
-dir
-
diff --git a/appletFirma/src/main/java/com/fp/firma/.svn/entries b/appletFirma/src/main/java/com/fp/firma/.svn/entries
deleted file mode 100644
index 3e93d2b..0000000
--- a/appletFirma/src/main/java/com/fp/firma/.svn/entries
+++ /dev/null
@@ -1,43 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp/firma
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-component
-dir
-
-applet
-dir
-
-keystore
-dir
-
-dto
-dir
-
-common
-dir
-
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/entries b/appletFirma/src/main/java/com/fp/firma/applet/.svn/entries
deleted file mode 100644
index 5baf692..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/entries
+++ /dev/null
@@ -1,96 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp/firma/applet
-svn://172.17.26.185/COMACO
-
-
-
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-FirmaApplet.java
-file
-
-
-
-
-2022-07-28T03:40:23.755721Z
-c6fc0b382335939010b5277beb9a38dd
-2015-04-28T07:21:43.253845Z
-4061
-cpiedra
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-16793
-
-FirmaApplet.form
-file
-
-
-
-
-2022-07-28T03:40:23.755721Z
-575cbea3cc9720565e5a28838bc7a45e
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-7804
-
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/prop-base/FirmaApplet.form.svn-base b/appletFirma/src/main/java/com/fp/firma/applet/.svn/prop-base/FirmaApplet.form.svn-base
deleted file mode 100644
index 869ac71..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/prop-base/FirmaApplet.form.svn-base
+++ /dev/null
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/prop-base/FirmaApplet.java.svn-base b/appletFirma/src/main/java/com/fp/firma/applet/.svn/prop-base/FirmaApplet.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/prop-base/FirmaApplet.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.form.netbeans-base b/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.form.netbeans-base
deleted file mode 100644
index d34e00e..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.form.netbeans-base
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.form.svn-base b/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.form.svn-base
deleted file mode 100644
index d34e00e..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.form.svn-base
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.java.netbeans-base b/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.java.netbeans-base
deleted file mode 100644
index 5b3b412..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.java.netbeans-base
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.fp.firma.applet;
-
-import com.fp.firma.common.CertificateUtils;
-import com.fp.firma.common.FirmMessages;
-import com.itextpdf.text.Rectangle;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.JComponent;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPasswordField;
-
-/**
- * Applet de firma electrónica a través de token
- * @author dcruz
- */
-public class FirmaApplet extends javax.swing.JApplet {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private static final String PREFIX = "firmado_";
- private String rutaArchivoFirmar = "";
- private static final Logger logger = Logger.getLogger(FirmaApplet.class .getName());
-
- private String tipoFirma;
- /**
- * Initializes the applet FirmaApplet
- */
- @Override
- public void init() {
-// FileHandler handler;
-// try {
-// handler = new FileHandler(System.getProperty("java.io.tmpdir")+"\\applet.txt");
-// handler.setFormatter(new SimpleFormatter());
-// logger.addHandler(handler);
-// } catch (IOException ex) {
-// Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
-// } catch (SecurityException ex) {
-// Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
-// }
-
- /* Set the Nimbus look and feel */
- //
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //
-
- /* Create and display the applet */
- try {
- java.awt.EventQueue.invokeAndWait(new Runnable() {
- public void run() {
- initComponents();
- }
- });
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * This method is called from within the init() method to initialize the form. WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // //GEN-BEGIN:initComponents
- private void initComponents() {
-
- grupoRadios = new javax.swing.ButtonGroup();
- jPanel1 = new javax.swing.JPanel();
- labelArchivoFirma = new javax.swing.JLabel();
- txtRutaArchivo = new javax.swing.JTextField();
- btnExaminar = new javax.swing.JButton();
- btnFirmarArchivo = new javax.swing.JButton();
- tokenIkey = new javax.swing.JRadioButton();
- tokenAlladin = new javax.swing.JRadioButton();
- tokenSD = new javax.swing.JRadioButton();
- grupoRadios.add(tokenIkey);
- grupoRadios.add(tokenAlladin);
- grupoRadios.add(tokenSD);
-
- labelArchivoFirma.setText("Archivo a firmar");
-
- txtRutaArchivo.setEditable(false);
- btnFirmarArchivo.setEnabled(true);
- btnExaminar.setEnabled(true);
-
- btnExaminar.setText("Examinar");
- btnExaminar.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnExaminarActionPerformed(evt);
- }
- });
-
- btnFirmarArchivo.setText("Firmar");
- btnFirmarArchivo.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnFirmarArchivoActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(labelArchivoFirma)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addGap(12, 12, 12)
- .addComponent(btnFirmarArchivo))
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(txtRutaArchivo, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(btnExaminar)))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- jPanel1Layout.setVerticalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(labelArchivoFirma)
- .addComponent(txtRutaArchivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(btnExaminar))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(btnFirmarArchivo)
- .addContainerGap())
- );
-
- tokenIkey.setText("iKey 2032");
- tokenIkey.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- tokenIkeyActionPerformed(evt);
- }
- });
-
- tokenAlladin.setText("eTokenPro");
- tokenAlladin.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- tokenAlladinActionPerformed(evt);
- }
- });
-
- tokenSD.setText("Security Data");
- tokenSD.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- tokenSDActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addContainerGap())
- .addGroup(layout.createSequentialGroup()
- .addGap(41, 41, 41)
- .addComponent(tokenIkey)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tokenAlladin)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tokenSD)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addContainerGap(75, Short.MAX_VALUE)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(tokenAlladin)
- .addComponent(tokenSD)
- .addComponent(tokenIkey))
- .addGap(18, 18, 18)
- .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(25, 25, 25))
- );
- }// //GEN-END:initComponents
-
- private void btnExaminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExaminarActionPerformed
- // TODO add your handling code here:
- try
- {
- /**llamamos el metodo que permite cargar la ventana*/
- JFileChooser fileChooser=new JFileChooser();
- String rutaArchivo = txtRutaArchivo.getText();
- File directorio = new File(rutaArchivo).getParentFile();
- fileChooser.setCurrentDirectory(directorio);
-// System.out.println("Directorio del archivo "+fileChooser.getCurrentDirectory() != null ? fileChooser.getCurrentDirectory().getAbsolutePath() : "");
- /**abrimos el archivo seleccionado*/
- int respuestaDialog = fileChooser.showOpenDialog(this);
-
- if(respuestaDialog == JFileChooser.APPROVE_OPTION){
- File fileSelected = fileChooser.getSelectedFile();
- rutaArchivoFirmar = fileSelected.getAbsolutePath();
- System.out.println("Ruta del archivo escogido "+rutaArchivoFirmar);
- txtRutaArchivo.setText(rutaArchivoFirmar);
- } else{
- JOptionPane.showMessageDialog(null,"" +
- "\nAccion cancelada por el usuario",
- "ADVERTENCIA!!!",JOptionPane.WARNING_MESSAGE);
- }
-
-
- /**recorremos el archivo, lo leemos para plasmarlo
- *en el area de texto*/
-
- }catch(Throwable ex)
- {
- JOptionPane.showMessageDialog(null,ex+"" +
- "\nNo se ha encontrado el archivo",
- "ADVERTENCIA!!!",JOptionPane.WARNING_MESSAGE);
- }
- }//GEN-LAST:event_btnExaminarActionPerformed
-
- private void btnFirmarArchivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFirmarArchivoActionPerformed
- // TODO add your handling code here:
- InputStream inputStream = null;
- try{
- String razon = getParameter("razon") != null ? getParameter("razon") : "";
- String lugar = getParameter("lugar") != null ? getParameter("lugar") : "";
- String nombreFirma = getParameter("firma") != null ? getParameter("firma") : "";
- Float llx = Float.valueOf(getParameter("llx") != null ? Float.parseFloat(getParameter("llx")) : 0.0F);
- Float lly = Float.valueOf(getParameter("lly") != null ? Float.parseFloat(getParameter("lly")) : 0.0F);
- Float urx = Float.valueOf(getParameter("urx") != null ? Float.parseFloat(getParameter("urx")) : 0.0F);
- Float ury = Float.valueOf(getParameter("ury") != null ? Float.parseFloat(getParameter("ury")) : 0.0F);
- if(tipoFirma == null){
- JOptionPane.showMessageDialog(null, "Debe seleccionar un Token con el cual firmar", "Tipo Firma", JOptionPane.ERROR_MESSAGE);
- return;
- }
- if(txtRutaArchivo.getText() != null){
- JPasswordField txtPasswordToken = new JPasswordField();
- final JComponent[] components = new JComponent[]{new JLabel("Password:"), txtPasswordToken};
- JOptionPane.showMessageDialog(null, components, "TOKEN", JOptionPane.PLAIN_MESSAGE);
- if(txtPasswordToken.getPassword() == null){
- throw new NullPointerException(FirmMessages.getString("FIR-0007"));
- }
- inputStream = new FileInputStream(txtRutaArchivo.getText());
- byte[] datos = CertificateUtils.sign(inputStream, null, new String(txtPasswordToken.getPassword()), razon, lugar, Boolean.FALSE.booleanValue(), Boolean.FALSE.booleanValue(), new Rectangle(llx.floatValue(), lly.floatValue(), urx.floatValue(), ury.floatValue()), 1, nombreFirma, this.tipoFirma);
- if(datos != null){
- escribirArchivo(datos);
- txtPasswordToken.setText("");
- JOptionPane.showMessageDialog(null, "El archivo se modificado correctamente", "Archivo firmado", JOptionPane.INFORMATION_MESSAGE);
- }
- }else{
- JOptionPane.showMessageDialog(null, "Debe seleccionar un archivo", "Archivo no encontrado", JOptionPane.ERROR_MESSAGE);
- }
- btnFirmarArchivo.setEnabled(false);
- btnExaminar.setEnabled(false);
- } catch(IOException e){
- JOptionPane.showMessageDialog(null, e.getMessage(), "IO Error", JOptionPane.ERROR_MESSAGE);
- } catch(Exception e){
- JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
- } finally{
- try {
- if(inputStream != null){
- inputStream.close();
- }
- } catch (IOException ex) {
- Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }//GEN-LAST:event_btnFirmarArchivoActionPerformed
-
- public void escribirArchivo(byte[] data){
- System.out.println("Ingreso a escribir el archivo");
- FileOutputStream fo = null;
- try {
- File archivoFirmado = new File(txtRutaArchivo.getText());
- fo = new FileOutputStream(archivoFirmado);
- fo.write(data);
- } catch (FileNotFoundException e) {
- JOptionPane.showMessageDialog(null, e.getMessage(), "Error archivo no encontrado", JOptionPane.ERROR_MESSAGE);
- } catch (IOException e) {
- JOptionPane.showMessageDialog(null, e.getMessage(), "Error al escribir el archivo firmado", JOptionPane.ERROR_MESSAGE);
- } finally {
- try {
- fo.close();
- } catch (IOException ex) {
- Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- private void tokenIkeyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tokenIkeyActionPerformed
- // TODO add your handling code here:
- tipoFirma = "1";
- }//GEN-LAST:event_tokenIkeyActionPerformed
-
- private void tokenAlladinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tokenAlladinActionPerformed
- // TODO add your handling code here:
- tipoFirma = "2";
- }//GEN-LAST:event_tokenAlladinActionPerformed
-
- private void tokenSDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tokenSDActionPerformed
- // TODO add your handling code here:
- tipoFirma = "3";
- }//GEN-LAST:event_tokenSDActionPerformed
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton btnExaminar;
- private javax.swing.JButton btnFirmarArchivo;
- private javax.swing.ButtonGroup grupoRadios;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JLabel labelArchivoFirma;
- private javax.swing.JRadioButton tokenAlladin;
- private javax.swing.JRadioButton tokenIkey;
- private javax.swing.JRadioButton tokenSD;
- private javax.swing.JTextField txtRutaArchivo;
- // End of variables declaration//GEN-END:variables
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.java.svn-base b/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.java.svn-base
deleted file mode 100644
index 5b3b412..0000000
--- a/appletFirma/src/main/java/com/fp/firma/applet/.svn/text-base/FirmaApplet.java.svn-base
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.fp.firma.applet;
-
-import com.fp.firma.common.CertificateUtils;
-import com.fp.firma.common.FirmMessages;
-import com.itextpdf.text.Rectangle;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.JComponent;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPasswordField;
-
-/**
- * Applet de firma electrónica a través de token
- * @author dcruz
- */
-public class FirmaApplet extends javax.swing.JApplet {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private static final String PREFIX = "firmado_";
- private String rutaArchivoFirmar = "";
- private static final Logger logger = Logger.getLogger(FirmaApplet.class .getName());
-
- private String tipoFirma;
- /**
- * Initializes the applet FirmaApplet
- */
- @Override
- public void init() {
-// FileHandler handler;
-// try {
-// handler = new FileHandler(System.getProperty("java.io.tmpdir")+"\\applet.txt");
-// handler.setFormatter(new SimpleFormatter());
-// logger.addHandler(handler);
-// } catch (IOException ex) {
-// Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
-// } catch (SecurityException ex) {
-// Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
-// }
-
- /* Set the Nimbus look and feel */
- //
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(FirmaApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //
-
- /* Create and display the applet */
- try {
- java.awt.EventQueue.invokeAndWait(new Runnable() {
- public void run() {
- initComponents();
- }
- });
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * This method is called from within the init() method to initialize the form. WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // //GEN-BEGIN:initComponents
- private void initComponents() {
-
- grupoRadios = new javax.swing.ButtonGroup();
- jPanel1 = new javax.swing.JPanel();
- labelArchivoFirma = new javax.swing.JLabel();
- txtRutaArchivo = new javax.swing.JTextField();
- btnExaminar = new javax.swing.JButton();
- btnFirmarArchivo = new javax.swing.JButton();
- tokenIkey = new javax.swing.JRadioButton();
- tokenAlladin = new javax.swing.JRadioButton();
- tokenSD = new javax.swing.JRadioButton();
- grupoRadios.add(tokenIkey);
- grupoRadios.add(tokenAlladin);
- grupoRadios.add(tokenSD);
-
- labelArchivoFirma.setText("Archivo a firmar");
-
- txtRutaArchivo.setEditable(false);
- btnFirmarArchivo.setEnabled(true);
- btnExaminar.setEnabled(true);
-
- btnExaminar.setText("Examinar");
- btnExaminar.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnExaminarActionPerformed(evt);
- }
- });
-
- btnFirmarArchivo.setText("Firmar");
- btnFirmarArchivo.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnFirmarArchivoActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(labelArchivoFirma)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addGap(12, 12, 12)
- .addComponent(btnFirmarArchivo))
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(txtRutaArchivo, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(btnExaminar)))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- jPanel1Layout.setVerticalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(labelArchivoFirma)
- .addComponent(txtRutaArchivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(btnExaminar))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(btnFirmarArchivo)
- .addContainerGap())
- );
-
- tokenIkey.setText("iKey 2032");
- tokenIkey.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- tokenIkeyActionPerformed(evt);
- }
- });
-
- tokenAlladin.setText("eTokenPro");
- tokenAlladin.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- tokenAlladinActionPerformed(evt);
- }
- });
-
- tokenSD.setText("Security Data");
- tokenSD.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- tokenSDActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addContainerGap())
- .addGroup(layout.createSequentialGroup()
- .addGap(41, 41, 41)
- .addComponent(tokenIkey)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tokenAlladin)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tokenSD)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addContainerGap(75, Short.MAX_VALUE)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(tokenAlladin)
- .addComponent(tokenSD)
- .addComponent(tokenIkey))
- .addGap(18, 18, 18)
- .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(25, 25, 25))
- );
- }// //GEN-END:initComponents
-
- private void btnExaminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExaminarActionPerformed
- // TODO add your handling code here:
- try
- {
- /**llamamos el metodo que permite cargar la ventana*/
- JFileChooser fileChooser=new JFileChooser();
- String rutaArchivo = txtRutaArchivo.getText();
- File directorio = new File(rutaArchivo).getParentFile();
- fileChooser.setCurrentDirectory(directorio);
-// System.out.println("Directorio del archivo "+fileChooser.getCurrentDirectory() != null ? fileChooser.getCurrentDirectory().getAbsolutePath() : "");
- /**abrimos el archivo seleccionado*/
- int respuestaDialog = fileChooser.showOpenDialog(this);
-
- if(respuestaDialog == JFileChooser.APPROVE_OPTION){
- File fileSelected = fileChooser.getSelectedFile();
- rutaArchivoFirmar = fileSelected.getAbsolutePath();
- System.out.println("Ruta del archivo escogido "+rutaArchivoFirmar);
- txtRutaArchivo.setText(rutaArchivoFirmar);
- } else{
- JOptionPane.showMessageDialog(null,"" +
- "\nAccion cancelada por el usuario",
- "ADVERTENCIA!!!",JOptionPane.WARNING_MESSAGE);
- }
-
-
- /**recorremos el archivo, lo leemos para plasmarlo
- *en el area de texto*/
-
- }catch(Throwable ex)
- {
- JOptionPane.showMessageDialog(null,ex+"" +
- "\nNo se ha encontrado el archivo",
- "ADVERTENCIA!!!",JOptionPane.WARNING_MESSAGE);
- }
- }//GEN-LAST:event_btnExaminarActionPerformed
-
- private void btnFirmarArchivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFirmarArchivoActionPerformed
- // TODO add your handling code here:
- InputStream inputStream = null;
- try{
- String razon = getParameter("razon") != null ? getParameter("razon") : "";
- String lugar = getParameter("lugar") != null ? getParameter("lugar") : "";
- String nombreFirma = getParameter("firma") != null ? getParameter("firma") : "";
- Float llx = Float.valueOf(getParameter("llx") != null ? Float.parseFloat(getParameter("llx")) : 0.0F);
- Float lly = Float.valueOf(getParameter("lly") != null ? Float.parseFloat(getParameter("lly")) : 0.0F);
- Float urx = Float.valueOf(getParameter("urx") != null ? Float.parseFloat(getParameter("urx")) : 0.0F);
- Float ury = Float.valueOf(getParameter("ury") != null ? Float.parseFloat(getParameter("ury")) : 0.0F);
- if(tipoFirma == null){
- JOptionPane.showMessageDialog(null, "Debe seleccionar un Token con el cual firmar", "Tipo Firma", JOptionPane.ERROR_MESSAGE);
- return;
- }
- if(txtRutaArchivo.getText() != null){
- JPasswordField txtPasswordToken = new JPasswordField();
- final JComponent[] components = new JComponent[]{new JLabel("Password:"), txtPasswordToken};
- JOptionPane.showMessageDialog(null, components, "TOKEN", JOptionPane.PLAIN_MESSAGE);
- if(txtPasswordToken.getPassword() == null){
- throw new NullPointerException(FirmMessages.getString("FIR-0007"));
- }
- inputStream = new FileInputStream(txtRutaArchivo.getText());
- byte[] datos = CertificateUtils.sign(inputStream, null, new String(txtPasswordToken.getPassword()), razon, lugar, Boolean.FALSE.booleanValue(), Boolean.FALSE.booleanValue(), new Rectangle(llx.floatValue(), lly.floatValue(), urx.floatValue(), ury.floatValue()), 1, nombreFirma, this.tipoFirma);
- if(datos != null){
- escribirArchivo(datos);
- txtPasswordToken.setText("");
- JOptionPane.showMessageDialog(null, "El archivo se modificado correctamente", "Archivo firmado", JOptionPane.INFORMATION_MESSAGE);
- }
- }else{
- JOptionPane.showMessageDialog(null, "Debe seleccionar un archivo", "Archivo no encontrado", JOptionPane.ERROR_MESSAGE);
- }
- btnFirmarArchivo.setEnabled(false);
- btnExaminar.setEnabled(false);
- } catch(IOException e){
- JOptionPane.showMessageDialog(null, e.getMessage(), "IO Error", JOptionPane.ERROR_MESSAGE);
- } catch(Exception e){
- JOptionPane.showMessageDialog(null, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
- } finally{
- try {
- if(inputStream != null){
- inputStream.close();
- }
- } catch (IOException ex) {
- Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }//GEN-LAST:event_btnFirmarArchivoActionPerformed
-
- public void escribirArchivo(byte[] data){
- System.out.println("Ingreso a escribir el archivo");
- FileOutputStream fo = null;
- try {
- File archivoFirmado = new File(txtRutaArchivo.getText());
- fo = new FileOutputStream(archivoFirmado);
- fo.write(data);
- } catch (FileNotFoundException e) {
- JOptionPane.showMessageDialog(null, e.getMessage(), "Error archivo no encontrado", JOptionPane.ERROR_MESSAGE);
- } catch (IOException e) {
- JOptionPane.showMessageDialog(null, e.getMessage(), "Error al escribir el archivo firmado", JOptionPane.ERROR_MESSAGE);
- } finally {
- try {
- fo.close();
- } catch (IOException ex) {
- Logger.getLogger(FirmaApplet.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
- private void tokenIkeyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tokenIkeyActionPerformed
- // TODO add your handling code here:
- tipoFirma = "1";
- }//GEN-LAST:event_tokenIkeyActionPerformed
-
- private void tokenAlladinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tokenAlladinActionPerformed
- // TODO add your handling code here:
- tipoFirma = "2";
- }//GEN-LAST:event_tokenAlladinActionPerformed
-
- private void tokenSDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tokenSDActionPerformed
- // TODO add your handling code here:
- tipoFirma = "3";
- }//GEN-LAST:event_tokenSDActionPerformed
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton btnExaminar;
- private javax.swing.JButton btnFirmarArchivo;
- private javax.swing.ButtonGroup grupoRadios;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JLabel labelArchivoFirma;
- private javax.swing.JRadioButton tokenAlladin;
- private javax.swing.JRadioButton tokenIkey;
- private javax.swing.JRadioButton tokenSD;
- private javax.swing.JTextField txtRutaArchivo;
- // End of variables declaration//GEN-END:variables
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/entries b/appletFirma/src/main/java/com/fp/firma/common/.svn/entries
deleted file mode 100644
index 26d9970..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/entries
+++ /dev/null
@@ -1,130 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp/firma/common
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-FirmasException.java
-file
-
-
-
-
-2022-07-28T03:40:23.887721Z
-84290c6223a2073cf617d181f8c1bdc5
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-720
-
-CertificateUtils.java
-file
-
-
-
-
-2022-07-28T03:40:23.887721Z
-17c37f7ea3aec267390dece54b70a43b
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-25187
-
-FirmMessages.java
-file
-
-
-
-
-2022-07-28T03:40:23.888721Z
-214a4e732a4b72d7ee6b901019619bf0
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-361
-
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/CertificateUtils.java.svn-base b/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/CertificateUtils.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/CertificateUtils.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/FirmMessages.java.svn-base b/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/FirmMessages.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/FirmMessages.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/FirmasException.java.svn-base b/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/FirmasException.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/prop-base/FirmasException.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/CertificateUtils.java.svn-base b/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/CertificateUtils.java.svn-base
deleted file mode 100644
index 44082ba..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/CertificateUtils.java.svn-base
+++ /dev/null
@@ -1,584 +0,0 @@
-package com.fp.firma.common;
-
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.Security;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-
-import com.fp.firma.dto.TfirmDatosFirmante;
-import com.fp.firma.keystore.KeyStoreProvider;
-import com.fp.firma.keystore.LinuxKeyStoreProvider;
-import com.fp.firma.keystore.WindowsJDK6KeyStoreProvider;
-import com.itextpdf.text.DocumentException;
-import com.itextpdf.text.Font;
-import com.itextpdf.text.Rectangle;
-import com.itextpdf.text.pdf.AcroFields;
-import com.itextpdf.text.pdf.PdfReader;
-import com.itextpdf.text.pdf.PdfSignatureAppearance;
-import com.itextpdf.text.pdf.PdfStamper;
-import com.itextpdf.text.pdf.security.BouncyCastleDigest;
-import com.itextpdf.text.pdf.security.CertificateInfo;
-import com.itextpdf.text.pdf.security.CertificateInfo.X500Name;
-import com.itextpdf.text.pdf.security.DigestAlgorithms;
-import com.itextpdf.text.pdf.security.ExternalDigest;
-import com.itextpdf.text.pdf.security.ExternalSignature;
-import com.itextpdf.text.pdf.security.MakeSignature;
-import com.itextpdf.text.pdf.security.MakeSignature.CryptoStandard;
-import com.itextpdf.text.pdf.security.OcspClient;
-import com.itextpdf.text.pdf.security.OcspClientBouncyCastle;
-import com.itextpdf.text.pdf.security.PrivateKeySignature;
-import com.itextpdf.text.pdf.security.TSAClient;
-//import javax.persistence.NoResultException;
-//import javax.persistence.Query;
-
-/**
- * Clase que contiene métodos utilitarios para manejar certificados
- *
- * @author dcruz
- *
- */
-public class CertificateUtils {
-
- /*
- * CONSTANTES DESIGNADAS SEGUN LA NUEVA ESTRUCTURA DEL BCE
- */
- // OIDs de Campos del Certificado:
- public static final String OID_CEDULA_PASAPORTE = FirmMessages.getString("oid.cedula_pasaporte");
-
- public static final String OID_NOMBRES = FirmMessages.getString("oid.nombres_persona");
-
- public static final String OID_APELLIDO_1 = FirmMessages.getString("oid.apellido_persona1");
-
- public static final String OID_APELLIDO_2 = FirmMessages.getString("oid.apellido_persona2");
-
- public static final String OID_CARGO = FirmMessages.getString("oid.cargo");
-
- public static final String OID_INSTITUCION = FirmMessages.getString("oid.institucion");
-
- public static final String OID_DIRECCION = FirmMessages.getString("oid.direccion");
-
- public static final String OID_TELEFONO = FirmMessages.getString("oid.telefono");
-
- public static final String OID_CIUDAD = FirmMessages.getString("oid.ciudad");
-
- public static final String OID_RAZON_SOCIAL = FirmMessages.getString("oid.razon_social");
-
- public static final String OID_RUC = FirmMessages.getString("oid.ruc");
-
- public static final String X509 = "X.509";
-
- static {
- BouncyCastleProvider provider = new BouncyCastleProvider();
- Security.addProvider(provider);
- }
-
- /**
- * Retorna el certificado del usuario contenido en la firma
- *
- * @param store el store en el que se va a buscar los certificados
- * @param aliases los alias que estan dentro del keystore
- * @return el {@link java.security.Certificate}
- * @throws KeyStoreException
- */
- public synchronized static Certificate obtainCertificateInAlias(KeyStore store, Enumeration aliases) throws KeyStoreException {
- Certificate certs[] = null;
- synchronized (aliases) {
- int i = 0;
- while (aliases.hasMoreElements()) {
- String alias = aliases.nextElement();
- System.out.println("Se imprime los alias: " + i + " " + alias);
- certs = store.getCertificateChain(alias);
- for (int j = 0; j < certs.length; j++) {
- X509Certificate certificate = (X509Certificate) certs[j];
- boolean[] usages = certificate.getKeyUsage();
- System.out.println("Certificado en primera posicion usado: " + j + " " + usages[0]);
- if (usages[0]) {
- return certificate;
- }
- }
- i++;
- }
-
- }
- return null;
- }
-
- /**
- * Se devuelve todos los datos de la firma del usuario en base al certificado enviado
- *
- * @param certificate el certificado enviado
- * @return Los datos del certificado de dicho usuario
- */
- public static TfirmDatosFirmante obtainDataForCertificate(Certificate certificate) {
- X509Certificate signedCertificate = (X509Certificate) certificate;
- TfirmDatosFirmante datosFirmante = new TfirmDatosFirmante();
- if (signedCertificate.getExtensionValue(OID_CEDULA_PASAPORTE) != null) {
- datosFirmante.setIdentificacion(new String(signedCertificate.getExtensionValue(OID_CEDULA_PASAPORTE)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_NOMBRES) != null) {
- datosFirmante.setNombre(new String(signedCertificate.getExtensionValue(OID_NOMBRES)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_APELLIDO_1) != null) {
- datosFirmante.setApellido1(new String(signedCertificate.getExtensionValue(OID_APELLIDO_1)).trim());
- if (signedCertificate.getExtensionValue(OID_APELLIDO_2) != null) {
- datosFirmante.setApellido2(new String(signedCertificate.getExtensionValue(OID_APELLIDO_2)).trim());
- } else {
- datosFirmante.setApellido2("");
- }
- }
- if (signedCertificate.getExtensionValue(OID_TELEFONO) != null) {
- datosFirmante.setTelefono(new String(signedCertificate.getExtensionValue(OID_TELEFONO)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_CARGO) != null) {
- datosFirmante.setCargo(new String(signedCertificate.getExtensionValue(OID_CARGO)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_CIUDAD) != null) {
- datosFirmante.setCiudad(new String(signedCertificate.getExtensionValue(OID_CIUDAD)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_DIRECCION) != null) {
- datosFirmante.setDireccion(new String(signedCertificate.getExtensionValue(OID_DIRECCION)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_INSTITUCION) != null) {
- datosFirmante.setInstitucion(new String(signedCertificate.getExtensionValue(OID_INSTITUCION)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_RAZON_SOCIAL) != null) {
- datosFirmante.setInstitucion(new String(signedCertificate.getExtensionValue(OID_RAZON_SOCIAL)).trim());
- }
- if (signedCertificate.getExtensionValue(OID_RUC) != null) {
- datosFirmante.setRuc(new String(signedCertificate.getExtensionValue(OID_RUC)).trim());
- }
- datosFirmante.setFechaInicioVigencia(signedCertificate.getNotBefore());
- datosFirmante.setFechaVigencia(signedCertificate.getNotAfter());
- return datosFirmante;
- }
-
- /**
- * Valida que el certificado del usuario sea un certificado valido contra el servicio OCSP del proveedor
- *
- * @param certificateUser
- * @throws FileNotFoundException
- * @throws CertificateException
- */
- public static void validateOcsCertificate(Certificate certificateUser) throws FileNotFoundException, CertificateException {
- System.out.println(((X509Certificate) certificateUser).getIssuerDN().getName());
- CertificateFactory cf = CertificateFactory.getInstance(X509);
- InputStream subordStream = new FileInputStream(FirmMessages.getString("dir.ruta.base.repositorio") + "/"
- + FirmMessages.getString("nombre.certificado.subordinado"));
- X509Certificate subordCertificate = (X509Certificate) cf.generateCertificate(subordStream);
- check((X509Certificate) certificateUser, subordCertificate);
- }
-
- /**
- * Valida que los certificados enviados sean validos por la entidad certificadora
- *
- * @param issuerCert certificado del usuario
- * @param x509Cert certificado que firmo el certificado expedido
- */
- public static void check(X509Certificate issuerCert, X509Certificate x509Cert) {
-// try {
-//
-// BigInteger serialNumber = issuerCert.getSerialNumber();
-// X509CertificateHolder holder;
-//
-// try {
-// holder = new X509CertificateHolder(x509Cert.getEncoded());
-// } catch (IOException e) {
-// throw new RuntimeException(e);
-// }
-//
-// CertificateID id = new CertificateID(new JcaDigestCalculatorProviderBuilder().setProvider(BouncyCastleProvider.PROVIDER_NAME).build()
-// .get(CertificateID.HASH_SHA1), holder, serialNumber);
-//
-// OCSPReqBuilder ocspGen = new OCSPReqBuilder();
-// ocspGen.addRequest(id);
-// OCSPReq ocspReq = ocspGen.build();
-//
-// // Ir al OCSP
-// String ocspUrl = CertificateUtil.getOCSPURL(issuerCert);
-//
-// if (ocspUrl == null) {
-// System.out.println("URL de OCSP is null");
-// return;
-// }
-//
-// URL url;
-//
-// try {
-// url = new URL(ocspUrl);
-// } catch (MalformedURLException e) {
-// throw new RuntimeException(e);
-// }
-//
-// HttpURLConnection con;
-// OCSPResp ocspResponse;
-// DataOutputStream dataOut = null;
-// try {
-// con = (HttpURLConnection) url.openConnection();
-//
-// con.setRequestProperty("Content-Type", "application/ocsp-request");
-// con.setRequestProperty("Accept", "application/ocsp-response");
-// con.setDoOutput(true);
-//
-// OutputStream out = con.getOutputStream();
-// dataOut = new DataOutputStream(new BufferedOutputStream(out));
-// dataOut.write(ocspReq.getEncoded());
-//
-// System.out.println("Estado de respuesta de la peticion=" + con.getResponseCode());
-//
-// /*
-// * Se parsea la respuesta y se obtiene el estado del certificado retornado por el OCSP
-// */
-// InputStream in = (InputStream) con.getContent();
-// byte[] resp = read(in); // Read the reponse
-// ocspResponse = new OCSPResp(resp);
-// } catch (IOException e) {
-// throw new FirmasException("ERROR AL ESTABLECER CONEXI\u00d3N AL SERVICIO: "+url);
-// } finally{
-// if(dataOut != null){
-// try {
-// dataOut.flush();
-// dataOut.close();
-// } catch (IOException e) {}
-// }
-// }
-//
-// int status = ocspResponse.getStatus();
-// System.out.println("status=" + status);
-//
-// BasicOCSPResp basicResponse = (BasicOCSPResp) ocspResponse.getResponseObject();
-//
-// if (basicResponse != null) {
-// SingleResp[] responses = basicResponse.getResponses();
-// SingleResp response = responses[0];
-// CertificateStatus certStatus = (CertificateStatus) response.getCertStatus();
-//
-// if (certStatus instanceof RevokedStatus) {
-// System.out.println("REVOKED");
-// RevokedStatus revokedStatus = (RevokedStatus) certStatus;
-// System.out.println("Reason: " + revokedStatus.getRevocationReason());
-// System.out.println("Date: " + revokedStatus.getRevocationTime());
-//
-// throw new FirmasException("ERROR, CERTIFICADO REVOCADO POR "+revokedStatus.getRevocationReason()+" CON FECHA "+ revokedStatus.getRevocationTime());
-// }
-// }
-// } catch (OCSPException e) {
-// throw new RuntimeException(e);
-// } catch (CertificateEncodingException e) {
-// throw new RuntimeException(e);
-// }
- }
-
- /**
- * Devuelve los nombres de firmas de un documento PDF
- *
- * @param docStream el documento a verificar
- * @return un lista de nombres de firmas
- */
- public static List obtainNameSigns(InputStream docStream) {
- try {
- PdfReader docPdf = new PdfReader(docStream);
- AcroFields af = docPdf.getAcroFields();
- return af.getSignatureNames();
- } catch (IOException e) {
- System.err.println("Error al obtener los nombres del documentoss");
- return null;
- } finally{
-
- }
- }
-
-/**
- * Método para firmar documentos
- * @param fileSrc
- * @param usuario
- * @param password
- * @param compania
- * @param reason
- * @param location
- * @param rectangle
- * @param numPage
- * @param nameSign
- * @return
- * @throws Exception
- */
- public static byte[] sign(InputStream fileSrc, String usuario, String password, Integer compania, String reason, String location,
- Rectangle rectangle, int numPage, String nameSign, String pathCertificate) throws Exception {
- String path = pathCertificate;
- FileInputStream ceritificateInputStream = new FileInputStream(path);
- return sign(fileSrc, ceritificateInputStream, password, reason, location, false, true, rectangle, numPage, nameSign, null);
- }
-
- /**
- * Metodo para firmar documentos
- * @param fileSrc
- * @param usuario
- * @param password
- * @param compania
- * @param reason
- * @param location
- * @param rectangle
- * @param numPage
- * @param nameSign
- * @return
- * @throws Exception
- */
- public static byte[] sign(InputStream fileSrc, String usuario, String password, Integer compania, String reason, String location,
- Rectangle rectangle, int numPage, String nameSign) throws Exception {
- String path = "";
- FileInputStream ceritificateInputStream = new FileInputStream(path);
- return sign(fileSrc, ceritificateInputStream, password, reason, location, false, true, rectangle, numPage, nameSign, null);
- }
-
- /**
- * Método que firma un documento en base los parámetros indicados
- *
- * @param fileSrc archivo origen
- * @param fileCert archivo firma en formato digital si no es null el firmado es con archivo caso contrario es token
- * @param password contrasena
- * @param reason razón o motivo de la firma.
- * @param location localización coemtario adicional de la firma.
- * @param withTS tiene TS estamapado de tiempo.
- * @param withOCSP tiene OCSP verificacion de la firma por el la entidad certificadora BCE.
- * @param rectangle lugar localizaci´n firma
- * @param numPage número pagina
- * @param nameSign nombre firma
- * @param tipoFirma es el tipo de token que se usará(Token que tipo?)
- * @return el documento firmado
- */
- public static byte[] sign(InputStream fileSrc, InputStream fileCert, String password, String reason, String location, boolean withTS,
- boolean withOCSP, Rectangle rectangle, int numPage, String nameSign, String tipoFirma) {
- OutputStream outputStream = null;
- System.out.println("Ingreso a firmar");
- try {
- PdfReader pdfReader = new PdfReader(fileSrc);
- outputStream = new ByteArrayOutputStream(512);
- PdfStamper stamper = PdfStamper.createSignature(pdfReader, outputStream, '\0');
- PdfSignatureAppearance appearance = stamper.getSignatureAppearance();
- KeyStore store;
- String alias;
-// PrivateKey privateKey = null;
- ExternalSignature signature = null;
- if(fileCert != null){
- store = KeyStore.getInstance("PKCS12");
- store.load(fileCert, password.toCharArray());
- alias = store.aliases().nextElement();
- signature = new PrivateKeySignature((PrivateKey) store.getKey(alias, password.toCharArray()), DigestAlgorithms.SHA256,
- "SunRsaSign");
- } else{//firma por token
- KeyStoreProvider provider = getKeyStoreProvider(tipoFirma);
- store = provider.getKeystore(password.toCharArray());
- alias = store.aliases().nextElement();
-// privateKey = (PrivateKey) store.getKey(alias, null);
- signature = new PrivateKeySignature((PrivateKey) store.getKey(alias, null), DigestAlgorithms.SHA1,
- null);
- }
-// appearance.setCrypto(privateKey, store.getCertificateChain(alias), null, null);
- appearance.setLayer2Text(generateSignText(store.getCertificateChain(alias), reason, location));
- appearance.setLayer2Font(new Font(Font.FontFamily.UNDEFINED, 8F));
- appearance.setVisibleSignature(rectangle, numPage, nameSign);
- TSAClient tsc = null;
- if (withTS) {
-
- }
- OcspClient ocsp = null;
- if (withOCSP) {
- ocsp = new OcspClientBouncyCastle();
- }
-// stamper.close();
- ExternalDigest externalDigest = new BouncyCastleDigest();
- MakeSignature.signDetached(appearance, externalDigest, signature, store.getCertificateChain(alias), null, ocsp, tsc, 15000,
- CryptoStandard.CADES);
- return ((ByteArrayOutputStream) outputStream).toByteArray();
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (DocumentException e) {
- throw new RuntimeException(e);
- } catch (KeyStoreException e) {
- throw new RuntimeException(e);
- } catch (NoSuchAlgorithmException e) {
- throw new RuntimeException(e);
- } catch (CertificateException e) {
- throw new RuntimeException(e);
- } catch (GeneralSecurityException e) {
- throw new RuntimeException(e);
- } catch (FirmasException e) {
- throw new RuntimeException(FirmMessages.getString("FIR-0006"));
- } catch (Throwable e) {
- throw new RuntimeException(e);
- } finally{
- try {
- if(fileCert != null){
- fileCert.close();
- }
- } catch (IOException e) {}
- try {
- fileSrc.close();
- } catch (IOException e) {}
- try {
- if(outputStream != null){
-
- outputStream.close();
- }
- } catch (IOException e) {}
- }
- }
-
- /**
- * Arma documento el texto a mostrar de la plantilla
- * @param chains certificados
- * @param reason razón
- * @param location lugar
- * @return una layout de la firma
- */
- private static String generateSignText(Certificate[] chains, String reason, String location){
- StringBuffer textLayout = new StringBuffer("Firmado digitalmente por: ");
- String name = null;
- X500Name x500name = CertificateInfo.getSubjectFields((X509Certificate)chains[0]);
- if (x500name != null) {
- name = x500name.getField("CN");
- if (name == null)
- name = x500name.getField("E");
- }
- if(name == null){
- name = "";
- }
- textLayout.append(name).append("\n");
- if(reason != null){
- textLayout.append("Raz\u00f3n: ").append(reason).append("\n");
- }
- if(location != null){
- textLayout.append("Lugar: ").append(location).append("\n");
- }
- SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
- textLayout.append("Fecha: ").append(format.format(new Date(System.currentTimeMillis())));
- return textLayout.toString();
- }
-
- /**
- * Retorna el keystore del token especificado
- * @param tipoToken
- * @return
- * @throws KeyStoreException
- */
- private static KeyStoreProvider getKeyStoreProvider(String tipoToken) {
- String osName = System.getProperty("os.name");
- KeyStoreProvider provider = null;
- if(tipoToken == null){
- return provider;
- }
- if (osName.toUpperCase().indexOf("WINDOWS") == 0) {
- provider = new WindowsJDK6KeyStoreProvider();
- if (tipoToken.equals("2")) {
- provider = new WindowsJDK6KeyStoreProvider(); // trabaja con librerias sera para eToken
- }else if (tipoToken.equals("1")) {
- provider = new WindowsJDK6KeyStoreProvider(); // trabaja con librerias sera para iKey
- }else if (tipoToken.equals("3")) {
- provider = new WindowsJDK6KeyStoreProvider(); // trabaja con librerias sera para iKey
- }
- } else {
- provider = new LinuxKeyStoreProvider();
- }
- return provider;
- }
-
- private static byte[] read(InputStream in) throws IOException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- int next = in.read();
- while (next > -1) {
- bos.write(next);
- next = in.read();
- }
- bos.flush();
- return bos.toByteArray();
- }
-
- /**
- * Entrega el path en el que se encuentra el certificado digital.
- *
- * @param cusuario Codigo de usuario.
- * @param ccompania Codigo de compania.
- * @return String
- * @throws Exception
- */
-// private static String getPath(String cusuario, Integer ccompania) throws Exception {
-// TfirmCertificado tfirmcertificado = getTfirmCertificado(cusuario);
-// TgeneParametersKey tgeneParametersKey = new TgeneParametersKey("PATH_CERTIFICADO_BCE", ccompania);
-// TgeneParameters tgeneParameters = TgeneParameters.find(PersistenceHelper.getEntityManager(), tgeneParametersKey);
-// String path = tgeneParameters.getTextvalue() + "/" + tfirmcertificado.getPk().getIdcertificado();
-// return path;
-// }
-
- /**
- * Sentencia que entrega la defincion vigente de un certificado digital para un usuario.
- */
-// private static final String JPQL = "from TfirmCertificado where t.codigousuario = :cusuario";
-
- /**
- * Entrega defincion de certificados digitales vigente.
- *
- * @param cusuario Codigo de usuario.
- * @return TfirmCertificado.
- * @throws Exception
- */
-// private static TfirmCertificado getTfirmCertificado(String cusuario) throws Exception {
-// TfirmCertificado tfirmCertificado = null;
-// Query qry = PersistenceHelper.getEntityManager().createQuery(JPQL);
-// qry.setParameter("cusuario", cusuario);
-// try {
-// tfirmCertificado = (TfirmCertificado) qry.getSingleResult();
-// } catch (NoResultException e) {
-// throw new FirmasException("FIR-0001", "PARAMETROS DEL CERTIFICADO DIGITAL NO DEFINIDO PARA EL USUARIO: {0}", cusuario);
-// }
-// return tfirmCertificado;
-// }
-
-
- /*
- public static boolean validatePassword(InputStream fileSrc, String usuario, String password, Integer compania, String reason, String location,
- Rectangle rectangle, int numPage, String nameSign) throws Exception {
- String path = getPath(usuario, compania);
- FileInputStream ceritificateInputStream = new FileInputStream(path);
- return pass(fileSrc, ceritificateInputStream, password, reason, location, false, true, rectangle, numPage, nameSign);
- }
-
-
- private static boolean pass(InputStream fileSrc, InputStream fileCert, String password, String reason, String location, boolean withTS,
- boolean withOCSP, Rectangle rectangle, int numPage, String nameSign) {
- try {
- PdfReader pdfReader = new PdfReader(fileSrc);
- OutputStream outputStream = new ByteArrayOutputStream(512);
- PdfStamper stamper = PdfStamper.createSignature(pdfReader, outputStream, '\0');
- PdfSignatureAppearance appearance = stamper.getSignatureAppearance();
-
- KeyStore store = KeyStore.getInstance("PKCS12");
- store.load(fileCert, password.toCharArray());
- String alias = store.aliases().nextElement();
- ExternalSignature signature = new PrivateKeySignature((PrivateKey) store.getKey(alias, password.toCharArray()), DigestAlgorithms.SHA256,
- "SunRsaSign");
- return true;
- } catch (Exception e) {
- return false;
- }
- }
- */
-
-
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/FirmMessages.java.svn-base b/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/FirmMessages.java.svn-base
deleted file mode 100644
index c560464..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/FirmMessages.java.svn-base
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.fp.firma.common;
-
-import java.util.ResourceBundle;
-
-public class FirmMessages {
-
- private final static String RESOURCE = "firmessages_es";
-
- private final static ResourceBundle firmessages;
-
- static{
- firmessages = ResourceBundle.getBundle(RESOURCE);
- }
-
- public static String getString(String key) {
- return firmessages.getString(key);
- }
-
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/FirmasException.java.svn-base b/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/FirmasException.java.svn-base
deleted file mode 100644
index d781306..0000000
--- a/appletFirma/src/main/java/com/fp/firma/common/.svn/text-base/FirmasException.java.svn-base
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.fp.firma.common;
-
-
-/**
- * Clase que manejará todos los errores relacionados con la firma digital
- *
- * @author dcruz
- *
- */
-public class FirmasException extends RuntimeException {
-
- private static final long serialVersionUID = -599185902882644036L;
-
- public FirmasException(String message) {
- super(message);
- }
-
- public FirmasException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public FirmasException(Throwable cause) {
- super(cause);
- }
-
- public FirmasException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
- super(message, cause, enableSuppression, writableStackTrace);
- }
-
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/component/.svn/entries b/appletFirma/src/main/java/com/fp/firma/component/.svn/entries
deleted file mode 100644
index 44d0f5e..0000000
--- a/appletFirma/src/main/java/com/fp/firma/component/.svn/entries
+++ /dev/null
@@ -1,62 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp/firma/component
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-PasswordDialog.java
-file
-
-
-
-
-2022-07-28T03:40:23.697721Z
-2b492580e233dc08baf86d4b915c4e2a
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1794
-
diff --git a/appletFirma/src/main/java/com/fp/firma/component/.svn/prop-base/PasswordDialog.java.svn-base b/appletFirma/src/main/java/com/fp/firma/component/.svn/prop-base/PasswordDialog.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/component/.svn/prop-base/PasswordDialog.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/component/.svn/text-base/PasswordDialog.java.svn-base b/appletFirma/src/main/java/com/fp/firma/component/.svn/text-base/PasswordDialog.java.svn-base
deleted file mode 100644
index 3667ca9..0000000
--- a/appletFirma/src/main/java/com/fp/firma/component/.svn/text-base/PasswordDialog.java.svn-base
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.fp.firma.component;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import javax.swing.JDialog;
-import javax.swing.JOptionPane;
-import javax.swing.JPasswordField;
-
-/**
- * Dialog que permite el ingreso del password del token para la firma
- * @author dcruz
- */
-public class PasswordDialog extends JDialog implements ActionListener, PropertyChangeListener{
-
- private JPasswordField txtPasswordCertificado;
-
- public PasswordDialog(){
- super();
- txtPasswordCertificado = new JPasswordField();
- setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
- addComponentListener(new ComponentAdapter() {
- @Override
- public void componentShown(ComponentEvent ce) {
- txtPasswordCertificado.requestFocusInWindow();
- }
- });
- txtPasswordCertificado.addActionListener(this);
- }
-
- public void actionPerformed(ActionEvent e) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- /** This method clears the dialog and hides it. */
- public void clearAndHide() {
- txtPasswordCertificado.setText(null);
- setVisible(false);
- }
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/dto/.svn/entries b/appletFirma/src/main/java/com/fp/firma/dto/.svn/entries
deleted file mode 100644
index a2055ff..0000000
--- a/appletFirma/src/main/java/com/fp/firma/dto/.svn/entries
+++ /dev/null
@@ -1,62 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp/firma/dto
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-TfirmDatosFirmante.java
-file
-
-
-
-
-2022-07-28T03:40:23.854721Z
-dab60ed3fdfb2662d1e1b54882a17c12
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3379
-
diff --git a/appletFirma/src/main/java/com/fp/firma/dto/.svn/prop-base/TfirmDatosFirmante.java.svn-base b/appletFirma/src/main/java/com/fp/firma/dto/.svn/prop-base/TfirmDatosFirmante.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/dto/.svn/prop-base/TfirmDatosFirmante.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/dto/.svn/text-base/TfirmDatosFirmante.java.svn-base b/appletFirma/src/main/java/com/fp/firma/dto/.svn/text-base/TfirmDatosFirmante.java.svn-base
deleted file mode 100644
index 39b5ea0..0000000
--- a/appletFirma/src/main/java/com/fp/firma/dto/.svn/text-base/TfirmDatosFirmante.java.svn-base
+++ /dev/null
@@ -1,169 +0,0 @@
-package com.fp.firma.dto;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Clase que contiene los datos del usuario que es dueno de la firma y en la cual
- *
- * @author dcruz
- *
- */
-public class TfirmDatosFirmante implements
- Serializable, Cloneable {
-
- private static final long serialVersionUID = 4232773513442100177L;
- private String aliasCertificado;
- private String identificacion;
- private String nombre;
- private String apellido1;
- private String apellido2;
- private String cargo;
- private String institucion;
- private String direccion;
- private String telefono;
- private String ciudad;
- private String razonSocial;
- private String ruc;
- private Date fechaInicioVigencia;
- private Date fechaVigencia;
-
- public TfirmDatosFirmante(){}
-
- public TfirmDatosFirmante(String identificacion, String nombre,
- String apellido1, String apellido2, String cargo,
- String institucion, String direccion, String telefono,
- String ciudad, String razonSocial, String ruc) {
- super();
- this.identificacion = identificacion;
- this.nombre = nombre;
- this.apellido1 = apellido1;
- this.apellido2 = apellido2;
- this.cargo = cargo;
- this.institucion = institucion;
- this.direccion = direccion;
- this.telefono = telefono;
- this.ciudad = ciudad;
- this.razonSocial = razonSocial;
- this.ruc = ruc;
- }
-
-
-
- public String getIdentificacion() {
- return identificacion;
- }
-
- public void setIdentificacion(String identificacion) {
- this.identificacion = identificacion;
- }
-
- public String getNombre() {
- return nombre;
- }
-
- public void setNombre(String nombre) {
- this.nombre = nombre;
- }
-
- public String getApellido1() {
- return apellido1;
- }
-
- public void setApellido1(String apellido1) {
- this.apellido1 = apellido1;
- }
-
- public String getApellido2() {
- return apellido2;
- }
-
- public void setApellido2(String apellido2) {
- this.apellido2 = apellido2;
- }
-
- public String getCargo() {
- return cargo;
- }
-
- public void setCargo(String cargo) {
- this.cargo = cargo;
- }
-
- public String getInstitucion() {
- return institucion;
- }
-
- public void setInstitucion(String institucion) {
- this.institucion = institucion;
- }
-
- public String getDireccion() {
- return direccion;
- }
-
- public void setDireccion(String direccion) {
- this.direccion = direccion;
- }
-
- public String getTelefono() {
- return telefono;
- }
-
- public void setTelefono(String telefono) {
- this.telefono = telefono;
- }
-
- public String getCiudad() {
- return ciudad;
- }
-
- public void setCiudad(String ciudad) {
- this.ciudad = ciudad;
- }
-
- public String getRazonSocial() {
- return razonSocial;
- }
-
- public void setRazonSocial(String razonSocial) {
- this.razonSocial = razonSocial;
- }
-
- public String getRuc() {
- return ruc;
- }
-
- public void setRuc(String ruc) {
- this.ruc = ruc;
- }
-
- public Object cloneMe() throws CloneNotSupportedException {
- return this.clone();
- }
-
- public Date getFechaVigencia() {
- return fechaVigencia;
- }
-
- public void setFechaVigencia(Date fechaVigencia) {
- this.fechaVigencia = fechaVigencia;
- }
-
- public Date getFechaInicioVigencia() {
- return fechaInicioVigencia;
- }
-
- public void setFechaInicioVigencia(Date fechaInicioVigencia) {
- this.fechaInicioVigencia = fechaInicioVigencia;
- }
-
- public String getAliasCertificado() {
- return aliasCertificado;
- }
-
- public void setAliasCertificado(String aliasCertificado) {
- this.aliasCertificado = aliasCertificado;
- }
-
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/entries b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/entries
deleted file mode 100644
index 38c0ed9..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/entries
+++ /dev/null
@@ -1,470 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/java/com/fp/firma/keystore
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-WindowsJDK5KeyStoreProvider_SD.java
-file
-
-
-
-
-2022-07-28T03:40:23.800721Z
-4355360f5ecffb2d4776d5895e69d2ef
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5923
-
-FileKeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.801721Z
-352ad7236593816e5385e65d46a8b0f2
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1478
-
-KeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.801721Z
-a0f54011dfb2d1e7f45d631fc88fd1b5
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-712
-
-LinuxKeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.801721Z
-cd842f1fbfeb4276644783b68fc000f2
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4707
-
-AppleKeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.802721Z
-9cb997093c0456d0e27e53487b3089ed
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1435
-
-PKCS11KeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.802721Z
-9d48dfb6533b29e3de2b09e3558a4102
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2747
-
-SimpleCallbackHandler.java
-file
-
-
-
-
-2022-07-28T03:40:23.802721Z
-f61edcced631f06f1e348a9e69df41a2
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1136
-
-KeyStoreProviderFactory.java
-file
-
-
-
-
-2022-07-28T03:40:23.803721Z
-6592e7f0cf2ac2b4c84453799ff34a3a
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1209
-
-WindowsJDK5KeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.803721Z
-7bf432721d15fd670c94fb663f37d404
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5464
-
-MockKeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.804721Z
-b634940536517cc8b206d61696baaeeb
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1696
-
-WindowsJDK5KeyStoreProvider_iKey.java
-file
-
-
-
-
-2022-07-28T03:40:23.804721Z
-08c26de2f28d4b0ec66430d288a760cc
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5977
-
-WindowsJDK6KeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.804721Z
-17872a0f5c62ffaa84c62af09d9a9da2
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1650
-
-WindowsKeyStoreProvider.java
-file
-
-
-
-
-2022-07-28T03:40:23.805721Z
-32b9f0efba427dd9cb235cbb97baa6e2
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1367
-
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/AppleKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/AppleKeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/AppleKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/FileKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/FileKeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/FileKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/KeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/KeyStoreProviderFactory.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/KeyStoreProviderFactory.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/KeyStoreProviderFactory.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/LinuxKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/LinuxKeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/LinuxKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/MockKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/MockKeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/MockKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/PKCS11KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/PKCS11KeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/PKCS11KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/SimpleCallbackHandler.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/SimpleCallbackHandler.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/SimpleCallbackHandler.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider_SD.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider_SD.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider_SD.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider_iKey.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider_iKey.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK5KeyStoreProvider_iKey.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK6KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK6KeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsJDK6KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsKeyStoreProvider.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/prop-base/WindowsKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/AppleKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/AppleKeyStoreProvider.java.svn-base
deleted file mode 100644
index ee50daa..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/AppleKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.cert.CertificateException;
-
-/**
- * Implementacion de KeyStoreProvider para el
- * sistema operativo Mac OS X.
- *
- */
-public class AppleKeyStoreProvider implements KeyStoreProvider {
-
- private static final String APPLE_PROVIDER_TYPE = "KeychainStore";
- private static final String APPLE_PROVIDER_NAME = "Apple";
-
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- KeyStore keyStore = KeyStore.getInstance(APPLE_PROVIDER_TYPE, APPLE_PROVIDER_NAME);
- keyStore.load(null, null);
- return keyStore;
- } catch (NoSuchProviderException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchAlgorithmException e) {
- throw new KeyStoreException(e);
- } catch (CertificateException e) {
- throw new KeyStoreException(e);
- } catch (IOException e) {
- throw new KeyStoreException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/FileKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/FileKeyStoreProvider.java.svn-base
deleted file mode 100644
index 7f87eec..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/FileKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-
-/**
- * Implementación de KeyStoreProvider para leer de un archivo.
- *
- */
-public class FileKeyStoreProvider implements KeyStoreProvider {
-
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- InputStream input = new FileInputStream(System.getProperty("user.home") + File.separator + ".keystore");
-
- KeyStore keyStore = KeyStore.getInstance("jks");
- keyStore.load(input, password);
- return keyStore;
- } catch (FileNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchAlgorithmException e) {
- throw new KeyStoreException(e);
- } catch (CertificateException e) {
- throw new KeyStoreException(e);
- } catch (IOException e) {
- throw new KeyStoreException(e);
- } finally {
- // TODO: Close InputStream
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/KeyStoreProvider.java.svn-base
deleted file mode 100644
index b71f43e..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-
-/**
- * Obtiene un KeyStore.
- *
- */
-public interface KeyStoreProvider {
-
- /**
- * Obtiene un KeyStore protegido por un password.
- *
- * @param password
- * @return
- * @throws KeyStoreException
- */
- KeyStore getKeystore(char[] password) throws KeyStoreException;
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/KeyStoreProviderFactory.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/KeyStoreProviderFactory.java.svn-base
deleted file mode 100644
index 032dce4..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/KeyStoreProviderFactory.java.svn-base
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.fp.firma.keystore;
-
-import java.util.logging.Logger;
-
-/**
- * Obtiene la implementacion correcta de KeyStoreProvider de acuerdo al sistema
- * operativo.
- */
-public class KeyStoreProviderFactory {
-
- private static final Logger log = Logger.getLogger(KeyStoreProviderFactory.class.getName());
-
- /**
- * Obtiene la implementacion correcta de KeyStoreProvider de acuerdo al
- * sistema operativo.
- *
- * @return implementacion de KeyStoreProvider
- */
- public static KeyStoreProvider createKeyStoreProvider() {
- String osName = System.getProperty("os.name");
- String javaVersion = System.getProperty("java.version");
-
- log.finer("Operating System:" + osName);
- log.finer("Java Version:" + javaVersion);
-
- if (osName.toUpperCase().indexOf("WINDOWS") == 0) {
- if (javaVersion.indexOf("1.6") == 0) {
- return new WindowsJDK6KeyStoreProvider();
- } else {
- return new WindowsJDK5KeyStoreProvider();
- }
- } else if (osName.toUpperCase().indexOf("LINUX") == 0) {
- return new LinuxKeyStoreProvider();
- } else if (osName.toUpperCase().indexOf("MAC") == 0) {
- return new AppleKeyStoreProvider();
- } else {
- throw new IllegalArgumentException("Sistema operativo no soportado!");
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/LinuxKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/LinuxKeyStoreProvider.java.svn-base
deleted file mode 100644
index ed1155e..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/LinuxKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.AuthProvider;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.Provider;
-import java.security.Security;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.security.auth.login.LoginException;
-
-/**
- * Implementacion de KeyStoreProvider para utilizar con librerias
- * PKCS#11 del sistema operativo Linux.
- *
- * Utiza OpenCT para acceder a un Token USB.
- *
- *
- */
-public class LinuxKeyStoreProvider implements KeyStoreProvider {
-
- //MAC: /usr/local/lib/libsfntpkcs11.dylib\nslot = 1
- private static final byte[] PKCS11_CONFIG = "name = SmartCard\nlibrary = /usr/local/SafeNet/lib/libsfntpkcs11.so\nslot = 1 \n showInfo = true".getBytes(); // /usr/local/SafeNet/lib/libsfntpkcs11.so\nslot = 1
- ///usr/local/lib/libsfntpkcs11.dylib
- private static final String SUN_PKCS11_PROVIDER_CLASS = "sun.security.pkcs11.SunPKCS11";
- private AuthProvider aprov;
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- InputStream configStream = new ByteArrayInputStream(PKCS11_CONFIG);
-
- Provider sunPKCS11Provider = this.createSunPKCS11Provider(configStream);
- Security.addProvider(sunPKCS11Provider);
-
-// Eestas lineas se añadieron para poder hacer un logout del keystore
-//
-
- KeyStore.Builder ksBuilder = KeyStore.Builder.newInstance(
- "PKCS11",
- null,
- new KeyStore.CallbackHandlerProtection( new SimpleCallbackHandler(null,password ) )); //cmdLineHdlr
-
- KeyStore ks = ksBuilder.getKeyStore();
-//
-
- aprov = (AuthProvider) Security.getProvider( sunPKCS11Provider.getName() );
- aprov.setCallbackHandler( new SimpleCallbackHandler(null,password ) ); //cmdLineHdlr
-
- try {
- aprov.login(null, null);
- } catch (LoginException ex) {
- Logger.getLogger(LinuxKeyStoreProvider.class.getName()).log(Level.SEVERE, null, ex);
- throw new LoginException( /*ex*/ );
- }
-
-// KeyStore keyStore = KeyStore.getInstance("PKCS11");
-//
-// keyStore.load(null, password); //null
- System.out.println("Dentro LinuxKeystore anntes de ks:" + ks);
- // aprov.logout();
- return ks; //keyStore
-// } catch (CertificateException e) {
-// throw new KeyStoreException(e);
-// } catch (NoSuchAlgorithmException e) {
-// throw new KeyStoreException(e);
-// } catch (IOException e) {
-// throw new KeyStoreException(e);
-// }
- } catch (Exception e){
- System.out.println("Error en el keystore:" + e);
- e.printStackTrace();
- throw new KeyStoreException(e);
- }
- }
- /**
- * logout
- * Esta función permite limpiar de memoria el keystore.
- * @throws javax.security.auth.login.LoginException
- */
- public void logout() throws LoginException{
-
- this.aprov.logout();
- }
- /**
- * Instancia la clase sun.security.pkcs11.SunPKCS11
- * dinamicamente, usando Java Reflection.
- *
- * @return una instancia de sun.security.pkcs11.SunPKCS11
- */
- @SuppressWarnings("unchecked")
- private Provider createSunPKCS11Provider(InputStream configStream) throws KeyStoreException {
- try {
- Class sunPkcs11Class = Class.forName(SUN_PKCS11_PROVIDER_CLASS);
- Constructor pkcs11Constr = sunPkcs11Class.getConstructor(InputStream.class);
- Provider pkcs11Provider = (Provider) pkcs11Constr.newInstance(configStream);
-
- return pkcs11Provider;
- } catch (ClassNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchMethodException e) {
- throw new KeyStoreException(e);
- } catch (InvocationTargetException e) {
- throw new KeyStoreException(e);
- } catch (IllegalAccessException e) {
- throw new KeyStoreException(e);
- } catch (InstantiationException e) {
- throw new KeyStoreException(e);
- }
- }
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/MockKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/MockKeyStoreProvider.java.svn-base
deleted file mode 100644
index 4781c35..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/MockKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-
-/**
- * Implementacion de KeyStoreProvider para pruebas.
- *
- */
-public class MockKeyStoreProvider implements KeyStoreProvider {
-
- private static final String KEYSTORE_FILE = "/home/ricardo/ricardostore";
-
- // private static final String KEYSTORE_ALIAS = "firmadigital";
- // private static final char[] KEYSTORE_PASSWORD = "abc123".toCharArray();
- // private static final char[] KEY_PASSWORD = "ricardo".toCharArray();
-
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- KeyStore keyStore = KeyStore.getInstance("JKS");
- FileInputStream ksfis;
- ksfis = new FileInputStream(KEYSTORE_FILE);
- BufferedInputStream ksbufin = new BufferedInputStream(ksfis);
-
- keyStore.load(ksbufin, password);
- // PrivateKey priv = (PrivateKey) keyStore.getKey(KEYSTORE_ALIAS,
- // KEY_PASSWORD);
-
- return keyStore;
- } catch (FileNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (GeneralSecurityException e) {
- throw new KeyStoreException(e);
- } catch (IOException e) {
- throw new KeyStoreException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/PKCS11KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/PKCS11KeyStoreProvider.java.svn-base
deleted file mode 100644
index 6d17b14..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/PKCS11KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Provider;
-import java.security.Security;
-import java.security.cert.CertificateException;
-
-
-/**
- * Implementacion de KeyStoreProvider para utilizar con librerias
- * PKCS#11 del sistema operativo.
- *
- * Utiza OpenCT para acceder a un Token USB.
- *
- *
- */
-public abstract class PKCS11KeyStoreProvider implements KeyStoreProvider {
-
- /**
- * Obtiene la configuración para el Provider, según el sistema operativo que se utilice.
- *
- * @return
- */
- public abstract String getConfig();
-
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- InputStream configStream = new ByteArrayInputStream(getConfig().getBytes());
-
- Provider sunPKCS11Provider = this.createSunPKCS11Provider(configStream);
- Security.addProvider(sunPKCS11Provider);
-
- KeyStore keyStore = KeyStore.getInstance("PKCS11");
- keyStore.load(null, password);
-
- return keyStore;
- } catch (CertificateException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchAlgorithmException e) {
- throw new KeyStoreException(e);
- } catch (IOException e) {
- throw new KeyStoreException(e);
- }
- }
-
- /**
- * Instancia la clase sun.security.pkcs11.SunPKCS11
- * dinamicamente, usando Java Reflection.
- *
- * @return una instancia de sun.security.pkcs11.SunPKCS11
- */
- @SuppressWarnings("unchecked")
- private Provider createSunPKCS11Provider(InputStream configStream) throws KeyStoreException {
- try {
- Class sunPkcs11Class = Class.forName("sun.security.pkcs11.SunPKCS11");
- Constructor pkcs11Constr = sunPkcs11Class.getConstructor(InputStream.class);
- return (Provider) pkcs11Constr.newInstance(configStream);
- } catch (ClassNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchMethodException e) {
- throw new KeyStoreException(e);
- } catch (InvocationTargetException e) {
- throw new KeyStoreException(e);
- } catch (IllegalAccessException e) {
- throw new KeyStoreException(e);
- } catch (InstantiationException e) {
- throw new KeyStoreException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/SimpleCallbackHandler.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/SimpleCallbackHandler.java.svn-base
deleted file mode 100644
index 55ee16b..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/SimpleCallbackHandler.java.svn-base
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.fp.firma.keystore;
-
-/**
- *
- * @author subinfo
- */
-import javax.security.auth.callback.*;
-
-/**
- * This simple callback handler presents the given user name and password.
- * @version 1.0 2004-09-14
- * @author Cay Horstmann
- */
-public class SimpleCallbackHandler implements CallbackHandler
-{
- /**
- * Constructs the callback handler.
- * @param username the user name
- * @param password a character array containing the password
- */
- public SimpleCallbackHandler(String username, char[] password)
- {
- this.username = username;
- this.password = password;
- }
-
- public void handle(Callback[] callbacks)
- {
- for (Callback callback : callbacks)
- {
- if (callback instanceof NameCallback)
- {
- ((NameCallback) callback).setName(username);
- }
- else if (callback instanceof PasswordCallback)
- {
- ((PasswordCallback) callback).setPassword(password);
- }
- }
- }
-
- private String username;
- private char[] password;
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider.java.svn-base
deleted file mode 100644
index 344e2a8..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,129 +0,0 @@
-/** Programa para La firma electrónica de archivos
- * Desarrollado y Modificado por la Subsecretaría de Tecnologías de la Información
- * de la Secretaría Nacional de la Administración Pública del Ecuador
- * Firma Digital firmadigital.informatica.gob.ec
- *------------------------------------------------------------------------------
- * This program is free software: you can redistribute it and/or
-modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public
-License
- * along with this program. If not, see http://www.gnu.org/licenses. [^]
- *------------------------------------------------------------------------------
- **/
-package com.fp.firma.keystore;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.AuthProvider;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.Provider;
-import java.security.ProviderException;
-import java.security.Security;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.management.ReflectionException;
-import javax.security.auth.login.LoginException;
-
-/**
- * maneja el keystore de windows, no el CAPI, accede a travez de librerias, en esta se usa librerias para eTokenPro
- **/
-public class WindowsJDK5KeyStoreProvider implements KeyStoreProvider {
-
-
- //private static final byte[] PKCS11_CONFIG = "name = SmartCard\nlibrary = C:\\WINDOWS\\SYSTEM32\\DKCK201.DLL \ndisabledMechanisms = { CKM_SHA1_RSA_PKCS }".getBytes();
- private static String windowsDir = "name = SmartCard\nlibrary = " + System.getenv("WINDIR") + "\\SYSTEM32\\eTPKCS11.DLL \ndisabledMechanisms = { CKM_SHA1_RSA_PKCS } \n showInfo = true"; //showInfo = true
- private static final byte[] PKCS11_CONFIG = windowsDir.getBytes();
- private static final String SUN_PKCS11_PROVIDER_CLASS = "sun.security.pkcs11.SunPKCS11";
- private AuthProvider aprov;
-
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- System.out.println("Tiene PKCS11: " + PKCS11_CONFIG);
- InputStream configStream = new ByteArrayInputStream(PKCS11_CONFIG);
-
- Provider sunPKCS11Provider = this.createSunPKCS11Provider(configStream);
- Security.addProvider(sunPKCS11Provider);
-
- KeyStore.Builder ksBuilder = KeyStore.Builder.newInstance(
- "PKCS11",
- null,
- new KeyStore.CallbackHandlerProtection(new SimpleCallbackHandler(null, password))); //cmdLineHdlr
-
- KeyStore ks = ksBuilder.getKeyStore();
-
- aprov = (AuthProvider) Security.getProvider(sunPKCS11Provider.getName());
- aprov.setCallbackHandler(new SimpleCallbackHandler(null, password)); //cmdLineHdlr
-
- aprov.login(null, null);
-//
-
- return ks; //keyStore
-//
-
- } catch (LoginException ex) {
- Logger.getLogger(WindowsJDK5KeyStoreProvider.class.getName()).log(Level.SEVERE, null, ex);
- System.out.println("error en el loginExcep" + ex);
- } catch (KeyStoreException e) {
- System.out.println("e:" + e.getCause().toString().length());
- throw new KeyStoreException(e);
- }
-// catch (Exception e){
-// System.out.println("Error en el keystore:" + e.getCause().toString().length() );
-// throw new KeyStoreException( e.getMessage() ,e.getCause());
-// }
- return null;
- }
-
- /**
- * logout
- * Esta función permite limpiar de memoria el keystore.
- * @throws javax.security.auth.login.LoginException
- */
- public void logout() throws LoginException {
-
- this.aprov.logout();
- }
-
- /**
- * Instancia la clase sun.security.pkcs11.SunPKCS11
- * dinamicamente, usando Java Reflection.
- *
- * @return una instancia de sun.security.pkcs11.SunPKCS11
- */
- @SuppressWarnings("unchecked")
- private Provider createSunPKCS11Provider(InputStream configStream) throws ProviderException, KeyStoreException {
- try {
- Class sunPkcs11Class = Class.forName(SUN_PKCS11_PROVIDER_CLASS);
-
- Constructor pkcs11Constr = sunPkcs11Class.getConstructor(InputStream.class);
- Provider pkcs11Provider = (Provider) pkcs11Constr.newInstance(configStream);
-
- return pkcs11Provider;
-
- } catch (ClassNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchMethodException e) {
- throw new KeyStoreException(e);
- } catch (InvocationTargetException e) {
-
- throw new KeyStoreException(e.getMessage(), e.getCause());
- } catch (IllegalAccessException e) {
- throw new KeyStoreException(e);
- } catch (InstantiationException e) {
- throw new KeyStoreException(e);
- }
- }
-}
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider_SD.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider_SD.java.svn-base
deleted file mode 100644
index 6333abf..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider_SD.java.svn-base
+++ /dev/null
@@ -1,139 +0,0 @@
-/** Programa para La firma electrónica de archivos
-* Desarrollado y Modificado por la Subsecretaría de Tecnologías de la Información
-* de la Secretaría Nacional de la Administración Pública del Ecuador
-* Firma Digital firmadigital.informatica.gob.ec
-*------------------------------------------------------------------------------
-* This program is free software: you can redistribute it and/or
-modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-License
-* along with this program. If not, see http://www.gnu.org/licenses. [^]
-*------------------------------------------------------------------------------
-**/
-package com.fp.firma.keystore;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.AuthProvider;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.Provider;
-import java.security.Security;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.security.auth.login.LoginException;
-
-/**
- * Esta clase se usa para obtener el keystore (Con el se pueden obtener luego los certificados dentro del token) en Windows
- */
-public class WindowsJDK5KeyStoreProvider_SD implements KeyStoreProvider {
-
- //private static final byte[] PKCS11_CONFIG = "name = SmartCard\nlibrary = C:\\WINDOWS\\SYSTEM32\\DKCK201.DLL \ndisabledMechanisms = { CKM_SHA1_RSA_PKCS }".getBytes();
- // esta linea corrige el error de la ubicación de Windows
- // para trabajar con iKey
- private static final String windowsDir_SD = "name = ePass3003\nlibrary = C:\\WINDOWS\\SYSTEM32\\SecurityDataCsp11_3003.dll \ndisabledMechanisms = { CKM_SHA1_RSA_PKCS } \n\r showInfo = true";
- private static final byte[] PKCS11_CONFIG_SD = windowsDir_SD.getBytes();
- private static final String SUN_PKCS11_PROVIDER_CLASS = "sun.security.pkcs11.SunPKCS11";
- private AuthProvider aprov;
-
- /**
- * getKeystore
- * Esta funcion se utiliza para obtener el keystore de java para manejar luego la clave privada y los certificados dentro del token
- * @param password Se pasa la clave del token
- * @return
- * @throws java.security.KeyStoreException
- */
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- // empieza intentando con eToken
- InputStream configStream = new ByteArrayInputStream(PKCS11_CONFIG_SD);
-
- Provider sunPKCS11Provider = this.createSunPKCS11Provider(configStream);
- Security.addProvider(sunPKCS11Provider);
-
-
- KeyStore.Builder ksBuilder = KeyStore.Builder.newInstance(
- "PKCS11",
- null,
- new KeyStore.CallbackHandlerProtection(new SimpleCallbackHandler(null, password))); //cmdLineHdlr
-
- KeyStore ks = ksBuilder.getKeyStore();
-
- // Estas lineas se añadieron para controlar mejor el logout del token
- aprov = (AuthProvider) Security.getProvider(sunPKCS11Provider.getName());
- aprov.setCallbackHandler(new SimpleCallbackHandler(null, password)); //cmdLineHdlr
-
- try {
- aprov.login(null, null);
- } catch (LoginException ex) {
- Logger.getLogger(WindowsJDK5KeyStoreProvider_SD.class.getName()).log(Level.SEVERE, null, ex);
- throw new LoginException( /*ex*/);
- }
-
-
-
-
- return ks; //keyStore
- } catch (LoginException ex) {
- Logger.getLogger(WindowsJDK5KeyStoreProvider_SD.class.getName()).log(Level.SEVERE, null, ex);
- System.out.println("error en el loginExcep" + ex);
- } catch (KeyStoreException e) {
- System.out.println("e:" + e.getCause().toString().length());
- throw new KeyStoreException(e);
- }
-
-// } catch (Exception e){
-// System.out.println("Error en el keystore:" + e);
-// throw new KeyStoreException(e);
-// }
- return null;
- }
-
- /**
- * logout
- * Esta función permite limpiar de memoria el keystore.
- * @throws javax.security.auth.login.LoginException
- */
- public void logout() throws LoginException {
-
- this.aprov.logout();
- }
-
- /**
- * Instancia la clase sun.security.pkcs11.SunPKCS11
- * dinamicamente, usando Java Reflection.
- *
- * @return una instancia de sun.security.pkcs11.SunPKCS11
- */
- @SuppressWarnings("unchecked")
- private Provider createSunPKCS11Provider(InputStream configStream) throws KeyStoreException {
- try {
- Class sunPkcs11Class = Class.forName(SUN_PKCS11_PROVIDER_CLASS);
- Constructor pkcs11Constr = sunPkcs11Class.getConstructor(InputStream.class);
- Provider pkcs11Provider = (Provider) pkcs11Constr.newInstance(configStream);
-
- return pkcs11Provider;
- } catch (ClassNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchMethodException e) {
- throw new KeyStoreException(e);
- } catch (InvocationTargetException e) {
- throw new KeyStoreException(e);
- } catch (IllegalAccessException e) {
- throw new KeyStoreException(e);
- } catch (InstantiationException e) {
- throw new KeyStoreException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider_iKey.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider_iKey.java.svn-base
deleted file mode 100644
index fcf686f..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK5KeyStoreProvider_iKey.java.svn-base
+++ /dev/null
@@ -1,144 +0,0 @@
-/** Programa para La firma electrónica de archivos
-* Desarrollado y Modificado por la Subsecretaría de Tecnologías de la Información
-* de la Secretaría Nacional de la Administración Pública del Ecuador
-* Firma Digital firmadigital.informatica.gob.ec
-*------------------------------------------------------------------------------
-* This program is free software: you can redistribute it and/or
-modify
-* it under the terms of the GNU Affero General Public License as
-* published by the Free Software Foundation, either version 3 of the
-* License, or (at your option) any later version.
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Affero General Public License for more details.
-*
-* You should have received a copy of the GNU Affero General Public
-License
-* along with this program. If not, see http://www.gnu.org/licenses. [^]
-*------------------------------------------------------------------------------
-**/
-
-
-package com.fp.firma.keystore;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.security.AuthProvider;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.Provider;
-import java.security.Security;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.security.auth.login.LoginException;
-
-/**
- * Esta clase se usa para obtener el keystore (Con el se pueden obtener luego los certificados dentro del token iKEY) en Windows
- */
-public class WindowsJDK5KeyStoreProvider_iKey implements KeyStoreProvider {
-
-
-
- //private static final byte[] PKCS11_CONFIG = "name = SmartCard\nlibrary = C:\\WINDOWS\\SYSTEM32\\DKCK201.DLL \ndisabledMechanisms = { CKM_SHA1_RSA_PKCS }".getBytes();
- // esta linea corrige el error de la ubicación de Windows
- // para trabajar con iKey
- private static String windowsDir_iKey ="name = SmartCard\nlibrary = "+ System.getenv("WINDIR") + "\\SYSTEM32\\DKCK201.DLL \ndisabledMechanisms = { CKM_SHA1_RSA_PKCS } \n showInfo = true";
- private static final byte[] PKCS11_CONFIG_IKEY = windowsDir_iKey.getBytes();
-
-
- private static final String SUN_PKCS11_PROVIDER_CLASS = "sun.security.pkcs11.SunPKCS11";
- private AuthProvider aprov;
-
- /**
- * getKeystore
- * Esta funcion se utiliza para obtener el keystore de java para manejar luego la clave privada y los certificados dentro del token
- * @param password Se pasa la clave del token
- * @return
- * @throws java.security.KeyStoreException
- */
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- // empieza intentando con eToken
- InputStream configStream = new ByteArrayInputStream(PKCS11_CONFIG_IKEY);
-
- Provider sunPKCS11Provider = this.createSunPKCS11Provider(configStream);
- Security.addProvider(sunPKCS11Provider);
-
-
- KeyStore.Builder ksBuilder = KeyStore.Builder.newInstance(
- "PKCS11",
- null,
- new KeyStore.CallbackHandlerProtection( new SimpleCallbackHandler(null,password ) )); //cmdLineHdlr
-
- KeyStore ks = ksBuilder.getKeyStore();
-
- // Estas lineas se añadieron para controlar mejor el logout del token
- aprov = (AuthProvider) Security.getProvider( sunPKCS11Provider.getName() );
- aprov.setCallbackHandler( new SimpleCallbackHandler(null,password ) ); //cmdLineHdlr
-
- try {
- aprov.login(null, null);
- } catch (LoginException ex) {
- Logger.getLogger(WindowsJDK5KeyStoreProvider_iKey.class.getName()).log(Level.SEVERE, null, ex);
- throw new LoginException( /*ex*/ );
- }
-
-
-
-
- return ks; //keyStore
- }
- catch (LoginException ex) {
- Logger.getLogger(WindowsJDK5KeyStoreProvider_iKey.class.getName()).log(Level.SEVERE, null, ex);
- System.out.println("error en el loginExcep" + ex);
- } catch (KeyStoreException e) {
- System.out.println("e:"+ e.getCause().toString().length() );
- throw new KeyStoreException(e);
- }
-
-// } catch (Exception e){
-// System.out.println("Error en el keystore:" + e);
-// throw new KeyStoreException(e);
-// }
- return null;
- }
- /**
- * logout
- * Esta función permite limpiar de memoria el keystore.
- * @throws javax.security.auth.login.LoginException
- */
- public void logout() throws LoginException{
-
- this.aprov.logout();
- }
- /**
- * Instancia la clase sun.security.pkcs11.SunPKCS11
- * dinamicamente, usando Java Reflection.
- *
- * @return una instancia de sun.security.pkcs11.SunPKCS11
- */
- @SuppressWarnings("unchecked")
- private Provider createSunPKCS11Provider(InputStream configStream) throws KeyStoreException {
- try {
- Class sunPkcs11Class = Class.forName(SUN_PKCS11_PROVIDER_CLASS);
- Constructor pkcs11Constr = sunPkcs11Class.getConstructor(InputStream.class);
- Provider pkcs11Provider = (Provider) pkcs11Constr.newInstance(configStream);
-
- return pkcs11Provider;
- } catch (ClassNotFoundException e) {
- throw new KeyStoreException(e);
- } catch (NoSuchMethodException e) {
- throw new KeyStoreException(e);
- } catch (InvocationTargetException e) {
- throw new KeyStoreException(e);
- } catch (IllegalAccessException e) {
- throw new KeyStoreException(e);
- } catch (InstantiationException e) {
- throw new KeyStoreException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK6KeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK6KeyStoreProvider.java.svn-base
deleted file mode 100644
index 5dfb66f..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsJDK6KeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-
-import com.fp.firma.common.FirmasException;
-
-/**
- * Implementación de KeyStoreProvider para acceder al keystore del sistema operativo
- * Microsoft Windows.
- *
- * Utiliza funcionalidad disponible desde el JDK6 en adelante para acceder al MS CAPI.
- *
- */
-public class WindowsJDK6KeyStoreProvider implements KeyStoreProvider {
-
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- KeyStore keyStore = KeyStore.getInstance("Windows-MY");
- keyStore.load(null, password);
- return keyStore;
- } catch (NoSuchAlgorithmException e) {
- throw new KeyStoreException(e);
- } catch (CertificateException e) {
- throw new KeyStoreException(e);
- } catch (IOException e) {
- if(e.getCause() instanceof UnrecoverableKeyException){
- throw new FirmasException(e);
- } else{
- throw new KeyStoreException(e);
- }
- } catch (Throwable e) {
- if ((e instanceof UnrecoverableKeyException)) {
- throw new FirmasException(e);
- } else{
- throw new KeyStoreException(e);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsKeyStoreProvider.java.svn-base b/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsKeyStoreProvider.java.svn-base
deleted file mode 100644
index a704f9f..0000000
--- a/appletFirma/src/main/java/com/fp/firma/keystore/.svn/text-base/WindowsKeyStoreProvider.java.svn-base
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2009 Libreria para Firma Digital development team.
- *
- * This library 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 (at your option) any later version.
- */
-
-package com.fp.firma.keystore;
-
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateException;
-
-/**
- * Implementacion de KeyStoreProvider para acceder al keystore del sistema operativo
- * Microsoft Windows.
- *
- * Utiliza funcionalidad disponible desde el JDK6 en adelante para acceder al MS CAPI.
- *
- */
-public class WindowsKeyStoreProvider implements KeyStoreProvider {
-
- private static final String MICROSOFT_WINDOWS_PROVIDER_TYPE = "Windows-MY";
-
- @Override
- public KeyStore getKeystore(char[] password) throws KeyStoreException {
- try {
- KeyStore keyStore = KeyStore.getInstance(MICROSOFT_WINDOWS_PROVIDER_TYPE);
- keyStore.load(null, password);
- return keyStore;
- } catch (NoSuchAlgorithmException e) {
- throw new KeyStoreException(e);
- } catch (CertificateException e) {
- throw new KeyStoreException(e);
- } catch (IOException e) {
- throw new KeyStoreException(e);
- }
- }
-}
\ No newline at end of file
diff --git a/appletFirma/src/main/resources/.svn/entries b/appletFirma/src/main/resources/.svn/entries
deleted file mode 100644
index 3aaa452..0000000
--- a/appletFirma/src/main/resources/.svn/entries
+++ /dev/null
@@ -1,62 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/main/resources
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-firmessages_es.properties
-file
-
-
-
-
-2022-07-28T03:40:24.020722Z
-3474bb130f9466563b3dd13b5fbb1efb
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2185
-
diff --git a/appletFirma/src/main/resources/.svn/prop-base/firmessages_es.properties.svn-base b/appletFirma/src/main/resources/.svn/prop-base/firmessages_es.properties.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/main/resources/.svn/prop-base/firmessages_es.properties.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/main/resources/.svn/text-base/firmessages_es.properties.svn-base b/appletFirma/src/main/resources/.svn/text-base/firmessages_es.properties.svn-base
deleted file mode 100644
index 2882ef5..0000000
--- a/appletFirma/src/main/resources/.svn/text-base/firmessages_es.properties.svn-base
+++ /dev/null
@@ -1,48 +0,0 @@
-###################################################
-##### S\u00edmbolos unicode
-#####\u00e1 ->
-#####\u00e9 ->
-#####\u00ed ->
-#####\u00f3 ->
-#####\u00fa ->
-#####\u00c1 ->
-#####\u00c9 ->
-#####\u00cd ->
-#####\u00d3 ->
-#####\u00da ->
-#####\u00f1 ->
-#####\u00d1 ->
-#####\u0020 -> Espacio en blanco
-###################################################
-
-#========================================================================================
-#=======CODIGO EXCEPCIONES===============================================================
-#========================================================================================
-FIR-0001=ERROR AL ESTABLECER CONEXI\u00D3N AL SERVICIO\: {0}
-FIR-0002=ERROR, CERTIFICADO REVOCADO POR {0} CON FECHA {1}
-FIR-0005=ERROR, ES OBLIGATORIO CARGAR UN ARCHIVO
-FIR-0006=ERROR, LA CONTRASE\u00d1A INGRESADA ES INCORRECTA
-FIR-0007=ERROR, EL CAMPO PASSWORD ES OBLIGATORIO
-#========================================================================================
-#=======OIDs GENERALES DE IDENTIFICACION DEL USUARIO EN EL CERTIFICADO===================
-#========================================================================================
-oid.cedula_pasaporte=1.3.6.1.4.1.37947.3.1
-oid.nombres_persona=1.3.6.1.4.1.37947.3.2
-oid.apellido_persona1=1.3.6.1.4.1.37947.3.3
-oid.apellido_persona2=1.3.6.1.4.1.37947.3.4
-oid.cargo=1.3.6.1.4.1.37947.3.5
-oid.institucion=1.3.6.1.4.1.37947.3.6
-oid.direccion=1.3.6.1.4.1.37947.3.7
-oid.telefono=1.3.6.1.4.1.37947.3.8
-oid.ciudad=1.3.6.1.4.1.37947.3.9
-oid.razon_social=1.3.6.1.4.1.37947.3.10
-oid.ruc=1.3.6.1.4.1.37947.3.11
-#========================================================================================
-#=======RUTAS DE LOS DIRECTORIOS DEL REPOSITORIO DE CERTIFICADOS=========================
-#========================================================================================
-dir.ruta.base.repositorio=/media/store/maia/jboss-eap-6.0/digital_repository
-dir.nombre.carpeta.usuarios=users
-nombre.certificado.raiz=CARAIZ.cer
-nombre.certificado.subordinado=CASUBORDINADO.cer
-service.url.address.ocsp=http://ocsp.digsigtrust.com:80
-#service.url.address.ocsp=http://ocsp.openvalidation.org:80
\ No newline at end of file
diff --git a/appletFirma/src/test/.svn/entries b/appletFirma/src/test/.svn/entries
deleted file mode 100644
index 5675703..0000000
--- a/appletFirma/src/test/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/test
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-java
-dir
-
diff --git a/appletFirma/src/test/java/.svn/entries b/appletFirma/src/test/java/.svn/entries
deleted file mode 100644
index 13a7e41..0000000
--- a/appletFirma/src/test/java/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/test/java
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-com
-dir
-
diff --git a/appletFirma/src/test/java/com/.svn/entries b/appletFirma/src/test/java/com/.svn/entries
deleted file mode 100644
index 1e1d802..0000000
--- a/appletFirma/src/test/java/com/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/test/java/com
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-fp
-dir
-
diff --git a/appletFirma/src/test/java/com/fp/.svn/entries b/appletFirma/src/test/java/com/fp/.svn/entries
deleted file mode 100644
index 0111b38..0000000
--- a/appletFirma/src/test/java/com/fp/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/test/java/com/fp
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-firma
-dir
-
diff --git a/appletFirma/src/test/java/com/fp/firma/.svn/entries b/appletFirma/src/test/java/com/fp/firma/.svn/entries
deleted file mode 100644
index 44cdf31..0000000
--- a/appletFirma/src/test/java/com/fp/firma/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/test/java/com/fp/firma
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-applet
-dir
-
diff --git a/appletFirma/src/test/java/com/fp/firma/applet/.svn/entries b/appletFirma/src/test/java/com/fp/firma/applet/.svn/entries
deleted file mode 100644
index 95f9e75..0000000
--- a/appletFirma/src/test/java/com/fp/firma/applet/.svn/entries
+++ /dev/null
@@ -1,96 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/appletFirma/src/test/java/com/fp/firma/applet
-svn://172.17.26.185/COMACO
-
-
-
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-AppTest.java
-file
-
-
-
-
-2022-07-28T03:40:23.474720Z
-344982b9ae13a54e1ca56bbb62751f55
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-647
-
-PruebaFirma.java
-file
-
-
-
-
-2022-07-28T03:40:23.474720Z
-16809319f5505f378ce18fb335a59914
-2014-12-31T05:22:02.287651Z
-3703
-dcruz
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1324
-
diff --git a/appletFirma/src/test/java/com/fp/firma/applet/.svn/prop-base/AppTest.java.svn-base b/appletFirma/src/test/java/com/fp/firma/applet/.svn/prop-base/AppTest.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/test/java/com/fp/firma/applet/.svn/prop-base/AppTest.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/test/java/com/fp/firma/applet/.svn/prop-base/PruebaFirma.java.svn-base b/appletFirma/src/test/java/com/fp/firma/applet/.svn/prop-base/PruebaFirma.java.svn-base
deleted file mode 100644
index 085986a..0000000
--- a/appletFirma/src/test/java/com/fp/firma/applet/.svn/prop-base/PruebaFirma.java.svn-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-K 13
-svn:mime-type
-V 10
-text/plain
-END
diff --git a/appletFirma/src/test/java/com/fp/firma/applet/.svn/text-base/AppTest.java.svn-base b/appletFirma/src/test/java/com/fp/firma/applet/.svn/text-base/AppTest.java.svn-base
deleted file mode 100644
index 413c140..0000000
--- a/appletFirma/src/test/java/com/fp/firma/applet/.svn/text-base/AppTest.java.svn-base
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.fp.firma.applet;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public AppTest( String testName )
- {
- super( testName );
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite( AppTest.class );
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testApp()
- {
- assertTrue( true );
- }
-}
diff --git a/appletFirma/src/test/java/com/fp/firma/applet/.svn/text-base/PruebaFirma.java.svn-base b/appletFirma/src/test/java/com/fp/firma/applet/.svn/text-base/PruebaFirma.java.svn-base
deleted file mode 100644
index 8948a9d..0000000
--- a/appletFirma/src/test/java/com/fp/firma/applet/.svn/text-base/PruebaFirma.java.svn-base
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.fp.firma.applet;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-
-import com.fp.firma.common.CertificateUtils;
-import com.itextpdf.text.Rectangle;
-
-/**
- *
- * @author dcruz
- */
-public class PruebaFirma {
-
-// @Test
- public static void main(String[] args){
- try {
- InputStream is = new FileInputStream("C:\\Users\\abenalcazar\\dwhelper\\Downloads\\Tutorial_de_Maven_3_Erick_Camacho.pdf");
- String password = "Password#1";
- byte[] array = CertificateUtils.sign(is, null, password, "Firmado digitalmente", "Por firmar", Boolean.FALSE, Boolean.FALSE, new Rectangle(50, 50, 200, 200), 1, "Firma 2", "2");
- is.close();
- System.out.println("Tam array "+ array != null ? array.length:0);
- FileOutputStream os = new FileOutputStream("C:\\Users\\abenalcazar\\dwhelper\\Downloads\\Tutorial_de_Maven_3_Erick_Camacho.pdf");
- os.write(array);
- os.flush();
- os.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (Throwable e){
- e.printStackTrace();
- }
- }
-}
diff --git a/appletFirma/target/classes/.netbeans_automatic_build b/appletFirma/target/classes/.netbeans_automatic_build
deleted file mode 100644
index e69de29..0000000
diff --git a/appletFirma/target/test-classes/.netbeans_automatic_build b/appletFirma/target/test-classes/.netbeans_automatic_build
deleted file mode 100644
index e69de29..0000000
diff --git a/base/.svn/entries b/base/.svn/entries
deleted file mode 100644
index a51fa9e..0000000
--- a/base/.svn/entries
+++ /dev/null
@@ -1,86 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:46:02.772606Z
-4667
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-facadeclient
-dir
-
-facade
-dir
-
-persistence
-dir
-
-dto
-dir
-
-core
-dir
-
-pom.xml
-file
-
-
-
-
-2022-07-28T03:40:46.966821Z
-c232a48b461cc67137386d7589ab9a3e
-2014-09-11T06:04:01.437037Z
-655
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2675
-
-business
-dir
-
-sessionbeans
-dir
-
-bpm
-dir
-
diff --git a/base/.svn/text-base/pom.xml.svn-base b/base/.svn/text-base/pom.xml.svn-base
deleted file mode 100644
index b8baae0..0000000
--- a/base/.svn/text-base/pom.xml.svn-base
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
- FlipBean
- com.fp
- 2.1
-
- 4.0.0
- com.fp
- base
- Base
- 2.1
- pom
-
- 6.1.0.Final
- 6.1.0.Final
- ISO-8859-1
-
-
- dto
- bpm
- persistence
- core
- business
- facadeclient
- facade
- sessionbeans
-
-
-
-
-
-
-
- org.drools
- drools-bom
- pom
- ${drools.version}
- import
-
-
-
-
- org.jbpm
- jbpm-bom
- pom
- ${jbpm.version}
- import
-
-
-
-
- org.apache.poi
- poi
- 3.5-FINAL
- jar
- provided
-
-
- org.apache.poi
- poi-ooxml-schemas
- 3.6
- jar
- provided
-
-
- org.apache.poi
- poi-ooxml
- 3.5-FINAL
- jar
- provided
-
-
- org.apache.poi
- ooxml-schemas
- 1.0
- jar
- provided
-
-
-
-
diff --git a/base/bpm/.svn/entries b/base/bpm/.svn/entries
deleted file mode 100644
index c195e79..0000000
--- a/base/bpm/.svn/entries
+++ /dev/null
@@ -1,71 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-bpmlib
-dir
-
-simple
-dir
-
-flows
-dir
-
-pom.xml
-file
-
-
-
-
-2022-07-28T03:40:46.961821Z
-4ba706af7eab765adb2a4e82b23f5687
-2014-09-11T06:03:34.339088Z
-654
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-714
-
diff --git a/base/bpm/.svn/text-base/pom.xml.svn-base b/base/bpm/.svn/text-base/pom.xml.svn-base
deleted file mode 100644
index 2537b32..0000000
--- a/base/bpm/.svn/text-base/pom.xml.svn-base
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- base
- com.fp
- 2.1
-
- 4.0.0
- com.fp.base
- bpm
- bpm-jbpm
- 2.1
- pom
- BPM
-
- bpmlib
- simple
-
-
diff --git a/base/bpm/bpmlib/.svn/dir-prop-base b/base/bpm/bpmlib/.svn/dir-prop-base
deleted file mode 100644
index 3e2a6f2..0000000
--- a/base/bpm/bpmlib/.svn/dir-prop-base
+++ /dev/null
@@ -1,9 +0,0 @@
-K 10
-svn:ignore
-V 37
-.classpath
-.project
-.settings
-target
-
-END
diff --git a/base/bpm/bpmlib/.svn/entries b/base/bpm/bpmlib/.svn/entries
deleted file mode 100644
index dde369d..0000000
--- a/base/bpm/bpmlib/.svn/entries
+++ /dev/null
@@ -1,65 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-src
-dir
-
-pom.xml
-file
-
-
-
-
-2022-07-28T03:40:46.310818Z
-b77a781c02f2ae6238c01d704b9fbfb4
-2014-09-11T06:03:34.339088Z
-654
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3609
-
diff --git a/base/bpm/bpmlib/.svn/text-base/pom.xml.netbeans-base b/base/bpm/bpmlib/.svn/text-base/pom.xml.netbeans-base
deleted file mode 100644
index 7483e5f..0000000
--- a/base/bpm/bpmlib/.svn/text-base/pom.xml.netbeans-base
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
- bpm
- com.fp.base
- 2.1
-
- 4.0.0
- com.fp.base.bpm
- bpmlib
- fp Platform - BPMLib
-
-
- org.jboss.spec.javax.ejb
- jboss-ejb-api_3.1_spec
- provided
-
-
- com.fp.base.dto
- dto
- ${project.version}
- compile
-
-
- com.fp.base.dto
- common
- ${project.version}
- compile
-
-
- com.fp.base.persistence
- pbpm
- ${project.version}
- compile
-
-
- com.fp.base.persistence
- pgeneral
- ${project.version}
- compile
-
-
- com.fp.base.persistence
- util
- ${project.version}
- compile
-
-
- com.fp.base.bpm
- simple
- ${project.version}
-
-
- com.fp.base.core
- bpm
- ${project.version}
-
-
- org.hibernate
- hibernate-entitymanager
-
-
-
-
- org.jbpm
- jbpm-flow
- provided
-
-
- org.jbpm
- jbpm-flow-builder
- provided
-
-
- org.jbpm
- jbpm-bpmn2
- provided
-
-
- org.jbpm
- jbpm-persistence-jpa
- provided
-
-
- org.jbpm
- jbpm-human-task-core
- provided
-
-
- org.jbpm
- jbpm-runtime-manager
- provided
-
-
-
- org.kie
- kie-api
- provided
-
-
- org.drools
- drools-decisiontables
- provided
-
-
- org.jbpm
- jbpm-kie-services
- provided
-
-
-
- org.jboss.netty
- netty
-
-
-
-
-
-
-
diff --git a/base/bpm/bpmlib/.svn/text-base/pom.xml.svn-base b/base/bpm/bpmlib/.svn/text-base/pom.xml.svn-base
deleted file mode 100644
index 7483e5f..0000000
--- a/base/bpm/bpmlib/.svn/text-base/pom.xml.svn-base
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
- bpm
- com.fp.base
- 2.1
-
- 4.0.0
- com.fp.base.bpm
- bpmlib
- fp Platform - BPMLib
-
-
- org.jboss.spec.javax.ejb
- jboss-ejb-api_3.1_spec
- provided
-
-
- com.fp.base.dto
- dto
- ${project.version}
- compile
-
-
- com.fp.base.dto
- common
- ${project.version}
- compile
-
-
- com.fp.base.persistence
- pbpm
- ${project.version}
- compile
-
-
- com.fp.base.persistence
- pgeneral
- ${project.version}
- compile
-
-
- com.fp.base.persistence
- util
- ${project.version}
- compile
-
-
- com.fp.base.bpm
- simple
- ${project.version}
-
-
- com.fp.base.core
- bpm
- ${project.version}
-
-
- org.hibernate
- hibernate-entitymanager
-
-
-
-
- org.jbpm
- jbpm-flow
- provided
-
-
- org.jbpm
- jbpm-flow-builder
- provided
-
-
- org.jbpm
- jbpm-bpmn2
- provided
-
-
- org.jbpm
- jbpm-persistence-jpa
- provided
-
-
- org.jbpm
- jbpm-human-task-core
- provided
-
-
- org.jbpm
- jbpm-runtime-manager
- provided
-
-
-
- org.kie
- kie-api
- provided
-
-
- org.drools
- drools-decisiontables
- provided
-
-
- org.jbpm
- jbpm-kie-services
- provided
-
-
-
- org.jboss.netty
- netty
-
-
-
-
-
-
-
diff --git a/base/bpm/bpmlib/src/.svn/entries b/base/bpm/bpmlib/src/.svn/entries
deleted file mode 100644
index 8415b0c..0000000
--- a/base/bpm/bpmlib/src/.svn/entries
+++ /dev/null
@@ -1,34 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-test
-dir
-
-main
-dir
-
diff --git a/base/bpm/bpmlib/src/main/.svn/entries b/base/bpm/bpmlib/src/main/.svn/entries
deleted file mode 100644
index 8ad2f32..0000000
--- a/base/bpm/bpmlib/src/main/.svn/entries
+++ /dev/null
@@ -1,37 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src/main
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-java
-dir
-
-config
-dir
-
-resources
-dir
-
diff --git a/base/bpm/bpmlib/src/main/config/.svn/entries b/base/bpm/bpmlib/src/main/config/.svn/entries
deleted file mode 100644
index 08a7e20..0000000
--- a/base/bpm/bpmlib/src/main/config/.svn/entries
+++ /dev/null
@@ -1,130 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src/main/config
-svn://172.17.26.185/COMACO
-
-
-
-2014-09-11T06:03:34.339088Z
-654
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-jbpm-ds.xml
-file
-
-
-
-
-2022-07-28T03:40:46.021817Z
-5f160b7b0a250b4b599c12e7ca877dbe
-2014-09-11T06:03:34.339088Z
-654
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1258
-
-jbpm-mysql-ds.xml
-file
-
-
-
-
-2022-07-28T03:40:46.021817Z
-744ffdbece303ec631e545dad9807a29
-2014-09-11T06:03:34.339088Z
-654
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2311
-
-jbpm-oracle-ds.xml
-file
-
-
-
-
-2022-07-28T03:40:46.021817Z
-d3b034ac33bcf0281efb4f60c7167e12
-2014-09-11T06:03:34.339088Z
-654
-jvaca
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1304
-
diff --git a/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-ds.xml.svn-base b/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-ds.xml.svn-base
deleted file mode 100644
index 1890541..0000000
--- a/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-ds.xml.svn-base
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
- jdbc/JBPM
- false
- jdbc:mysql://localhost:3306/jbpm
- com.mysql.jdbc.Driver
- root
-
- 5
- 20
- 80
- 0
-
- MySql
-
-
-
- jdbc/TASKS
- false
- jdbc:mysql://localhost:3306/jbpm
- com.mysql.jdbc.Driver
- root
-
- 5
- 20
- 80
- 0
-
- MySql
-
-
-
diff --git a/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-mysql-ds.xml.svn-base b/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-mysql-ds.xml.svn-base
deleted file mode 100644
index be62980..0000000
--- a/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-mysql-ds.xml.svn-base
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
- jdbc/JBPM
- jdbc:mysql://localhost:3306/jbpm?autoReconnect=true&autoReconnectForPools=true
- com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
- root
-
- org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
- org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker
- 50
- 200
- 10
-
- mySQL
-
-
-
- jdbc/TASKS
- false
- jdbc:mysql://localhost:3306/jbpm?autoReconnect=true&autoReconnectForPools=true
- com.mysql.jdbc.Driver
- root
-
- 50
- 200
- 80
- 0
-
- MySql
-
-
-
diff --git a/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-oracle-ds.xml.svn-base b/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-oracle-ds.xml.svn-base
deleted file mode 100644
index de02e6b..0000000
--- a/base/bpm/bpmlib/src/main/config/.svn/text-base/jbpm-oracle-ds.xml.svn-base
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
- jdbc/JBPM
- false
- jdbc:oracle:thin:@192.168.2.201:1521:maia
- oracle.jdbc.driver.OracleDriver
- jbpm5
- jbpm5
- 5
- 20
- 80
- 0
-
- Oracle
-
-
-
- jdbc/TASKS
- false
- jdbc:oracle:thin:@192.168.2.201:1521:maia
- oracle.jdbc.driver.OracleDriver
- jbpm5
- jbpm5
- 5
- 20
- 80
- 0
-
- Oracle
-
-
-
diff --git a/base/bpm/bpmlib/src/main/java/.svn/entries b/base/bpm/bpmlib/src/main/java/.svn/entries
deleted file mode 100644
index 7698b44..0000000
--- a/base/bpm/bpmlib/src/main/java/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src/main/java
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-com
-dir
-
diff --git a/base/bpm/bpmlib/src/main/java/com/.svn/entries b/base/bpm/bpmlib/src/main/java/com/.svn/entries
deleted file mode 100644
index 6bd7efe..0000000
--- a/base/bpm/bpmlib/src/main/java/com/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src/main/java/com
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-fp
-dir
-
diff --git a/base/bpm/bpmlib/src/main/java/com/fp/.svn/entries b/base/bpm/bpmlib/src/main/java/com/fp/.svn/entries
deleted file mode 100644
index 99f25af..0000000
--- a/base/bpm/bpmlib/src/main/java/com/fp/.svn/entries
+++ /dev/null
@@ -1,31 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src/main/java/com/fp
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-bpmlib
-dir
-
diff --git a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/entries b/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/entries
deleted file mode 100644
index d2e9c56..0000000
--- a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/entries
+++ /dev/null
@@ -1,262 +0,0 @@
-10
-
-dir
-4669
-svn://172.17.26.185/COMACO/sources/base/bpm/bpmlib/src/main/java/com/fp/bpmlib
-svn://172.17.26.185/COMACO
-
-
-
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-a11ad980-3ca8-45f0-88f7-f0e618c262b7
-
-metadata
-dir
-
-mail
-dir
-
-transaction
-dir
-
-db
-dir
-
-RegisterFlow.java
-file
-
-
-
-
-2022-07-28T03:40:45.983817Z
-e594d7732885e47395fdf9493697fdaf
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1607
-
-ProcessUtil.java
-file
-
-
-
-
-2022-07-28T03:40:45.983817Z
-84995a2be386c1530f5989305d3fcaaf
-2015-08-05T10:41:30.517767Z
-4258
-cpiedra
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-8949
-
-Flujo.java
-file
-
-
-
-
-2022-07-28T03:40:45.983817Z
-200a41c049d9ffe84522bc5c199dfd34
-2014-12-16T10:20:52.870795Z
-3535
-gbenavides
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4829
-
-ejb
-dir
-
-task
-dir
-
-package-info.java
-file
-
-
-
-
-2022-07-28T03:40:45.984817Z
-f48f5318cf41acb2aae161b000af3cf3
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-83
-
-query
-dir
-
-CustomSystemEventListener.java
-file
-
-
-
-
-2022-07-28T03:40:45.984817Z
-e4c80e2dbef16d1ad1e188d1edbeaaa0
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2563
-
-messages
-dir
-
-flow
-dir
-
-Common.java
-file
-
-
-
-
-2022-07-28T03:40:45.984817Z
-f09b36d41faf47cdfdb440498aa7d5fe
-2022-04-19T02:35:58.553023Z
-4666
-usermaia1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-972
-
-report
-dir
-
diff --git a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/Common.java.svn-base b/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/Common.java.svn-base
deleted file mode 100644
index 566b1ff..0000000
--- a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/Common.java.svn-base
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- */
-package com.fp.bpmlib;
-
-import java.util.Date;
-
-// TODO: Auto-generated Javadoc
-/**
- * Class Common encargada de.
- *
- * @author gfiallos
- */
-public final class Common {
-
- /** El valor de instance. */
- private static Common instance = null;
-
- /**
- * Obtiene la única instancia de Common.
- *
- * @return única instancia de Common
- */
- public static Common getInstance() {
- synchronized (Common.class) {
- if (Common.instance == null) {
- Common.instance = new Common();
- }
- return Common.instance;
- }
- }
-
- /**
- * Crea una nueva instancia de common.
- */
- private Common() {
- }
-
- /**
- * Obtiene el valor de current date.
- *
- * @return Valor de current date
- * @throws Exception la exception
- */
- public Date getCurrentDate() throws Exception {
- return new Date();
- }
-}
diff --git a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/CustomSystemEventListener.java.svn-base b/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/CustomSystemEventListener.java.svn-base
deleted file mode 100644
index 820ae64..0000000
--- a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/CustomSystemEventListener.java.svn-base
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- */
-package com.fp.bpmlib;
-
-import org.apache.log4j.Logger;
-
-// TODO: Auto-generated Javadoc
-
-/**
- * The listener interface for receiving customSystemEvent events. The class that is interested in processing a
- * customSystemEvent event implements this interface, and the object created with that class is registered with a
- * component using the component's addCustomSystemEventListener method. When
- * the customSystemEvent event occurs, that object's appropriate
- * method is invoked.
- *
- */
-public class CustomSystemEventListener implements org.kie.internal.SystemEventListener {
-
- /** Constante LOG. */
- private static final Logger LOG = Logger.getLogger(CustomSystemEventListener.class);
-
- /**
- * Debug.
- *
- * @param message the message
- */
- @Override
- public void debug(String message) {
- CustomSystemEventListener.LOG.debug(message);
-
- }
-
- /**
- * Debug.
- *
- * @param message the message
- * @param object the object
- */
- @Override
- public void debug(String message, Object object) {
- CustomSystemEventListener.LOG.debug(message + " " + object);
-
- }
-
- /**
- * Exception.
- *
- * @param message the message
- * @param e the e
- */
- @Override
- public void exception(String message, Throwable e) {
- CustomSystemEventListener.LOG.error(message, e);
-
- }
-
- /**
- * Exception.
- *
- * @param e the e
- */
- @Override
- public void exception(Throwable e) {
- CustomSystemEventListener.LOG.error(e, e);
-
- }
-
- /**
- * Info.
- *
- * @param message the message
- */
- @Override
- public void info(String message) {
- CustomSystemEventListener.LOG.info(message);
-
- }
-
- /**
- * Info.
- *
- * @param message the message
- * @param object the object
- */
- @Override
- public void info(String message, Object object) {
- CustomSystemEventListener.LOG.info(message + " " + object);
-
- }
-
- /**
- * Warning.
- *
- * @param message the message
- */
- @Override
- public void warning(String message) {
- CustomSystemEventListener.LOG.warn(message);
-
- }
-
- /**
- * Warning.
- *
- * @param message the message
- * @param object the object
- */
- @Override
- public void warning(String message, Object object) {
- CustomSystemEventListener.LOG.warn(message + " " + object);
-
- }
-
-}
diff --git a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/Flujo.java.svn-base b/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/Flujo.java.svn-base
deleted file mode 100644
index 9bec368..0000000
--- a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/Flujo.java.svn-base
+++ /dev/null
@@ -1,137 +0,0 @@
-package com.fp.bpmlib;
-
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import javax.naming.InitialContext;
-
-import org.jbpm.process.instance.event.listeners.TriggerRulesEventListener;
-import org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener;
-import org.jbpm.services.task.lifecycle.listeners.TaskLifeCycleEventListener;
-import org.kie.api.runtime.KieSession;
-import org.kie.api.runtime.manager.RuntimeEngine;
-import org.kie.api.runtime.manager.RuntimeManager;
-import org.kie.api.runtime.process.ProcessInstance;
-import org.kie.api.task.TaskService;
-import org.kie.internal.task.api.EventService;
-
-import com.fp.base.persistence.util.helper.MessageManager;
-import com.fp.bpmlib.ejb.local.JbpmBeanLocal;
-import com.fp.bpmlib.task.MaiaWorkItemHandler;
-import com.fp.common.logger.APPLogger;
-import com.fp.dto.Request;
-import com.fp.dto.save.SaveRequest;
-import com.fp.simple.flow.DataMap;
-
-/**
- * Class encargada del inicio de un flujo de trabajo.
- *
- * @author jvaca
- * @version 2.1
- */
-public class Flujo {
-
- private KieSession kiesession;
- private ProcessInstance processInstance = null;
- private TaskService taskService;
- /**
- * Crea una instancia de flujo.
- */
- public Flujo() throws Exception{
- JbpmBeanLocal local = (JbpmBeanLocal) new InitialContext().lookup("java:global/maiaear-2.1/bpmlib/jbpmbean");
- RuntimeManager manager = local.getRuntimeManager();
- RuntimeEngine runtime = manager.getRuntimeEngine(null);
- taskService = runtime.getTaskService();
- kiesession = runtime.getKieSession();
- kiesession.addEventListener(new TriggerRulesEventListener(kiesession));
- kiesession.getWorkItemManager().registerWorkItemHandler("Human Task", new MaiaWorkItemHandler());
- this.addListeners(runtime);
- }
-
- /**
- * Crea una instancia de flujo y obtiene una instancia del proceso.
- * @param processid Id de una instancia de proceso.
- * @throws Exception
- */
- public Flujo(Long processid) throws Exception {
- this();
- processInstance = kiesession.getProcessInstance(processid);
- }
-
- /**
- * Adiciona listener, para el manejo del bam de tareas.
- * @param engine
- */
- @SuppressWarnings("unchecked")
- private void addListeners(RuntimeEngine engine) {
- EventService eventService = (EventService) engine.getTaskService();
- boolean hasBamEventListener = false;
- for (TaskLifeCycleEventListener listener : eventService.getTaskEventListeners()) {
- if (listener instanceof BAMTaskEventListener) {
- hasBamEventListener = true;
- break;
- }
- }
- if (!hasBamEventListener) {
- BAMTaskEventListener bamTaskEventListener = new BAMTaskEventListener();
- eventService.registerTaskEventListener(bamTaskEventListener);
- }
- }
-
- /**
- * Inicia la ejecucion de un flujo de trabajo.
- * @param flujo Id del flujo se toma del archivo.jbpm
- * @param parametros Parametros con los que inicia la ejeccion de un flujo.
- * @throws Exception
- */
- public Long iniciar(String idproceso, Request request) throws Exception {
- APPLogger.getLogger().info("Prepara Flujo");
- //Se crea un nuevo request para grabar en el bpm la minima informacion.
- SaveRequest sr = new SaveRequest();
- sr.setJsf(true);
- request.copy(sr);
- request.copyMapValuesWithOutSaveBean(sr);
- sr.mbeans.clear();
- sr.remove("MSAVE");
- sr.remove("MQUERY");
- sr.remove("lOrderPersistentBeans");
- sr.setResponse(null);
-
-
- Map m = new HashMap();
- m.put(ProcessUtil.TASKS_METADATA, new LinkedHashMap());
- Map data = new DataMap();
- // Map data = new HashMap<>();
- if ((sr.getSubject() == null) || (sr.getSubject().compareTo("") == 0)) {
- sr.setSubject(MessageManager.getMessage(request));
- }
- data.put(ProcessUtil.REQUEST, sr);
- m.put(ProcessUtil.DATA, data);
-
- processInstance = kiesession.startProcess(idproceso, m);
-
- APPLogger.getLogger().info("Flujo preparado");
-
- return processInstance.getId();
- }
-
- /**
- * Cierra la session de trabajo.
- */
- public void close() {
- // no cerrar la session, esta se cierra en el commit trabaja con JTA.
- }
-
- public KieSession getKiesession() {
- return kiesession;
- }
-
- public ProcessInstance getProcessInstance() {
- return processInstance;
- }
-
-
-
-
-}
\ No newline at end of file
diff --git a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/ProcessUtil.java.svn-base b/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/ProcessUtil.java.svn-base
deleted file mode 100644
index b6a7919..0000000
--- a/base/bpm/bpmlib/src/main/java/com/fp/bpmlib/.svn/text-base/ProcessUtil.java.svn-base
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- *
- */
-package com.fp.bpmlib;
-
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl;
-import org.kie.api.task.model.Task;
-import org.kie.api.task.model.TaskData;
-
-import com.fp.base.persistence.util.helper.GeneralDescriptions;
-import com.fp.bpmlib.db.DataHelper;
-import com.fp.bpmlib.flow.Monitor;
-import com.fp.dto.Request;
-import com.fp.persistence.commondb.PersistenceHelper;
-import com.fp.persistence.pgeneral.log.TgeneTransactionLog;
-import com.fp.simple.dto.TaskInfo;
-
-// TODO: Auto-generated Javadoc
-/**
- * Class ProcessUtil encargada de.
- *
- * @author gfiallos
- */
-public final class ProcessUtil {
-
- /** Constante ACTUAL_TASK. */
- public static final String ACTUAL_TASK = "actualTask";
-
- /** Constante DATA. */
- public static final String DATA = "maia";
-
- /** El valor de instance. */
- private static ProcessUtil instance = null;
-
- /** Constante PID. */
- public static final String PID = "pid";
-
- /** Constante REQUEST. */
- public static final String REQUEST = "request";
-
- /** Constante SNAPSHOT. */
- public static final String SNAPSHOT = "snapshot";
-
- /** Constante TASK_METADATA. */
- public static final String TASK_METADATA = "taskMetaData";
-
- /** Constante TASKS_METADATA. */
- public static final String TASKS_METADATA = "tasksMetaData";
-
- /**
- * Obtiene el valor de done task meta data.
- *
- * @param pProcess the process
- * @param pName the name
- * @return Valor de done task meta data
- * @throws Exception la exception
- */
- @SuppressWarnings("unchecked")
- public static Object getDoneTaskMetaData(Monitor monitor, String pName) throws Exception {
- Object tasks = monitor.getVariable(ProcessUtil.TASKS_METADATA);
- if (tasks != null) {
- Map m = (Map) tasks;
- Map record = new HashMap();
- record.put(pName, ProcessUtil.manageHistory(monitor,(List) m.get(pName)));
- return record;
- }
- return null;
- }
-
- /**
- * Obtiene el valor de first done task meta data.
- *
- * @param pProcess the process
- * @return Valor de first done task meta data
- * @throws Exception la exception
- */
- @SuppressWarnings("unchecked")
- public static Map getFirstDoneTaskMetaData(Monitor monitor) throws Exception {
- Object tasks = monitor.getVariable(ProcessUtil.TASKS_METADATA);
- if (tasks != null) {
- Map m = (Map) tasks;
- for (Entry entry : m.entrySet()) {
- Map record = new HashMap();
- record.put(entry.getKey(), ProcessUtil.getDoneTaskMetaData(monitor, entry.getKey()));
- return record;
- }
- }
- return null;
- }
-
- /**
- * Obtiene la única instancia de ProcessUtil.
- *
- * @return única instancia de ProcessUtil
- */
- public static ProcessUtil getInstance() {
- synchronized (ProcessUtil.class) {
- if (ProcessUtil.instance == null) {
- ProcessUtil.instance = new ProcessUtil();
- }
- return ProcessUtil.instance;
- }
- }
-
- /**
- * Manage history.
- *
- * @param pHistory the history
- * @return list
- * @throws Exception la exception
- */
- protected static List manageHistory(Monitor monitor,List pHistory) throws Exception {
- if (pHistory == null) {
- return null;
- }
- for (TaskInfo taskInfo : pHistory) {
- Object tid = taskInfo.getTaskId();
- if (tid == null) {
- tid = taskInfo.getTaskId();
- }
- if (tid != null) {
- ProcessUtil.manageTaskId(monitor, taskInfo, Long.valueOf("" + tid));
- }
- }
- return pHistory;
- }
-
- /**
- * Manage task id.
- *
- * @param pTask the task
- * @param pTID the tID
- * @throws Exception la exception
- */
- private static void manageTaskId(Monitor monitor,TaskInfo pTask, Long pTID) throws Exception {
- pTask.setTaskId(pTID);
- Map