Added option to return Enveloped data as bytes as well as strings. #19
Added option to return Enveloped data as bytes as well as strings. #19parneshraniga wants to merge 1 commit intovbwagner:masterfrom
Conversation
…is is useful in python 3 where strings are unicode. Current implementation is more pythonic and also relies on the flags to return appropriate data type from decryption of enveloped data.
|
It' s nice. I'm not sure that I would merge it as is, because this would cause incompatibile behavoir in python2 and python3 but it is definitely right way to go. |
|
Although I haven't tested in py2 yet, I don't know if it will cause incompatible behaviour as bytes == str in py2. So under py2 you will get a str regardless of whether you set the binary flag or not. This should not interfere with any code. I will try and put together some tests next week and see how I go. |
|
Look into ctypescrypto/x509.py where I've tried to make consistent behavoir between python2 and python3. Problem is that by default user uses str and expects something human readable from it. Really, you should add sometihng like |
|
For what it's worth I have bypassed |
This is useful in python 3 where strings are unicode. Current implementation is more pythonic and also relies on the flags to return appropriate data type from decryption of enveloped data.