balena / python-smime

S/MIME encoder in pure python
Apache License 2.0
18 stars 17 forks source link

Address #5 #6

Closed tuck1s closed 6 years ago

tuck1s commented 6 years ago

Accept multipart messages, fixing text/plain parts for compatibility with block crypto. encrypt() accepts string or message object type.

balena commented 6 years ago

Hey @tuck1s , nice work, but the code looks to solve a very particular case. Let me know if we can actually simplify the encrypt function a little bit, so all these filtering can be handled from outside the function. Do you agree?

tuck1s commented 6 years ago

Simpler is always better. A few comments -

I think my header removal code is rather ugly (please improve if you can), but in terms of inputs the intent is to make it more general rather than less general :-)

However I think you are right, we should move the "filtering" part outside of encrypt. Because I think the filtering should be done once only, before signing and/or encrypting. I'm trying to get some workable signing code together. So feel free to reject this PR (or even better .. suggest improvements to my code and also reject it)!

tuck1s commented 6 years ago

I'll withdraw this and submit a simpler version.