Mailing List Archive

How to import external RSA keys
Hello everybody,

I'm looking for a possibility to import extern RSA keys into a program
which is written using gcrypt.h. I want to encrypt and decrypt data
using this program but I want to use RSA keys which are stored on a
Cryptoflex Smartcard by Schlumberger. These keys should be stored an
ASCII format (or something similar). Has anybody an idea how to import
these keys into a program written with the gcrypt.h? Till now, I didn't
find any.. :(

Bye
Carolin
Re: How to import external RSA keys [ In reply to ]
On Wed, Jun 08, 2005 at 12:54:32PM +0200, Carolin Latze wrote:

> Has anybody an idea how to import these keys into a program written
> with the gcrypt.h?

I cannot give advice on the procedure of extracting the key from that
specific card, I can give general advice, though: as you probably
know, an RSA key consists of a few numbers (the so called `key
material'). What you have to do is:

* extract these numbers
* figure out the format of the numbers
* convert the numbers into a format supported by Libgcrypt
* make sure that the semantics regarding the numbers p, q, u match
those of Libgcrypt (u might need to be recomputed),
* convert the numbers to Libgcrypt MPI objects
* construct a complete key from the raw key material using either
the sexp/pk interface or the ac interface.

Hope this help a bit,
Moritz

--
Moritz Schulte