the apps/genrsa utility confused me because it seems to only generate a
private key. the apps/rsa utility documentation says that with a -pubout a
public key is output from a private key. is this true? is a public key
embedded in the private key generated with genrsa?
I tried to test this by adding
if(!PEM_write_bio_RSAPublicKey(out,rsa))
goto err;
right after line 210 in genrsa.c
if PEM_write_bio_RSAPublicKey is suppose to output the public key
component of the rsa structure, then this public key should be the same
as the one generated with app/rsa. This was not the case however.
for example running my modified genrsa,
OpenSSL> genrsa
warning, not much extra random data, consider using the -rand option
Generating RSA private key, 512 bit long modulus
....++++++++++++
....++++++++++++
e is 65537 (0x10001)
-----BEGIN RSA PRIVATE KEY-----
MIIBOQIBAAJBAMcXdann26+kJ0Gf2IwZmu3sOek3pStGTbz5jw/5cITPFJ6S5MXt
CmwENSGUHvHPv25Ik4dKn3uQWbdHE25fdt8CAwEAAQJAb/T7T/54hb7z7G1tIuvL
OfxbXJDUKw+v65MTJlKJOcUS6sqIMKSCYis4vW1SR0hK6Sas8Bbp6FHubm7oKndZ
oQIhAPW3pP9pdXKvNFAYmyxYaRrcHP8mFFy7CfNOwuFUZo7pAiEAz2xRBvILZ0oF
Ecde8xhcqqVb3q+twGOAOfodtJXtCocCIC0kN+PUdAdFuM6eNqPG+kg89/bIACWp
FwLkDVloMA9BAiAHQq1bZuGLTgX7Z1UlgTbNKlia5N9aGqGEZgLgLVdMxQIgFC3G
kdGHIv8ko4pUD22Tqi1Vf4nsoc4F5mRdJf45RC8=
-----END RSA PRIVATE KEY-----
-----BEGIN RSA PUBLIC KEY-----
MEgCQQDHF3Wp59uvpCdBn9iMGZrt7DnpN6UrRk28+Y8P+XCEzxSekuTF7QpsBDUh
lB7xz79uSJOHSp97kFm3RxNuX3bfAgMBAAE=
-----END RSA PUBLIC KEY-----
save this output to a file called foo.pem and run
OpenSSL> rsa -in foo.pem -pubout
read RSA key
writing RSA key
-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMpff1pr/HqhpDVLSwaQILSJ1gXpReyU
eg7ADNz8EBp199/Jvm/zrG5DW0sohXHyiFD7pSmYfflh5JrO4CfR4HMCAwEAAQ==
-----END PUBLIC KEY-----
this public key is not equal to the one created with
PEM_write_bio_RSAPublicKey(out,rsa) I added to genrsa.c
Can someone explain the discrepency?
thanks,
son
On Sat, 29 Jul 2000 [EMAIL PROTECTED] wrote:
> genrsa only creates RSA private keys? How are rsa key pairs made using
> the openssl application?
>
> thanks
>
> ______________________________________________________________________
> OpenSSL Project http://www.openssl.org
> User Support Mailing List [EMAIL PROTECTED]
> Automated List Manager [EMAIL PROTECTED]
>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]