在Soap头Python中计算KeyInfo的引用URI

2024-05-18 15:18:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试为soapxml请求生成安全头,我可以计算摘要值和签名值。我需要在KeyInfo中填充URI的以下值-->;SecurityTokenReference-->;Reference

<wsse:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#X509-623242F9C597DEB5EB1425871479922117"/>

下面是我计算其余值的方法:

signed_info = canonicalize(signed_info, c14n_exc)
#Sign the SHA1 digest of the signed xml using RSA cipher
pkey = RSA.load_key(private_key, lambda *args, **kwargs: password)
signature = pkey.sign(hashlib.sha1(signed_info).digest())

Tags: thekeygtinfourirsareferencesigned

热门问题