https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112011-05-12T09:38:21ZRuby Issue Tracking SystemRuby master - Feature #4424: [ext/openssl] Allow public/private key creation from arbitrary datahttps://redmine.ruby-lang.org/issues/4424?journal_id=168952011-05-12T09:38:21ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>MartinBosslet (Martin Bosslet)</i></li></ul><p>Hi all,</p>
<p>I applied</p>
<p><a href="http://redmine.ruby-lang.org/issues/show/4421" class="external">http://redmine.ruby-lang.org/issues/show/4421</a>,<br>
<a href="http://redmine.ruby-lang.org/issues/show/4422" class="external">http://redmine.ruby-lang.org/issues/show/4422</a> and<br>
<a href="http://redmine.ruby-lang.org/issues/show/4423" class="external">http://redmine.ruby-lang.org/issues/show/4423</a>.</p>
<p>When again looking at this I realized that there is no<br>
need for separating creation of public and private keys, one<br>
method is actually all it takes (cf. attachment).<br>
This feature would add</p>
<p>OpenSSL::PKey.read( file | string [, pwd] )</p>
<p>that allows to read arbitrary keys (private or public)<br>
that are encoded in the generic X.509 format.</p>
<p>Two questions:</p>
<ol>
<li>Is it OK if I apply this?</li>
<li>Is "read" OK w.r.t naming conventions? Or should I use<br>
initialize instead (as it is done for the sub-classes RSA,<br>
DSA and EC) or name it differently altogether?</li>
</ol>
<p>Regards,<br>
Martin</p> Ruby master - Feature #4424: [ext/openssl] Allow public/private key creation from arbitrary datahttps://redmine.ruby-lang.org/issues/4424?journal_id=168962011-05-12T09:43:27ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/1644">pkey_from_data2.tar.gz</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1644/pkey_from_data2.tar.gz">pkey_from_data2.tar.gz</a> added</li></ul> Ruby master - Feature #4424: [ext/openssl] Allow public/private key creation from arbitrary datahttps://redmine.ruby-lang.org/issues/4424?journal_id=178802011-06-13T05:39:39ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r32036.<br>
Martin, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>ext/openssl/ossl_pkey.c: added PKey.read module function that allow<br>
reading arbitrary public/private keys from DER-/PEM-encoded File or<br>
string instances.</li>
<li>ext/openssl/ossl_pkey_dh.c: improved documentation.</li>
<li>test/openssl/utils.rb: added EC test key.</li>
<li>test/openssl/test_pkey_rsa.rb<br>
test/openssl/test_pkey_dsa.rb: Test PKey.read. Reuse keys from<br>
OpenSSL::TestUtils.</li>
<li>test/openssl/test_pkey_ec.rb: Created test file for EC tests.<br>
Test PKey.read.<br>
[Ruby 1.9 - Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: [ext/openssl] Allow public/private key creation from arbitrary data (Closed)" href="https://redmine.ruby-lang.org/issues/4424">#4424</a>] <a href="/issues/4424">[ruby-core:35330]</a></li>
</ul> Ruby master - Feature #4424: [ext/openssl] Allow public/private key creation from arbitrary datahttps://redmine.ruby-lang.org/issues/4424?journal_id=178812011-06-13T05:47:36ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul></ul><p>I added the PKey.read functionality as a new (backward-compatible) feature to the PKey module.</p>
<p>Regards,<br>
Martin</p>