From: "Carlo E. Prelz" Date: 2012-10-28T04:44:27+09:00 Subject: Re: OpenSSL ECDSA public key from private Subject: Re: OpenSSL ECDSA public key from private Date: Sun 28 Oct 12 04:23:52AM +0900 Quoting Nokan Emiro (uzleepito@gmail.com): > So what I need is to ask the 'key' object to be so kind and calculate the > the > public key for me using my private key I've just set with #private_key=. > > key.private_key = ** > * > * > key.plese_calculate_the_public_key_from_the_private_one! I had a look at the ruby code. #generate_key just calls openssl function "EC_KEY_generate_key". From openssl.sourcearchive.com, I see that, within that function, the public key is generated with if (eckey->pub_key == NULL) { pub_key = EC_POINT_new(eckey->group); if (pub_key == NULL) goto err; } EC_POINT_new is used within Ruby when creating an OpenSSL::PKey::EC::Point object, when passing it a 'group'. Now, I have no idea what a group is, but your key has a 'group'. And it is populated, even without calling #generate_key. If I run pub_key=OpenSSL::PKey::EC::Point.new(key.group) I get something. Again, I hope this is what you are looking for. Carlo -- * Se la Strada e la sua Virtu' non fossero state messe da parte, * K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)