# Signature Value

**URL:** <https://zatca1.discourse.group/t/signature-value/11059>\
**Category:** Clearance and Reporting\
**Created:** [November 29, 2026, 5:51pm UTC](https://zatca1.discourse.group/t/signature-value/11059 "2026-11-29T17:51:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fahad](https://avatars.discourse-cdn.com/v4/letter/f/ecccb3/32.png) [@Fahad](https://zatca1.discourse.group/u/Fahad)\
**Post date:** [November 29, 2026, 5:51pm UTC](https://zatca1.discourse.group/t/signature-value/11059/1 "2026-11-29T17:51:38Z")

</div>

Am I supposed to sign the ‘Signed Info’ or the ‘Hashed XML Invoice’?

Signing hashed xml invoice : -

```auto
byte[] canonicalizedBytes = Base64.getDecoder().decode(hashInvoiceValue.getBytes(StandardCharsets.UTF_8));Signature signature = Signature.getInstance("SHA256withECDSA","BC");signature.initSign(privateKey);signature.update(canonicalizedBytes);byte[] demSignature = signature.sign();String signatureValue = Base64.getEncoder().encodeToString(demSignature);

```

Signing signed info : -  
{

```auto
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Document doc = dbf.newDocumentBuilder().parse(
        new InputSource(new StringReader(signedInfoBlock))
);
Canonicalizer canonicalizer = Canonicalizer.getInstance(
        Canonicalizer.ALGO_ID_C14N11_OMIT_COMMENTS
);
byte[] canonicalizedBytes = canonicalizer.canonicalizeSubtree(doc);
Signature signature = Signature.getInstance("SHA256withECDSA","BC");
signature.initSign(privateKey);
signature.update(canonicalizedBytes);
byte[] demSignature = signature.sign();
String signatureValue = Base64.getEncoder().encodeToString(demSignature);

```

}
