Allow multiple c14n algorithms
I'm working with a service that transmits and receives signed XML with very specific requirements. One of the requirements is to use different canonicalization algorithms for the signed info and for the payload. With this patch, signxml can be configured to be compatible with the requirement.
Thanks for your contribution!
I understand your requirement and I would like to support it. we need to clarify the names of the resulting options. Also, this PR can't be merged without a test case.
I think it would be better to organize the options as follows:
class XMLSigner(...):
def __init__(
self,
signature_c14n_algorithm=XMLSignatureProcessor.default_c14n_algorithm,
payload_c14n_algorithm=XMLSignatureProcessor.default_c14n_algorithm
):
self.signature_c14n_algorithm = signature_c14n_algorithm
self.payload_c14n_algorithm = payload_c14n_algorithm
...
If we change the option name, the change will be backward incompatible, so the next version should be 3.x rather than 2.11 (assuming we're following semantic versioning principles).
I would prefer to add an option and leave the existing option name, making the new version compatible with existing code.
This PR will not be accepted per the feedback above, but the functionality will be supported in the v3.0.0 release
Tracking in #205