-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am getting CERTIFICATE_SIGNATURE_QRCODE_INVALID. Please let me know how to resolve this error. #1
Comments
Did you find any solution? @priteshqualitycode |
Hi @nadyshalaby, [code] => signed-properties-hashing by the way it's working in sandbox account. |
@priteshqualitycode do you've any idea? |
did you claim the real keys
If not you should refer back to them to see if you are eligible to phase 2 or not and grap your own keys. |
Thank you for your response, @nadyshalaby. No, I haven't obtained the PrivateKey and CSR from ZATCA. Instead, I generated my own and called the endpoint [code] => signed-properties-hashing |
@sulaman0 [code] => signed-properties-hashing |
When you go live with the ZATCA (Zakat, Tax and Customs Authority) Phase 2 requirements in Saudi Arabia, you'll need to obtain the Certificate Signing Request (CSR) and private key from a trusted Certificate Authority (CA) approved by ZATCA. Here's how you can obtain these:
If you need further assistance with this process or require a more detailed guide on integrating the keys into your invoicing system, feel free to ask! |
Let's walk through an example of how to obtain and use a CSR (Certificate Signing Request) and private key for ZATCA Phase 2, assuming you're preparing to go live. Step 1: Generate a CSR and Private KeySuppose you're using OpenSSL, a popular tool for generating CSR and private keys. Here’s how you can do it: 1.1. Generate a Private Keyopenssl genpkey -algorithm RSA -out privatekey.pem -pkeyopt rsa_keygen_bits:2048
1.2. Generate a CSRopenssl req -new -key privatekey.pem -out request.csr
Example of the information you might enter: Country Name (2 letter code) [AU]:SA
State or Province Name (full name) [Some-State]:Riyadh
Locality Name (eg, city) []:Riyadh
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Your Company Name
Organizational Unit Name (eg, section) []:IT Department
Common Name (e.g. server FQDN or YOUR name) []:invoices.yourcompany.com
Email Address []:info@yourcompany.com Step 2: Submit the CSR to a Certificate Authority (CA)2.1. Choose a Trusted CA
2.2. Submit the CSR
Step 3: Obtain the Certificate from the CA
Step 4: Use the Certificate and Private Key in Your Invoicing SystemSuppose you’re integrating these into a system that will sign electronic invoices before submission to ZATCA. 4.1. Secure Storage
4.2. Integrate with Invoicing Software
{
"invoice_signing_key": "/path/to/privatekey.pem",
"certificate": "/path/to/certificate.crt",
"invoice_endpoint": "https://api.zatca.gov.sa/einvoice"
} 4.3. Sign the Invoice
Example Workflow in Code (Pseudo-code)from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding
# Load private key
with open("privatekey.pem", "rb") as key_file:
private_key = serialization.load_pem_private_key(
key_file.read(),
password=None,
)
# Load your certificate
with open("certificate.crt", "rb") as cert_file:
certificate = cert_file.read()
# Sample data to sign (an invoice)
invoice_data = b"Invoice #12345, Amount: 1000 SAR"
# Sign the invoice data
signature = private_key.sign(
invoice_data,
padding.PKCS1v15(),
hashes.SHA256()
)
# Attach the signature to the invoice and send to ZATCA
send_to_zatca(invoice_data, signature, certificate) In this example, your invoice data is signed using your private key, ensuring its authenticity and integrity. The signed invoice, along with your certificate, is then sent to ZATCA. Step 5: Going Live
|
hello @nadyshalaby
i download all these files after register on cert4sign.com as simulation and use these files on project https://gw-fatoora.zatca.gov.sa/e-invoicing/simulation/compliance/invoices this is warningMessages "warningMessages": [ this is errorMessages "errorMessages": [ |
i want to mention that when i submit Standard invoice every this is ok |
It looks like you're facing two key issues with your certificate and signature validation when interacting with the ZATCA simulation portal. Let's break down the problems and possible solutions: 1. Warning: "certificate-issuer-name"
Possible Solutions:
You may need to contact cert4sign.com or ZATCA for further clarification on why the certificate's issuer information is being flagged. 2. Error: "signed-properties-hashing"
Possible Solutions:
Steps to Debug:
If the problem persists, you may need to reach out to cert4sign.com or ZATCA for more specific troubleshooting based on the error codes you're receiving. |
[0] => stdClass Object
(
[type] => ERROR
[code] => CERTIFICATE_SIGNATURE_QRCODE_INVALID
[category] => QRCODE_VALIDATION
[message] => certificate signature does not match with qr certificate signature value
[status] => ERROR
)
The text was updated successfully, but these errors were encountered: