diff --git a/src/zeep/wsse/signature.py b/src/zeep/wsse/signature.py index c4aec758..abfb3d50 100644 --- a/src/zeep/wsse/signature.py +++ b/src/zeep/wsse/signature.py @@ -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( @@ -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(