makdimka077 / xades4j

Automatically exported from code.google.com/p/xades4j
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Position of Signature #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When I sign the invoice with e-signature, the e-signature is invalid. 
Because the position of signature is not in the right place.

What is the expected output? What do you see instead?
The expected output is valid e-signature. I see invalid e-signature.

What version of the product are you using? On what operating system?
The version is 1.3.2

Please provide any additional information below.

The invoice is like that,

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="general.xslt"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" 
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponent
s-2" 
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
 xmlns:ds="http://www.w3.org/2000/09/xmldsig#" 
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponent
s-2" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="root" 
xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 
..\xsd\maindoc\UBLTR-Invoice-2.0.xsd">
    <ext:UBLExtensions>
        <ext:UBLExtension>
            <ext:ExtensionContent Id="signPlace"> 
            <!-- I want to put the signature here -->
            </ext:ExtensionContent>
        </ext:UBLExtension>
    </ext:UBLExtensions>
    <cbc:UBLVersionID>2.0</cbc:UBLVersionID>
    <cbc:CustomizationID>TR1.0</cbc:CustomizationID>
    <cbc:ProfileID>TEMELFATURA</cbc:ProfileID>
    <cbc:ID>GIB2009000000001</cbc:ID>
    <cbc:CopyIndicator>false</cbc:CopyIndicator>
    <cbc:UUID>F47AC10B-58CC-4372-A567-0E02B2C3D479</cbc:UUID>
    <cbc:IssueDate>2009-01-05</cbc:IssueDate>
    <cbc:IssueTime>14:42:00</cbc:IssueTime>
    <cbc:InvoiceTypeCode>SATIS</cbc:InvoiceTypeCode>
    <cbc:DocumentCurrencyCode>TRL</cbc:DocumentCurrencyCode>
    <cbc:LineCountNumeric>1</cbc:LineCountNumeric>
</Invoice>

How can i put the signature in "ext:ExtensionContent" tag ? The appending 
strategies are firstChid, lastChild and previousSibling, but i can't use them. 

Original issue reported on code.google.com by ereny...@gmail.com on 22 May 2013 at 8:42

GoogleCodeExporter commented 9 years ago
Why can't you use the existing appending strategies? I think you need 
"firstChild" using ext:ExtensionContent as the reference node. Or you can use 
the overload on XadesSigner that has a parent Node parameter.

Original comment by luis.fgoncalv on 22 May 2013 at 9:34

GoogleCodeExporter commented 9 years ago
Two additional notes:

- 1.3.2 is the version of the XAdES spec, not xades4j.
- This doesn't seem to be a issue with the library. This kind of questions 
should be posted on stack overflow using the xades4j tag.

Original comment by luis.fgoncalv on 22 May 2013 at 9:35

GoogleCodeExporter commented 9 years ago

Original comment by luis.fgoncalv on 22 May 2013 at 1:02

GoogleCodeExporter commented 9 years ago
hi, have you found a solution on the issue?

Original comment by serkanod...@gmail.com on 11 Jul 2013 at 2:47

GoogleCodeExporter commented 9 years ago
Hi Serkan,

I found a solution. The below code may helps you. It is wrote in 
SignerBESTest.java.

Document doc1 = oracle.clobToDoc(oracle.guidArray[i], oracle.belgeKoduArray[i]);
NodeList l = doc1.getElementsByTagNameNS("*", "ExtensionContent");
Element elemToSign = (Element) l.item(0);

Original comment by ereny...@gmail.com on 19 Aug 2013 at 9:21