miyako / 4d-plugin-xmlsec

XML signature based on xmlsec
MIT License
1 stars 1 forks source link

Bolivia #6

Closed susanagutierrez closed 1 year ago

susanagutierrez commented 1 year ago

Hello, I have checked "XMLDsig" plugin. I need to sign the Bolivian invoice with these steps, do I understand that the canonization process is inside "xmldsig"?

  1. Apply the canonicalization algorithm to the XML document, that is, carry out a processing that allows obtaining its canonical form or normalizing the original document.

  2. Apply the sha256 algorithm to the result in order to obtain the HASH.

  3. Obtain a string by applying the Base64 algorithm to the previous HASH.

  4. Add the signature tags to the XML.

  5. Add to the Digest Value tag the value obtained in step 4.

  6. Take the signature section and obtain a HASH of it applying the SHA256 algorithm.

7.Encrypt the HASH obtained using the RSA SHA256 algorithm with the private key

  1. Apply the Base64 algorithm to the resulting string to obtain a string

  2. Add the above string to the Signature Value tag.

  3. Finally place the public key in the X509 Certificate label

  4. Return the signed XML

Thanks for your time

miyako commented 1 year ago

I don't know for sure, but I think the answer is yes.

the plugin uses xmlsec, which uses libxml2, which has c14n (canonization) API.

https://www.aleksey.com/xmlsec/index.html

see header files for this plugin

https://github.com/miyako/4d-plugin-xmlsec/tree/main/xmlsec/include