We are still encountering an issue with the SDK when using .NET Core 8 in a Linux environment. It appears that the SDK still does not support Linux, and we are receiving the following error:
[ERR] Error Messages: [Error] Parsing EInvoice Certificate
[ERR] Exception: ASN1 corrupted data.
[ERR] Inner Exception: System.Formats.Asn1.AsnContentException: The provided data is tagged with ‘Application’ class value ‘13’, but it should have been ‘Universal’ class value ‘16’.
at System.Formats.Asn1.AsnDecoder.CheckExpectedTag(Asn1Tag tag, Asn1Tag expectedTag, UniversalTagNumber tagNumber)
at System.Formats.Asn1.AsnDecoder.ReadSequence(ReadOnlySpan1 source, AsnEncodingRules ruleSet, Int32& contentOffset, Int32& contentLength, Int32& bytesConsumed, Nullable1 expectedTag)
at System.Formats.Asn1.AsnValueReader.ReadSequence(Nullable1 expectedTag) at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.DecodeCore(AsnValueReader& reader, Asn1Tag expectedTag, ReadOnlyMemory1 rebind, PfxAsn& decoded)
at System.Security.Cryptography.Asn1.Pkcs12.PfxAsn.Decode(AsnValueReader& reader, Asn1Tag expectedTag, ReadOnlyMemory`1 rebind, PfxAsn& decoded)
We would appreciate your guidance on how to resolve this issue or whether there is a workaround or updated version of the SDK that supports Linux environments under .NET 8.
I thing the issue you are facing related the schematrons you must be add to your application and be sure the application will copy when you build your application.
dotnet fatooraNet.dll csr -sim -csrConfig ../Data/csr-config-example-EN-VAT-group.properties -generatedCsr ../Data/csr.csr -privateKey ../Data/key.key
********************* Welcome to ZATCA E-Invoice .Net SDK 3.4.6 *********************
This App uses .Net to call the SDK 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 (fatooraNet -help) for more information.
You can use the command (fatooraNet {Command} -help) for instructions on how to use the command and expected arguments.
*************************************************************************************
Operation Completed Successfully!
Step: [Validate CSR Properties] [Success]
Step: [Generate CSR String] [Success]
Step: [Generate EC Private Key String] [Success]
dotnet fatooraNet.dll sign -invoice ../Data/unsigned_invoice.xml -signedInvoice ../Data/signed.xml -certificate ../Data/csr.csr -privateKey ../Data/key.key
********************* Welcome to ZATCA E-Invoice .Net SDK 3.4.6 *********************
This App uses .Net to call the SDK 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 (fatooraNet -help) for more information.
You can use the command (fatooraNet {Command} -help) for instructions on how to use the command and expected arguments.
*************************************************************************************
Operation Failed
Step: [Generate EInvoice Hash] [Failed]
Errors: [Error] Generating EInvoice Hash
Step: [Generate Signature] [Failed]
Errors: [Error] Generating EInvoice Signature
Step: [Parse Certificate] [Failed]
Errors: [Error] Parsing EInvoice Certificate
Step: [Transform Xml Result] [Failed]
Errors: [Error] Transforming Xml Result
Step: [Populate Signed Signature Properties] [Failed]
Errors: [Error] Populating Signed Signature Properties
Step: [Populate UBL Extensions] [Failed]
Errors: [Error] Populating UBL Extensions
Step: [Generate EInvoice QR] [Failed]
Errors: [Error] Generating EInvoice QR Code
Step: [Finalize Sign Document] [Failed]
Errors: [Error] Finalizing Sign Document
abumusa@abumusa-laptop:~/Desktop/sdk-238-R3.4.6/Test$ dotnet --version
8.0.415
abumusa@abumusa-laptop:~/Desktop/sdk-238-R3.4.6/Test$
Try copying the schematrons files inside the folder Data\Rules and placing them in the same folder where the DLL is located like below screenshot and let me know what happened with you. Because we was facing issue with the schematrons in the direct integrated with the SDK and I think your issue related that.
I do not think this is the issue, I specified the files in the passed parameters. anyways I moved the Data folder inside the same folder as the dll but the issue persist.
If you want you can join me in a quick call to see how I execute the commands
abumusa@abumusa-laptop:~/Desktop/sdk-238-R3.4.6/Test$ ls
BouncyCastle.Crypto.dll ja System.Security.Cryptography.Pkcs.dll
cs Kajabity.Tools.Java.dll System.Security.Cryptography.ProtectedData.dll
Data key.pem System.Security.Cryptography.Xml.dll
de ko tr
es Microsoft.Extensions.DependencyModel.dll version.txt
fatooraNet.deps.json Newtonsoft.Json.dll xerces.dll
fatooraNet.dll pl xerces.pdb
fatooraNet.dll.config pt-BR ZATCA.EInvoice.SDK.Contracts.dll
fatooraNet.exe ru ZATCA.EInvoice.SDK.Contracts.pdb
fatooraNet.pdb runtimes ZATCA.EInvoice.SDK.dll
fatooraNet.runtimeconfig.json saxon.dll ZATCA.EInvoice.SDK.pdb
fr saxon.pdb ZATCA.EInvoice.SDK.Saxon.dll
ikvm System.CommandLine.dll ZATCA.EInvoice.SDK.Saxon.pdb
IKVM.ByteCode.dll System.Configuration.ConfigurationManager.dll zh-Hans
ikvm.properties System.Data.Odbc.dll zh-Hant
invoice1.xml System.Diagnostics.EventLog.dll
it System.IO.Pipelines.dll
abumusa@abumusa-laptop:~/Desktop/sdk-238-R3.4.6/Test$ dotnet fatooraNet.dll sign -invoice Data/unsigned_invoice.xml -signedInvoice Data/signed.xml -certificate Data/csr.csr -privateKey Data/key.key
********************* Welcome to ZATCA E-Invoice .Net SDK 3.4.6 *********************
This App uses .Net to call the SDK 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 (fatooraNet -help) for more information.
You can use the command (fatooraNet {Command} -help) for instructions on how to use the command and expected arguments.
*************************************************************************************
Operation Failed
Step: [Generate EInvoice Hash] [Failed]
Errors: [Error] Generating EInvoice Hash
Step: [Generate Signature] [Failed]
Errors: [Error] Generating EInvoice Signature
Step: [Parse Certificate] [Failed]
Errors: [Error] Parsing EInvoice Certificate
Step: [Transform Xml Result] [Failed]
Errors: [Error] Transforming Xml Result
Step: [Populate Signed Signature Properties] [Failed]
Errors: [Error] Populating Signed Signature Properties
Step: [Populate UBL Extensions] [Failed]
Errors: [Error] Populating UBL Extensions
Step: [Generate EInvoice QR] [Failed]
Errors: [Error] Generating EInvoice QR Code
Step: [Finalize Sign Document] [Failed]
Errors: [Error] Finalizing Sign Document
abumusa@abumusa-laptop:~/Desktop/sdk-238-R3.4.6/Test$