X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=blobdiff_plain;f=sfa%2Ftrust%2Fcertificate.py;h=651bbc648ca2d779a338e1ff493d482b077553b0;hp=cdad52ab80ffe2de234e09b2a3308138766875f9;hb=48962274f4516dec87774eee0e51d9fd302d8da5;hpb=4a9e6751f9f396f463932133b9d62fc925a99ef6 diff --git a/sfa/trust/certificate.py b/sfa/trust/certificate.py index cdad52ab..651bbc64 100644 --- a/sfa/trust/certificate.py +++ b/sfa/trust/certificate.py @@ -206,12 +206,13 @@ class Keypair: OpenSSL.crypto.FILETYPE_PEM, string, functools.partial(glo_passphrase_callback, self, string)) self.m2key = M2Crypto.EVP.load_key_string( - string, functools.partial(glo_passphrase_callback, - self, string)) + string.encode(encoding="utf-8"), + functools.partial(glo_passphrase_callback, self, string)) else: self.key = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, string) - self.m2key = M2Crypto.EVP.load_key_string(string) + self.m2key = M2Crypto.EVP.load_key_string( + string.encode(encoding="utf-8")) ## # Load the public key from a string. No private key is loaded. @@ -274,7 +275,8 @@ class Keypair: def get_m2_pubkey(self): import M2Crypto if not self.m2key: - self.m2key = M2Crypto.EVP.load_key_string(self.as_pem()) + self.m2key = M2Crypto.EVP.load_key_string( + self.as_pem().encode(encoding="utf-8")) return self.m2key ##