gpgme_set_textmode (ctx, 1);
op_encrypt (void *rset, const char *inbuf, char **outbuf){    gpgme_key_t *keys = (gpgme_key_t *)rset;    gpgme_data_t in=NULL, out=NULL;    gpgme_error_t err;    gpgme_ctx_t ctx;        *outbuf = NULL;    op_init ();    err = gpgme_new (&ctx);    if (err)	return err;    err = gpgme_data_new_from_mem (&in, inbuf, strlen (inbuf), 1);    if (err)	goto leave;    err = gpgme_data_new (&out);    if (err)	goto leave;    gpgme_set_armor (ctx, 1);    err = gpgme_op_encrypt (ctx, keys, GPGME_ENCRYPT_ALWAYS_TRUST, in, out);    if (!err) {	size_t n = 0;		*outbuf = gpgme_data_release_and_get_mem (out, &n);	(*outbuf)[n] = 0;	out = NULL;    }    else	err = check_encrypt_result (ctx, err);leave:    if (ctx != NULL)	gpgme_release (ctx);    if (in != NULL)	gpgme_data_release (in);    if (out != NULL)	gpgme_data_release (out);    return err;}