Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/saml2/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ def parse_assertion(self, key_file=""):

if self.response.encrypted_assertion:
logger.debug("***Encrypted assertion/-s***")
decr_text = self.sec.decrypt(self.xmlstr)
decr_text = self.sec.decrypt(self.xmlstr, key_file)
resp = samlp.response_from_string(decr_text)
res = self.decrypt_assertions(resp.encrypted_assertion, key_file)
if self.response.assertion:
Expand Down
4 changes: 3 additions & 1 deletion src/saml2/sigver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,12 +1250,14 @@ def encrypt_assertion(self, statement, cert_file, cert_type="pem"):
:return:
"""

def decrypt(self, enctext):
def decrypt(self, enctext, key_file=None):
""" Decrypting an encrypted text by the use of a private key.

:param enctext: The encrypted text as a string
:return: The decrypted text
"""
if key_file is not None and len(key_file.strip()) > 0:
return self.crypto.decrypt(enctext, key_file)
return self.crypto.decrypt(enctext, self.key_file)

def verify_signature(self, signedtext, cert_file=None, cert_type="pem",
Expand Down