Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/zeep/wsse/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ def __init__(
)


class BinarySignature(Signature):
"""Sign given SOAP envelope with WSSE sig using given key file and cert file.

Place the key information into BinarySecurityElement."""

class _BinarySignatureMixin:
def apply(self, envelope, headers):
key = _make_sign_key(self.key_data, self.cert_data, self.password)
_sign_envelope_with_key_binary(
Expand All @@ -107,6 +103,18 @@ def apply(self, envelope, headers):
return envelope, headers


class BinaryMemorySignature(_BinarySignatureMixin, MemorySignature):
"""Sign given SOAP envelope with WSSE sig using given key and cert.

Place the key information into BinarySecurityElement."""


class BinarySignature(_BinarySignatureMixin, Signature):
"""Sign given SOAP envelope with WSSE sig using given key file and cert file.

Place the key information into BinarySecurityElement."""


def check_xmlsec_import():
if xmlsec is None:
raise ImportError(
Expand Down