Importing certificates as keys

Ph. Marek philipp.marek@bmlv.gv.at
Mon Jun 30 12:09:02 2003


Hello everybody,

I have a (possibly) stupid question.

If I have a certificate (eg. for use with SSL), which has also dataEncryption 
and keyEncryption as keyusages defined, is there a ways to import that key 
into gpg?
With openssl I can get the values by using a command like
	openssl rsa -text -in privkey.pem
which dumps my the information, eg.
	Private-Key: (512 bit)
	modulus:
	    00:b0:37:ca:c2:3b:bc:df:2d:dc:a1:d2:f7:44:4a:
	    e9:cb:b0:e2:3a:4a:f3:7a:ac:ae:4b:ea:26:21:0b:
	    fb:63:ee:48:9e:80:0d:2f:11:6a:59:9e:6f:c9:32:
	    08:55:9d:be:ae:07:cd:bf:f8:f7:69:a5:d6:74:ec:
	    9e:42:ea:c0:47
	publicExponent: 65537 (0x10001)
	privateExponent:
	    00:ac:81:31:80:0b:32:cd:d7:fb:90:7f:11:88:4d:
	    3d:aa:25:32:91:96:25:dc:05:87:6a:d1:81:1a:00:
	    bc:cc:09:2c:39:b1:df:d8:a3:d0:01:a1:0f:12:2a:
	    83:f1:70:52:b6:69:ca:5a:3a:54:26:f3:00:13:06:
	    a3:b5:b8:5a:01
	prime1:
	    00:d6:28:11:5a:6d:74:e1:09:3d:ab:b6:85:02:ed:
	    f2:1f:55:aa:d2:90:8e:31:be:81:b4:9d:cf:dd:62:
	    ba:06:41
	prime2:
	    00:d2:a6:11:62:30:cc:3d:d4:05:56:84:e3:1a:d7:
	    44:f1:b1:89:2c:a6:09:87:14:78:c7:1b:fd:54:c0:
	    fc:74:87
	exponent1:
	    00:bb:71:62:8e:f5:93:01:8c:e7:0f:ae:b7:89:32:
	    df:63:91:c5:ec:7b:5e:1a:28:16:bb:12:0d:e8:46:
	    0b:70:81
	exponent2:
	    50:36:a4:cf:fb:3d:0b:1e:3d:9a:20:a8:4a:84:46:
	    e0:b2:76:45:e6:44:22:88:0d:25:e4:e6:a6:eb:86:
	    36:e9
	coefficient:
	    4a:00:d6:8f:e6:dd:c8:9d:b4:cc:02:38:ce:80:f4:
	    c5:0c:a0:7f:c6:13:03:46:08:4f:22:58:5f:d2:02:
	    2a:e6
	writing RSA key
	-----BEGIN RSA PRIVATE KEY-----
	MIIBOwIBAAJBALA3ysI7vN8t3KHS90RK6cuw4jpK83qsrkvqJiEL+2PuSJ6ADS8R
	almeb8kyCFWdvq4Hzb/492ml1nTsnkLqwEcCAwEAAQJBAKyBMYALMs3X+5B/EYhN
	PaolMpGWJdwFh2rRgRoAvMwJLDmx39ij0AGhDxIqg/FwUrZpylo6VCbzABMGo7W4
	WgECIQDWKBFabXThCT2rtoUC7fIfVarSkI4xvoG0nc/dYroGQQIhANKmEWIwzD3U
	BVaE4xrXRPGxiSymCYcUeMcb/VTA/HSHAiEAu3FijvWTAYznD663iTLfY5HF7Hte
	GigWuxIN6EYLcIECIFA2pM/7PQsePZogqEqERuCydkXmRCKIDSXk5qbrhjbpAiBK
	ANaP5t3InbTMAjjOgPTFDKB/xhMDRghPIlhf0gIq5g==
	-----END RSA PRIVATE KEY-----
I expect that this information should be more than enough to specify the key 
for gpg.

I believe I read something a long time ago about specifying the various values 
for generating a key - I just don't remember where and which product 
(openssl, gpg, or something else).

Nevertheless -. is there a way to import the pem- or pkcs12-file or some other 
information (text dump above) to use my key in gpg?

This would be easier than giving all users another key, which they would have 
to have with them. If it could just get generated from the certificate or 
possibly used directly ...


Thank you for all answers!


Regards,

Phil