Posts

Showing posts from July, 2019

ENI (5) Autofirma issues

Please read this post (although it is in Spanish) Informatica Dantesca Autofirma .

ENI (4) Fastexml compatibility issues

0. Introduction Fasterxml is very easy to use for managing XML, but there are some issues that are not compatible with JAXB. Here are some examples of how to solve this handicaps 1. @XmlElementRef, @XmlMixed ... Here is an example of the generated KeyInfoType class 1 2 3 4 5 6 7 8 9 10 11 12 13 14 public class KeyInfoType { @XmlElementRefs ({ @XmlElementRef ( name = "KeyName" , namespace = "http://www.w3.org/2000/09/xmldsig#" , type = JAXBElement . class , required = false ), @XmlElementRef ( name = "KeyValue" , namespace = "http://www.w3.org/2000/09/xmldsig#" , type = JAXBElement . class , required = false ), @XmlElementRef ( name = "RetrievalMethod" , namespace = "http://www.w3.org/2000/09/xmldsig#" , type = JAXBElement . class , required = false ), @XmlElementRef ( name = "X509Data" , namespace = "http://www.w3.org/2000/

OBSOLETE!!!: ENI (3) Generating java classes from multiple schemas

Image
0. Introduction ( NOTE This is obsolete. see  https://dantesquews.blogspot.com/2019/07/eni-1-eni-document-or-spanish.html ) The purpose of this post is to convert a XAdES internally detached signed document to an ENI document. The signed document contains content and signature, but ENI document has also metadata. But the schema of a XAdES document is not the same as the ENI. I am using Gexflow from Teralco, and the metadata are stored in a database. So it is necessary a conversion. Several schemas are needed: documentoEni.xsd contenidoDocumentoEni.xsd metadatosDocumentoEni.xsd firmasEni.xsd xmldsig-core-schema.xsd XAdES.xsd 1. Configuring the maven project Here is the pom.xml file with the needed resource s: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 6

ENI (2) ENI Document, is it operational? Verifying documents and "expedients". Afirma and TipoFirmasElectronicas

Image
0. Introduction 1. Our XML validator 2. Main problems 3. Adapting Afirma to TipoFirmasElectyronicas 4. Oficial validators 0. Introduction Spanish Government has made some small steps to solve the situation. But it is not enough.  For instance, there are no available schema validators for signatures provided by the program " AutoFirma ". I have spent a lot of time trying to create ENI "expedients" and documents.  1. Our own XML validator  You should avoid using Jackson XML. Use JAXB instead . This small program validates the XML to the schemas ======================================== package openadmin . utils . jaxb ; import javax . xml . XMLConstants ; import javax . xml . transform . stream . StreamSource ; import javax . xml . validation . Schema ; import javax . xml . validation . SchemaFactory ; import javax . xml . validation . Validator ; import java . io . ByteArrayInputStream ; import java . io . File ; import java . io . FileOutputStream