From jlueters at intranet-engineering.de Fri May 5 19:07:51 2006 From: jlueters at intranet-engineering.de (Juergen Lueters) Date: Fri May 5 20:56:05 2006 Subject: loading a private rsa key with libgcrypt Message-ID: <1146848871.32036.10.camel@sol4.ie-office.test> Hi, i have a project in which a private rsa key has to used in order to sign a string. I would like to use libgcrypt. After reading the documentation i have found the procedure "gcry_ac_key_init". Unfortunaltely i can not find out how to prepare a private rsa-key-file (file.pem) in a way usable for that function. Is there any documentation or example code which shows how to load a pem file and transform it into a suitable data set? Regards -- Juergen Lueters From mo at g10code.com Sat May 6 11:44:20 2006 From: mo at g10code.com (Moritz Schulte) Date: Sat May 6 13:26:31 2006 Subject: loading a private rsa key with libgcrypt In-Reply-To: <1146848871.32036.10.camel@sol4.ie-office.test> References: <1146848871.32036.10.camel@sol4.ie-office.test> Message-ID: <1146908660.26154.12.camel@localhost.localdomain> On Fri, 2006-05-05 at 19:07 +0200, Juergen Lueters wrote: Hello Jurgen, > Is there any documentation or example code which shows how to load a pem > file and transform it into a suitable data set? as you probably have noticed yourself already: Libgcrypt does not contain code for handling PEM blobs. I guess you could extract appropriate code from other crypto tools, able of parsing PEM. Moritz -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : /pipermail/attachments/20060506/0d386885/attachment.pgp From rafaelbuitre at yahoo.it Mon May 8 10:57:21 2006 From: rafaelbuitre at yahoo.it (Rafael Martin) Date: Mon May 8 12:56:12 2006 Subject: Newbie question - Importing keys Message-ID: Hi, I create a key pair using libgcrypt library: gcry_ac_open (&handle, GCRY_AC_RSA, 0); gcry_ac_key_pair_generate (handle, key_len, NULL, &key_pair, NULL); then I extract public and private key: key_sec = gcry_ac_key_pair_extract (key_pair, GCRY_AC_KEY_SECRET); key_pub = gcry_ac_key_pair_extract (key_pair, GCRY_AC_KEY_PUBLIC); and finally I write them to file: data = gcry_ac_key_data_get(key_pub); for (i=0; i<2; i++) { gcry_ac_data_get_index(data,0,i,NULL,&tmp_mpi); gcry_mpi_aprint(GCRYMPI_FMT_HEX,&value,&len,tmp_mpi); fprintf(pub_fd," %s",value); } data = gcry_ac_key_data_get(key_sec); for (i=0; i<6; i++) { gcry_ac_data_get_index(data,0,i,NULL,&tmp_mpi); gcry_mpi_aprint(GCRYMPI_FMT_HEX,&value,&len,tmp_mpi); fprintf(priv_fd,"%s ",value); } fprintf(priv_fd,"\n"); fprintf(pub_fd,"\n"); Is it possible to use these keys with GnuPG(converting the format somehow)? Thanks in advance! Rafael Martin From wk at gnupg.org Tue May 9 17:06:27 2006 From: wk at gnupg.org (Werner Koch) Date: Tue May 9 17:11:16 2006 Subject: loading a private rsa key with libgcrypt In-Reply-To: <1146848871.32036.10.camel@sol4.ie-office.test> (Juergen Lueters's message of "Fri, 05 May 2006 19:07:51 +0200") References: <1146848871.32036.10.camel@sol4.ie-office.test> Message-ID: <87ac9rfdak.fsf@wheatstone.g10code.de> Juergen Lueters writes: > Is there any documentation or example code which shows how to load a pem > file and transform it into a suitable data set? checkout gnupg 1.9: agent/protect-tool.c as similar code. Shalom-Salam, Werner From ndurner at web.de Fri May 26 21:11:41 2006 From: ndurner at web.de (Nils Durner) Date: Sun May 28 16:54:49 2006 Subject: [patch] Fix --disable-nls Message-ID: <447752ED.3040007@web.de> Hi, the attached patch fixes linker errors for libgpg-error sources that were configured using ./configure --disable-nls Best regards, Nils Durner -------------- next part -------------- diff -Naur libgpg-error-1.3/src/gpg-error.c libgpg-error-1.3.dur/src/gpg-error.c --- libgpg-error-1.3/src/gpg-error.c Sun Dec 18 15:24:34 2005 +++ libgpg-error-1.3.dur/src/gpg-error.c Fri May 26 18:48:50 2006 @@ -64,16 +64,15 @@ static void i18n_init (void) { +#ifdef ENABLE_NLS char *locale_dir; -#ifdef ENABLE_NLS # ifdef HAVE_LC_MESSAGES setlocale (LC_TIME, ""); setlocale (LC_MESSAGES, ""); # else setlocale (LC_ALL, "" ); # endif -#endif locale_dir = get_locale_dir (); if (locale_dir) @@ -82,6 +81,7 @@ drop_locale_dir (locale_dir); } textdomain (PACKAGE); +#endif } diff -Naur libgpg-error-1.3/src/init.c libgpg-error-1.3.dur/src/init.c --- libgpg-error-1.3/src/init.c Sun Oct 23 19:38:59 2005 +++ libgpg-error-1.3.dur/src/init.c Fri May 26 18:49:34 2006 @@ -48,6 +48,7 @@ gpg_error_t gpg_err_init (void) { +#ifdef ENABLE_NLS char *locale_dir; /* We only have to bind our locale directory to our text domain. */ @@ -58,6 +59,7 @@ bindtextdomain (PACKAGE, locale_dir); drop_locale_dir (locale_dir); } +#endif return 0; } From marcus.brinkmann at ruhr-uni-bochum.de Mon May 29 16:00:05 2006 From: marcus.brinkmann at ruhr-uni-bochum.de (Marcus Brinkmann) Date: Mon May 29 15:59:56 2006 Subject: [patch] Fix --disable-nls In-Reply-To: <447752ED.3040007@web.de> References: <447752ED.3040007@web.de> Message-ID: <87d5dxx76i.wl%marcus.brinkmann@ruhr-uni-bochum.de> At Fri, 26 May 2006 21:11:41 +0200, Nils Durner wrote: > > [1 ] > Hi, > > the attached patch fixes linker errors for libgpg-error sources that > were configured using > ./configure --disable-nls I put it in. Thanks, Marcus 2006-05-29 Marcus Brinkmann * src/init.c (gpg_err_init) [!ENABLE_NLS]: Do not initialize the locale. * src/gpg-error.c (i18n_init) [!ENABLE_NLS]: Likewise. Patch submitted by Nils Durner .