Skip to content

Commit 568d81c

Browse files
author
Leif Johansson
committed
avoid end-of-string newline
1 parent 9585327 commit 568d81c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/xmlsec/crypto.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from cryptography.hazmat.primitives import serialization, hashes
1515
from cryptography.hazmat.primitives.asymmetric import rsa, padding, utils
1616
from cryptography.x509 import load_pem_x509_certificate, load_der_x509_certificate, Certificate
17-
import codecs
17+
import base64
1818

1919
if six.PY2:
2020
from UserDict import DictMixin
@@ -232,7 +232,7 @@ def sign(self, data, hash_alg=None):
232232
msg = r.json()
233233
if not 'signed' in msg:
234234
raise ValueError("Missing signed data in response message")
235-
return codecs.encode(msg['signed'], 'base64')
235+
return base64.encodestring(msg['signed'])
236236
except Exception as ex:
237237
from traceback import print_exc
238238
print_exc(ex)

0 commit comments

Comments
 (0)