ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Expose IO like object for streaming decryption #85

Open codeindulgence opened 7 years ago

codeindulgence commented 7 years ago

Hey, so I've been trying to perform a decryption while avoiding either writing to disk or loading the whole plain text into memory.

I could use Open3 a la:

_, stdout, stderr, thread = Open3.popen3('gpg --decrypt cipher.gpg')

And then use stdout#read downstream, but I'd rather avoid shelling out; ruby-gpgme has served me so well this far!

Is something like this currently possible?

ueno commented 7 years ago

If I remember correctly, it should be already possible. All crypto functions in ruby-gpgme internally use Callback based data buffers, which can be accessed through Data object.