0

I'm using R's gpg package - https://cran.r-project.org/web/packages/gpg/gpg.pdf and I'd like to use-

gpg_encrypt(data, receiver, signer = NULL) 

By default this outputs to a file. Is there any way to save the output of that function to a variable? For example

x <- gpg_encrypt(data, receiver, signer = NULL) 
AS3
  • 3
  • 4
  • I don't use the `gpg` package, but have you tried [`?rawConnection`](https://stat.ethz.ch/R-manual/R-patched/library/base/html/rawConnection.html) (assuming of course that you can change the "file" handle). – r2evans Jul 18 '18 at 16:01
  • I'm confused, actually: the [intro vignette](https://cran.r-project.org/web/packages/gpg/vignettes/intro.html#encrypt_a_message) clearly shows the value being returned from `gpg_encrypt` going into a *variable*, at which point it can be saved to a file. (The [C++ code](https://github.com/jeroen/gpg/blob/master/src/encrypt.c#L18) seems to return a string, which is just passed-through by the [R code](https://github.com/jeroen/gpg/blob/master/R/encrypt.R#L19).) What version are you using? Has this behavior changed recently? – r2evans Jul 18 '18 at 16:07

0 Answers0