如何使用 python xmlsign 更改 <transform> 算法

问题描述

我有以下代码来签署 xml

el = ET.parse('indias.xml',parser)
ET.register_namespace('',"http://www.w3.org/2000/09/xmldsig#");
root = el.getroot()
cert = open("publiccert.pem").read()
key = open("privatekey.pem").read()
signed_root = XMLSigner(method=signxml.methods.detached,signature_algorithm='rsa-sha1',c14n_algorithm='http://www.w3.org/TR/2001/REC-xml-c14n-20010315',digest_algorithm="sha1").sign(root,key=key,cert=cert,reference_uri=laweadeluri,always_add_key_value=True,)
tree = ET.ElementTree(signed_root)

使用

中的算法生成签名
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />

我的问题是我需要算法

<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />

我已经尝试了几种方法,但我无法实现我呼吁您的帮助 我的英语很基础,所以我为错误道歉

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)