I encountered the next error when tryed to sign invoice
fatoora -sign -invoice /path/to/file -signedInvoice /path/to/file_signed.xml
********** Welcome to ZATCA E-Invoice Java SDK 3.3.9 *********************
This SDK uses Java to call the SDK (jar) passing it an invoice XML file.
It can take a Standard or Simplified XML, Credit Note, or Debit Note.
It returns if the validation is successful or shows errors where the XML validation fails.
It checks for syntax and content as well.
You can use the command (fatoora -help) for more information.
****************************************************************
2025-01-23 10:58:55,434 [ERROR] InvoiceSigningService - failed to sign invoice [please provide a valid private key]
org.bouncycastle.openssl.PEMException: unable to convert key pair: null
at org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter.getKeyPair(Unknown Source)
at com.zatca.sdk.util.ECDSAUtil.loadPrivateKey(ECDSAUtil.java:117)
at com.zatca.sdk.service.InvoiceSigningService.validatePrivateKey(InvoiceSigningService.java:143)
at com.zatca.sdk.service.InvoiceSigningService.validateInputFiles(InvoiceSigningService.java:70)
at com.zatca.sdk.service.InvoiceSigningService.validateInput(InvoiceSigningService.java:176)
at com.zatca.sdk.service.GeneratorTemplate.generate(GeneratorTemplate.java:32)
at com.zatca.sdk.MainApp.execute(MainApp.java:65)
at com.zatca.sdk.MainApp.main(MainApp.java:121)
Caused by: java.lang.NullPointerException
... 8 more
fatoora path: /opt/zatca_einvoicing_sdk/Apps/fatoora
config path: /opt/zatca_einvoicing_sdk/Configuration/config.json
cat /opt/zatca_einvoicing_sdk/Configuration/config.json
{
"xsdPath": "/opt/zatca_einvoicing_sdk/Data/Schemas/xsds/UBL2.1/xsd/maindoc/UBL-Invoice-2.1.xsd",
"enSchematron": "/opt/zatca_einvoicing_sdk/Data/Rules/schematrons/CEN-EN16931-UBL.xsl",
"zatcaSchematron": "/opt/zatca_einvoicing_sdk/Data/Rules/schematrons/20210819_ZATCA_E-invoice_Validation_Rules.xsl",
"inputPath": "/opt/zatca_einvoicing_sdk/Data/Input",
"usagePathFile": "/opt/zatca_einvoicing_sdk/Configuration/usage.txt",
"certPath": "/mnt/zatca-e-inv-data/Certificates/cert.pem",
"privateKeyPath": "/mnt/zatca-e-inv-data/Certificates/private.key",
"pihPath": "/opt/zatca_einvoicing_sdk/Data/PIH/pih.txt"
}