# How to create certificate

**URL:** <https://zatca1.discourse.group/t/how-to-create-certificate/7424>\
**Category:** SDK, web-based validator and sandbox\
**Created:** [June 20, 2025, 10:16am UTC](https://zatca1.discourse.group/t/how-to-create-certificate/7424 "2025-06-20T10:16:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkjamil](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@chkjamil](https://zatca1.discourse.group/u/chkjamil)\
**Post date:** [June 20, 2025, 10:16am UTC](https://zatca1.discourse.group/t/how-to-create-certificate/7424/1 "2025-06-20T10:16:08Z")

</div>

Hi,

I’ve downloaded the Fatoora .NET SDK and successfully generated a CSR using the following command:

```bash
fatooranet csr -csrConfig csr-config-example-EN.properties -pem True -sim True

```

This worked fine and generated the CSR and private key in `.pem` format. I also used:

```bash
fatooranet qr -invoice testinvoice.xml

```

This command also worked successfully.

However, when I try to sign the invoice using:

```bash
fatooranet sign -invoice testinvoice.xml -certificate generated-csr-20250620142703.csr -privateKey generated-private-key-20250620142703.key

```

I get the following error:

```auto
Operation Failed
Step: [Parse Certificate] [Failed]
Errors: [Error] Parsing EInvoice Certificate
Step: [Populate Signed Signature Properties] [Failed]
Errors: [Error] Populating Signed Signature Properties
Step: [Generate EInvoice QR] [Failed]
Errors: [Error] Generating EInvoice QR Code

```

Can you please guide me on what I might be doing wrong at this step?

Looking forward to your support.

---

<div class="post-metadata">

**Author:** ![Aturkistani](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Aturkistani](https://zatca1.discourse.group/u/Aturkistani)\
**Post date:** [June 22, 2025, 10:46am UTC](https://zatca1.discourse.group/t/how-to-create-certificate/7424/2 "2025-06-22T10:46:35Z")

</div>

Dear @chkjamil,

To sign the invoice, parsing both of the x.509 certificate and the private key is necessary, to obtain the certificate, you should send the generated CSR alongside with the OTP that should be generated from Fatoora portal to the compliance CSID API, after that your solution should perform the compliance checks, after that you will be able to obtain the production CSID.

the compliance CSID is being used to send & sign the invoices and associated notes for the compliance checks phase, while the production CSID is being used to sign and send the invoices to reporting and clearance API.

However, you need an access to fatoora portal with TIN credentials to obtain the OTP to start testing the onboarding process in simulation environment, if you don’t, then you can use the default certificate located inside the SDK folder in the following path: SDK/data/certificates, also, you can test the APIs in sandbox environment which doesn’t require a fatoora portal access.

Regards,
