How to use it
Wed, 16 Jul 2003 14:12:48 +0200
=2D----BEGIN PGP SIGNED MESSAGE-----
Am Mittwoch, 16. Juli 2003 10:00 schrieb Moritz Schulte:
> > 2. How can I convert the generated keys from gcry_ac_key_t to anything
> > else that can be stored in a database? Which data type should I use for
> > that (SAP DB)?
> Well, libgcrypt contains functions for printing and scanning MPI
> values, which could be used for storing and reading the key material.
> Maybe it makes sense to to have high level functions for storing and
> reading data sets in the ac interface.
What is the best way to store keys in a database? base64 encoded in a VARCH=
> > 3. If I understood the example in ac.c correctly, an unsigned int value
> > is encrypted. How can I pass a string to gcry_ac_data_encrypt for
> > encryting it?
> The data must be encoded in a MPI value. I think it makes sense to
> have a function for this purpose in the ac interface. Until that is
I tried the following sequence for storing a string in a MPI value, but I g=
a segmentation fault with the gcry_mpi_print call:
char text =3D "This is a test string.";
size_t textlen =3D strlen(text);
size_t buflen =3D 1024;
gcry_mpi_scan (&x, GCRYMPI_FMT_HEX, text, &textlen);
gcry_mpi_print (GCRYMPI_FMT_HEX, buf, &buflen, x);
What I expected is that the original string is printed in the last line. Wh=
is the problem with the above code? I looked into encode.c, but could not=20
identify a place where a string is encoded to a MPI value. Can you give me =
hint how the encoding can be done?
Thanks in advance,
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
=2D----END PGP SIGNATURE-----