Issue #4418 has been updated by nahi (Hiroshi N.).

Assignee changed from nahi (Hiroshi N.) to MartinBosslet (Martin
Target version changed from 2.0.0 to next minor

I like to keep ext/openssl just reflects OpenSSL API but we already have
some exceptions in API for ease of use.

I postponed this to “next minor” but as we talked at RubyConf, we can
try it at openssl gem (vaporgem ATM.)

Bug #4418: OpenSSL::PKey::DH#public_key

Author: ohai (Ippei Obayashi)
Status: Assigned
Priority: Low
Assignee: MartinBosslet (Martin Bosslet)
Category: ext
Target version: next minor
ruby -v: ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

OpenSSL::PKey::DH#public_key がその名前に反して DH パラメータのみを複製して返しています。
require ‘openssl’
dh = OpenSSL::PKey::DH.generate(1024) # => パラメータと鍵の生成、時間がかかる
p dh.pub_key # => 公開鍵の整数を表示
p dh.public_key.pub_key # => nil

DH の場合、RSAなどのように「公開鍵とパラメータ」を取り出す需要はあまりない