Skip to content
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

full code in simulation #45

Open
AhmedTarekYA opened this issue Oct 27, 2024 · 9 comments
Open

full code in simulation #45

AhmedTarekYA opened this issue Oct 27, 2024 · 9 comments

Comments

@AhmedTarekYA
Copy link

does any one finish the full integration code ?

@thaifanisalla
Copy link
Contributor

Yes , You can use this in simulation or production , Even in sandbox
we support the three modes

@AhmedTarekYA
Copy link
Author

AhmedTarekYA commented Nov 6, 2024 via email

@thaifanisalla
Copy link
Contributor

thaifanisalla commented Nov 23, 2024

Hi @AhmedTarekYA
Could you please provide the steps you followed?

Here are some important notes:

  • When generating the CSR, ensure the environment is set to "simulation" by passing 'simulation' using the setCurrentZatcaEnv(string $currentEnv) function here .
    here a full example of how to generate the CSR.
  • Make sure to provide the correct private key when signing the invoice.
  • For phpseclib, ensure you're using version "phpseclib/phpseclib": "3.0.x-dev".

@islamazouz
Copy link

islamazouz commented Dec 2, 2024

i have the same problem
image

@hamza-id
Copy link

hamza-id commented Jan 4, 2025

Any resolution i am also facing the same error.

@Hazem7575
Copy link

i too have same error

@hamza-id
Copy link

The issue relates to signed properties, specifically that their hash value does not match its calculated value. This discrepancy happens due to the formatting of signed properties before hashing.
The signed properties hash is highly sensitive and can change with even a single whitespace modification, causing it to fail reconciliation on ZATCA side in B2C or simplified case.

@T-Mohamed-adam
Copy link

Has anyone solved this issue? I'm facing the same error: Invalid signed properties hashing, SignedProperties with id='xadesSignedProperties'. Any help would be appreciated!

@hamza-id
Copy link

Finally, I resolved this error by having 36 spaces in the first line and 4 spaces after that. This changes the hash ofthe signed property hash value does not match its calculated value. The signed properties hash is highly sensitive and can change with even a whitespace.

                                     <xades:SignedSignatureProperties>
                                        <xades:SigningTime>2025-01-19T08:01:20</xades:SigningTime>
                                        <xades:SigningCertificate>
                                            <xades:Cert>
                                                <xades:CertDigest>
                                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                                    <ds:DigestValue>NTlhYjZjMDBiZmU5OGYzNmVlMmNhNzVlODhiOWQ0Nzc2ODk0ZGE4MDBkMjQ3YzgzZmQ4NDIzM2U3YzE0NWIxYQ==</ds:DigestValue>
                                                </xades:CertDigest>
                                                <xades:IssuerSerial>
                                                    <ds:X509IssuerName>0.9.2342.19200300.100.1.25=local/0.9.2342.19200300.100.1.25=gov/0.9.2342.19200300.100.1.25=extgazt, CN=PEZEINVOICESCA1-CA</ds:X509IssuerName>
                                                    <ds:X509SerialNumber>2207773857395212338642076460671910039858986559</ds:X509SerialNumber>
                                                </xades:IssuerSerial>
                                            </xades:Cert>
                                        </xades:SigningCertificate>
                                    </xades:SignedSignatureProperties>
                                </xades:SignedProperties>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants