class DhParams
def dh_params?
def dh_params? !@dh_params.nil? end
def generator
def generator return if @dh_params.nil? @dh_params.g.to_i end
def initialize(filename)
def initialize(filename) @dh_params_path = filename @dh_params = OpenSSL::PKey::DH.new read_file_content(@dh_params_path) end
def modulus
def modulus return if @dh_params.nil? '00:' + @dh_params.p.to_s(16).downcase.scan(/.{2}/).join(':') end
def pem
def pem return if @dh_params.nil? @dh_params.to_pem end
def prime_length
def prime_length return if @dh_params.nil? @dh_params.p.num_bits end
def text
def text return if @dh_params.nil? @dh_params.to_text end
def to_s
def to_s "dh_params #{@dh_params_path}" end
def valid?
def valid? return if @dh_params.nil? @dh_params.params_ok? end