gpgme newbie question with read/write

Werner Koch wk at
Fri May 7 18:15:27 CEST 2004

On Thu, 6 May 2004 17:12:07 -0500, Rodden Aaron said:

> Is there a way to write a buffer at a time into the gpgme API, have it
> encrypt that buffer of data, and obtain the encrypted data when/if available
> from the API?  (like a "pipe") The data I'm dealing with is too large to fit

There are several way to achive this. See the manual for the functions

  gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
				       gpgme_data_cbs_t cbs,
				       void *handle);

  gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd);

  gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream);

The last one would probably best fit for your example code.  Note,
that these function have not been as thoroughly tested as other parts
of gpgme, so don't hesitate to ask if you have problems.



More information about the Gnupg-users mailing list