-
-
Notifications
You must be signed in to change notification settings - Fork 113
Closed
Description
Signatures generated with signxml are currently not compatible with the XSD that the SII (Chile’s IRS) uses.
I am currently using a fork of signxml in order to sign SII documents, with the following changes:
- Generate a
KeyValueelement even if a certificate is provided. (RSAKeyValue tag (Modulus and Exponent) #52) - Remove the second
Transformelement thatsignxmlgenerates, the one that describes the C14N
algorithm.
Also, the SII expects the Signature element to be located as a sibling of the signed node, not within it. Hence, I am using a helper method for signing which receives the parent of the element to sign (which must be the only child):
def _sign(self, parent):
children = list(parent)
assert len(children) == 1
element = children[0]
element_with_signature = self._signer.sign(
element, key=self._key, cert=self._certificate)
signature = element_with_signature.find(
'{http://www.w3.org/2000/09/xmldsig#}Signature')
parent.append(signature)
I am hoping that, eventually, signxml will be usable for generating SII-compatible signatures without the need to fork it with these changes.
Metadata
Metadata
Assignees
Labels
No labels