# QR code is not showing ECDSA signature and public key

**URL:** <https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958>\
**Category:** General\
**Created:** [November 9, 2023, 9:57am UTC](https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958 "2023-11-09T09:57:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivangi.garg](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@shivangi.garg](https://zatca1.discourse.group/u/shivangi.garg)\
**Post date:** [November 9, 2023, 9:57am UTC](https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958/1 "2023-11-09T09:57:17Z")

</div>

We have successfully generated e-invoice, and XML also complies with ZATCA guidelines. But when we scan the QR code, we get only 5 fields, i.e. Seller name, VRN, timestamp, Invoice amount, and tax amount.

But as per the guidelines, Invoice hash, ECDSA signature, and public key should also be a part of the QR code.

Please guide me if the invoice hash and ECDSA are not coming on the QR code then the QR code is valid or not.

---

<div class="post-metadata">

**Author:** ![Sanjay](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sanjay](https://zatca1.discourse.group/u/Sanjay)\
**Post date:** [November 18, 2023, 5:15pm UTC](https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958/2 "2023-11-18T17:15:45Z")

</div>

Dear Shivangi, Invoice hash, ECDSA signature, and public key is mandatory to be the part of QR code, if it is not in the QR code, then QR code will not be consider as a valid QR for Phase-II. For creating the rest 4 fields of QR code please Follow the SDK.

---

<div class="post-metadata">

**Author:** ![shivangi.garg](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@shivangi.garg](https://zatca1.discourse.group/u/shivangi.garg)\
**Post date:** [December 11, 2023, 9:23am UTC](https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958/3 "2023-12-11T09:23:45Z")

</div>

Hi Sanjay, Thanks for the response. Please confirm once if the QR code scanning result are fine in the attached screenshot.

 ![MicrosoftTeams-image (76)](https://europe1.discourse-cdn.com/flex013/uploads/zatca1/original/1X/11cabbef50a1c53ee55a1363dfd293bb232a32b2.jpeg)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/zatca1/original/1X/0d70286dbd5eedc372ad03987dad0b4f6545ca0f.jpeg)

---

<div class="post-metadata">

**Author:** ![Sanjay](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sanjay](https://zatca1.discourse.group/u/Sanjay)\
**Post date:** [December 29, 2023, 11:06pm UTC](https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958/4 "2023-12-29T23:06:26Z")

</div>

Dear Shivangi,

Yes, attached screenshot is correct.

---

<div class="post-metadata">

**Author:** ![James](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@James](https://zatca1.discourse.group/u/James)\
**Post date:** [June 3, 2025, 1:14pm UTC](https://zatca1.discourse.group/t/qr-code-is-not-showing-ecdsa-signature-and-public-key/958/5 "2025-06-03T13:14:31Z")

</div>

@shivangi.garg , how did you get the error resolved. I am trying to create ECDSA signature using the function below but am still facing validation errors: public class ZatcaSignature  
{  
public static void Main()  
{  
// Sample XML invoice content  
string invoiceXml = “Name”;

```
    // Step 1: Compute SHA256 hash of the XML
    byte[] invoiceBytes = Encoding.UTF8.GetBytes(invoiceXml);
    byte[] invoiceHash;

    using (SHA256 sha256 = SHA256.Create())
    {
        invoiceHash = sha256.ComputeHash(invoiceBytes);
    }

    // Step 2: Generate ECDSA key (P-256) - in production, use a pre-generated private key
    using (ECDsa ecdsa = ECDsa.Create(ECCurve.NamedCurves.nistP256))
    {
        // Step 3: Sign the hash
        byte[] signature = ecdsa.SignHash(invoiceHash);

        // Step 4: Convert to Base64 for QR Tag 7
        string tag7SignatureBase64 = Convert.ToBase64String(signature);

        // Output
        Console.WriteLine("Tag 7 - ECDSA Signature (Base64):");
        Console.WriteLine(tag7SignatureBase64);
    }
}

```

}
