ruby-gpgme icon indicating copy to clipboard operation
ruby-gpgme copied to clipboard

Expose IO like object for streaming decryption

Open nickbutler opened this issue 9 years ago • 1 comments

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?

nickbutler avatar Dec 06 '16 07:12 nickbutler

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.

ueno avatar Dec 06 '16 09:12 ueno