phax / ph-ubl

Java library for reading and writing UBL 2.0, 2.1, 2.2, 2.3 and 2.4 documents
Apache License 2.0
110 stars 40 forks source link

How to add UBLDocumentSignatures in UBL Extension? #39

Closed kurbhatt closed 3 years ago

kurbhatt commented 3 years ago

I have created 1 UBL document InvoiceType. It has all the required details. Now I want to add a Signature to the UBL document. The Extension will be used for this AFAIK. I have tried to find out this but I am not able to find the solution.

I tried with xades4j but there's 1 issue, it creates a Signature directly in Document(using ds:Signature), not in the Extension. I passed the UBL XML string to xades4j. I want it to be in structure:

`

urn:oasis:names:specification:ubl:dsig:enveloped:xades urn:oasis:names:specification:ubl:signature:1 urn:oasis:names:specification:ubl:signature:Invoice ` Please suggest me way to add a signature in the UBL extension.
phax commented 3 years ago

I recommend to use the DSS library to add electronic signatures. See https://github.com/esig/dss/ for details.