Mailing List Archive

How do you save an encrypted sexp? (D'oh!)
Greetings all!

I know it must be simple, but I've been staring at this library code for
so much time lately, that it seems I cannot see the forest for the
trees... 8-|

How can I take a newly encrypted sexp from gcry_pk_encrypt and save it
as a file on my server, and then read it later for decryption?
I cannot seem to find any reliable method to determine the actual size
of the sexp to do a simple fwrite/fputc, so I am left with taking chunks
of memory larger than I need, and trimming off the end...

That is a stupid approach, but it's all my tired mind can come up with
at the moment...

I appreciate any assistance you can offer! Thank you.


--
I must need more caffeine... ;-)



Tony Warren

garbaj@prairiesys.com


<}-:
Re: How do you save an encrypted sexp? (D'oh!) [ In reply to ]
"Warren, Tony" <tonyw@prairiesys.com> writes:

> How can I take a newly encrypted sexp from gcry_pk_encrypt and save it
> as a file on my server, and then read it later for decryption?

You can use gcry_sexp_sprint() and gcry_sexp_sscan(); both are
documented in the manual.

moritz
--
((gpg-key-id . "6F984199")
(email . "moritz@duesseldorf.ccc.de")
(webpage . "http://duesseldorf.ccc.de/~moritz/"))