Python Forum
Zeep lib, encrypt soap body - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Zeep lib, encrypt soap body (/thread-21061.html)



Zeep lib, encrypt soap body - miha1234 - Sep-12-2019

Hello

i am trying to use: https://python-zeep.readthedocs.io/en/master/wsse.html

Signing msg works fine:

from zeep import Client
from zeep.wsse.signature import Signature

client = Client(
    'http://test?wsdl',
    wsse=Signature("test.pem","test.pem",))

client.service.GetNetworkOperators()
Issue that I need to solve is how to encrypt body part like:

Output:
<Body> <xenc:EncryptedData Id="bodyID"> xenc:CipherData> <xenc:CipherValue>...</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> </Body>
thank you very much for help!
miha