Container Extractor

TOOLS: Container Extractor

 

The objective of this document is to explain in short how to use the tool included in package containerExtractor_v0.3_4 that can be used to extract a container according to the CWA2 specification “Metadata container”.

Note these tools are part of a proof of concept, and still are in alpha state. These tools are provided “AS IS”, without warranty of any kind.

Restrictions

The tool restricts the processing to “container level only”, intervening thus not at file level inside the container. The container extraction shall be performed only at the top level container. Should there be some additional compressed / electronically signed / encrypted files within the container, they will remain as they were.

Despite the flexible container structure defined in the CWA2 metadata container specification, this tool is only able to apply one single (or no) encryption and one single (or no) signature, and furthermore enforces the following processing order for the container: “encryption (signature (zip-file))”.

Download the header creator executable file: containerExtractorTool_v0.3_4. Download the CWA2 test material: CWA2TestData_v0.3_3.

Prerequisites:

 

Before using this tool, you need:

  1. Java: If Java SE (Standard Edition) is not installed on your computer, download from oracle and install it. This package has been tested with java version 1.6.0, so this version or a newer one should be fine. If Java SE is installed on your computer, verify version (by using “java –version”), and if needed download and install a newer one;
  2. Package compressionTools_v0.3.jar;
  3. Package XBRLValidation_0_2_4.jar, see section “TOOLS: XBRL validation” for additional prerequisites;
  4. If the usage of electronic signature validation is required: signtools_0_3_0.jar, see additional prerequisites in section “TOOLS: Signature Creation and Validation”;
  5. If the usage of decryption is required: Package cryptools_0_3_1.jar, see additional prerequisites in section “TOOLS: Encryption and Decryption”.
  6. Internet access to acquire the XML schema for validation (if referring to a schema online)

 

 

 

 

 

Extraction of a container:  containerExtractor.Container Extractor

 

To extract a container, use the command:

java.exe –classpath compressionTools_v0.3jar; XBRLValidation_0_2_4.jar; containerExtractor Tool_v0.3.jar container Extractor.ContainerExtractor -f container -o outputdirectory  -cf containerfeedbackflag -if instancefeedbackflag -v feedbacklocation -k filename -p password -pr propertiesfile

Where:

  • -f container: a file path for the container to be processed
  • -o outputdirectory: output directory in which the container will be extracted to
  • -cf containerfeedbackflag: a flag to express whether or not the creation of container feedback document is desired or not. If not given, the container feedback document shall be created in the feedbacklocation.
  • -if instancefeedbackflag: a flag to express whether or not the creation of instance feedback document(s) is desired or not. If not given, the container feedback document shall be created in the feedbacklocation.
  • -v feedbacklocation: a file path to a directory in which the feedback document(s) shall be formatted. If included in the command line but left empty, the tool shall create feedback to the local directory. If not stated at all, the instance feedback document(s) shall not be created.
  • -k filename: file path in which the java key store resides (to be used only if encryption is applied)
  • -p password: a password for accessing the java key store (to be used only if encryption is applied)
  • -pr propertiesfile: properties file for XBRL validation

The basic functionalities of the container extractor tool can be divided in the following logical parts:

  • decryption,
  • electronic signature validation,
  • decompression,
  • header validation,
  • XBRL validation for found instance documents,
  • creation of instance feedback and
  • creation of container feedback.

 

All of these can be performed at once with the container extractor tool however decryption, electronic signature validation, decompression and XBRL validation functionalities can also be used as standalone tools.

Decryption

See ” TOOLS: Encryption and Decryption”.

Electronic signature validation

See section “TOOLS: Signature Creation and Validation”.

Decompression

See section “TOOLS: Compression”.

Header validation

The tool shall check that:

a)       there exists a file called header.xml in the container;

b)       the header.xml is valid XML and complies with the chosen header structure (XML Schema);

c)       all the file (<File>) listings inside the header.xml are also found as actual files in the container;

d)       no additional files exist inside the container that had not been listed in the header.xml.

XBRL validation

See section “TOOLS: XBRL validation”.

Creation of instance feedback

The container extractor tool can provide feedback from the instance document XBRL validation results to be used internally or to be sent back to the original sender. The instance feedback is an XML-document complying with the schema defined in:

http://www.eurofiling.info/eu/fr/esrs/InstanceFeedback/InstanceFeedback.xsd.

The application of the instance feedback creation functionality is optional and it can be controlled by setting the “instancefeedbackflag”.

Creation of container feedback

The container extractor tool can provide feedback from the container processing to be used internally or to be sent back to the original sender. The container feedback is an XML-document complying with the schema defined in:

http://www.eurofiling.info/eu/fr/esrs/ContainerFeedback/ContainerFeedback.xsd.

The application of the container feedback creation functionality is optional and it can be controlled by setting the “containerfeedbackflag”.

 

Sample command 1

Extraction of an encrypted and signed container:

  • Extracting container C:\CWA2TestData_v0.3_3\containerExtractor\in\containerDir.encrypted.xml
  • key store(“allJKS.jks”) and password (“XBRL2013”) provided for decryption
  • XBRL validation properties file C:\prop.properties
  • creates the resulting file of the decryption at  C:\CWA2TestData_v0.3_3\containerExtractor\out1. If the resulting file is a signed file, the tool shall perform a signature validation and the resulting file of that shall be created in to the same directory. The ultimate resulting file should be a .zip-file, which will also be extracted to the same directory
  • creates container and instance feedback documents to C:\CWA2TestData_v0.3_3\containerExtractor\fb1

“C:\Program Files\Java\jdk1.7.0_04\bin\java.exe” -server -classpath commons-logging-1.1.1.jar;cryptTools_0_3_1.jar;bcprov-jdk15on-149.jar;serializer-2.7.1.jar;xalan-2.7.1.jar;xercesImpl-2.9.1.jar;xml-apis-1.3.04.jar;xmlsec-1.5.4.jar;signtools_0_3_0.jar;XBRLValidation_0_2_4.jar;compressionTools_v0.3.jar;containerExtractorTool_v0.3_4.jar containerExtractorTool.ContainerExtractor -f C:\CWA2TestData_v0.3_3\containerExtractor\in\containerDir.encrypted.xml -o C:\CWA2TestData_v0.3_3\containerExtractor\out1 -k C:\allJKS.jks -p XBRL2013 -v C:\CWA2TestData_v0.3_3\containerExtractor\fb1 -pr C:\prop.properties

 

Sample output 1

dec 08, 2013 7:13:51 PM. cypher.DecryptFile loadEncryptionDocument

INFO: Encrypted document loaded from file:/C:/CWA2TestData_v0.3_3/containerExtractor/in/containerDir.encrypted.xml

dec 08, 2013 7:13:51 PM. cypher.DecryptFile loadDecryptionKey

INFO: Encrypted with X509 CERTIFICATE:

dec 08, 2013 7:13:51 PM. cypher.DecryptFile loadDecryptionKey

INFO: Issuer: CN=NSA, OU=KeysDept, O=NSA, L=Luxemburg, ST=Luxemburg, C=LU

dec 08, 2013 7:13:51 PM. cypher.DecryptFile loadDecryptionKey

INFO: Subject: CN=NSA, OU=KeysDept, O=NSA, L=Luxemburg, ST=Luxemburg, C=LU

dec 08, 2013 7:13:51 PM. cypher.DecryptFile loadDecryptionKey

INFO: Found alias nsa for X509 Certificate.

dec 08, 2013 7:13:52 PM. cypher.DecryptFile outputDocToFile

INFO: Wrote document containing decrypted data to C:\CWA2TestData_v0.3_3\containerExtractor\out1/containerDir.signed.xml

dec 08, 2013 7:13:52 PM. signtools.ValidateSignedFile ValidateSignedFile

INFO: Signature PASSED core validation

dec 08, 2013 7:13:52 PM. signtools.ValidateSignedFile ValidateSignedFile

INFO:  Writing object 0, id: containerDir.zip mimeType: application/octet-stream encoding: http://www.w3.org/2000/09/xmldsig#base64

at: C:\CWA2TestData_v0.3_3\containerExtractor\out1\containerDir.zip

dec 08, 2013 7:13:52 PM. compressionTools.UnZipFile unZipFile

INFO: 10 files extracted.

dec 08, 2013 7:13:52 PM. compressionTools.UnZipFileUtil doUnZipFile

INFO: File decompression successful, result files greated at C:\CWA2TestData_v0.3_3\containerExtractor\out1\containerDir

dec 08, 2013 7:13:54 PM. xmlTools.XMLTools validateXML

INFO: file:/C:/CWA2TestData_v0.3_3/containerExtractor/out1/containerDir/header.xml is valid.

dec 08, 2013 7:13:56 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ca-2006-07-01_2.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\xbrlReports\dataInstances_1_2\t-kri-corep-ca-2006-07-01_2.instancefeedback.xml

dec 08, 2013 7:13:58 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ci-2006-07-01_2.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\xbrlReports\dataInstances_1_2\t-kri-corep-ci-2006-07-01_2.instancefeedback.xml

dec 08, 2013 7:13:59 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-cs-2006-07-01_2.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\xbrlReports\dataInstances_1_2\t-kri-corep-cs-2006-07-01_2.instancefeedback.xml

dec 08, 2013 7:14:01 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ca-2006-07-01.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\xbrlReports\t-kri-corep-ca-2006-07-01.instancefeedback.xml

dec 08, 2013 7:14:02 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ci-2006-07-01.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\xbrlReports\t-kri-corep-ci-2006-07-01.instancefeedback.xml

dec 08, 2013 7:14:04 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-cs-2006-07-01.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\xbrlReports\t-kri-corep-cs-2006-07-01.instancefeedback.xml

dec 08, 2013 7:14:04 PM. xmlTools.XMLTools writeXml

INFO: containerDir.containerfeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb1\containerDir.containerfeedback.xml

dec 08, 2013 7:14:04 PM. containerExtractorTool.ContainerExtractor main

INFO: Container extraction completed in 13325 milliseconds

 

Sample command 2

Extraction of a signed container:

  • Extracting container C:\CWA2TestData_v0.3_3\containerExtractor\in\containerDir.encrypted.xml
  • XBRL validation properties file C:\prop.properties
  • creates the resulting file of the decryption at  C:\CWA2TestData_v0.3_3\containerExtractor\out2.The resulting file should be a .zip-file, which will also be extracted to the same directory
  • creates container and instance feedback documents to C:\CWA2TestData_v0.3_3\containerExtractor\fb2

“C:\Program Files\Java\jdk1.7.0_04\bin\java.exe” -server -classpath signtools_0_3_0.jar;XBRLValidation_0_2_4.jar;compressionTools_v0.3.jar;containerExtractorTool_v0.3_4.jar containerExtractorTool.ContainerExtractor -f C:\CWA2TestData_v0.3_3\containerExtractor\in\containerDir.signed.xml -o C:\CWA2TestData_v0.3_3\containerExtractor\out2 -pr C:\prop.properties -v C:\CWA2TestData_v0.3_3\containerExtractor\fb2

 

Sample output 2

dec 08, 2013 7:24:17 PM. signtools.ValidateSignedFile ValidateSignedFile

INFO: Signature PASSED core validation

dec 08, 2013 7:24:17 PM. signtools.ValidateSignedFile ValidateSignedFile

INFO:  Writing object 0, id: containerDir.zip mimeType: application/octet-stream encoding: http://www.w3.org/2000/09/xmldsig#base64

at: C:\CWA2TestData_v0.3_3\containerExtractor\out2\containerDir.zip

dec 08, 2013 7:24:17 PM. compressionTools.UnZipFile unZipFile

INFO: 10 files extracted.

dec 08, 2013 7:24:17 PM. compressionTools.UnZipFileUtil doUnZipFile

INFO: File decompression successful, result files greated at C:\CWA2TestData_v0.3_3\containerExtractor\out2\containerDir

dec 08, 2013 7:24:20 PM. xmlTools.XMLTools validateXML

INFO: file:/C:/CWA2TestData_v0.3_3/containerExtractor/out2/containerDir/header.xml is valid.

dec 08, 2013 7:24:22 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ca-2006-07-01_2.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\xbrlReports\dataInstances_1_2\t-kri-corep-ca-2006-07-01_2.instancefeedback.xml

dec 08, 2013 7:24:23 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ci-2006-07-01_2.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\xbrlReports\dataInstances_1_2\t-kri-corep-ci-2006-07-01_2.instancefeedback.xml

dec 08, 2013 7:24:25 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-cs-2006-07-01_2.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\xbrlReports\dataInstances_1_2\t-kri-corep-cs-2006-07-01_2.instancefeedback.xml

dec 08, 2013 7:24:27 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ca-2006-07-01.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\xbrlReports\t-kri-corep-ca-2006-07-01.instancefeedback.xml

dec 08, 2013 7:24:29 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-ci-2006-07-01.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\xbrlReports\t-kri-corep-ci-2006-07-01.instancefeedback.xml

dec 08, 2013 7:24:30 PM. xmlTools.XMLTools writeXml

INFO: t-kri-corep-cs-2006-07-01.instancefeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\xbrlReports\t-kri-corep-cs-2006-07-01.instancefeedback.xml

dec 08, 2013 7:24:30 PM. xmlTools.XMLTools writeXml

INFO: containerDir.containerfeedback.xml created successfully at C:\CWA2TestData_v0.3_3\containerExtractor\fb2\containerDir.containerfeedback.xml

dec 08, 2013 7:24:30 PM. containerExtractorTool.ContainerExtractor main

INFO: Container extraction completed in 13793 milliseconds

 

Sample command 3

Extraction of a signed container:

  • Extracting container C:\CWA2TestData_v0.3_3\containerExtractor\in\containerDir.zip
  • creates the resulting extracted file at  C:\CWA2TestData_v0.3_3\containerExtractor\out3
  • creates no container or instance feedback

“C:\Program Files\Java\jdk1.7.0_04\bin\java.exe” -server -classpath signtools_0_3_0.jar;XBRLValidation_0_2_4.jar;compressionTools_v0.3.jar; containerExtractorTool_v0.3_4.jar containerExtractorTool.ContainerExtractor -f C:\CWA2TestData_v0.3_3\containerExtractor\in\containerDir.zip -o C:\CWA2TestData_v0.3_3\containerExtractor\out3 -cf false -if false

 

Sample output 3

dec 08, 2013 7:26:16 PM. containerExtractorTool.ContainerExtractor checkArgs

INFO: Parameter -v not in use. Feedback shall not be generated.

dec 08, 2013 7:26:16 PM. compressionTools.UnZipFile unZipFile

INFO: 10 files extracted.

dec 08, 2013 7:26:16 PM. compressionTools.UnZipFileUtil doUnZipFile

INFO: File decompression successful, result files greated at C:\CWA2TestData_v0.3_3\containerExtractor\out3\containerDir

dec 08, 2013 7:26:20 PM. xmlTools.XMLTools validateXML

INFO: file:/C:/CWA2TestData_v0.3_3/containerExtractor/out3/containerDir/header.xml is valid.

dec 08, 2013 7:26:20 PM. containerExtractorTool.ContainerExtractor main

INFO: Container extraction

completed in 3740 milliseconds

 

Comments are closed.