Issue #4418 has been updated by Hiroshi NAKAMURA.

Priority changed from Normal to Low

I agree with DH interface is confusing.

 * DH#p ... DH parameter p
 * DH#g ... DH parameter g
 * DH#public_key ... DH parameter (DHParameterSpec in Java)
 * DH#priv_key ... private value: S
 * DH#pub_key ... exchange value: g^S mod p

We should have PKey::DH::Params class as same as PKey::EC::Point in the future though I don't know it's good to define it as a subclass of DH.

Back to the topic, DH#public_key is needed for exchanging DH parameters (p and g) so we cannot drop it. And we would need new method DH#params as a copy of DH#public_key when we implement DH::Params class.
----------------------------------------
Bug #4418: OpenSSL::PKey::DH#public_key
http://redmine.ruby-lang.org/issues/4418

Author: Ippei Obayashi
Status: Assigned
Priority: Low
Assignee: Hiroshi NAKAMURA
Category: ext
Target version: 
ruby -v: ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]


=begin
 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??????????????????????????????????????????????????????????
 ???????????????????????????????????????????????????????????????止????????????????????????????????
=end



-- 
http://redmine.ruby-lang.org