class Ronin::Support::Crypto::Key::DH
Represents an Diffie-Hellman (DH
) key.
@see rubydoc.info/stdlib/openssl/OpenSSL/PKey/DH.html
@since 1.0.0
@api public
Public Class Methods
Source
# File lib/ronin/support/crypto/key/dh.rb, line 55 def self.generate(key_size=1024, generator: nil) new_key = allocate new_key.send(:initialize_copy,super(key_size,*generator)) new_key end
Generates a new DH
key.
@param [Integer] key_size
The size of the key in bits.
@param [Integer, nil] generator
A small number > 1, typically 2 or 5.
@return [DH]
The newly generated key.
@note
jruby's openssl does not define `OpenSSL::PKey::DH.generate`. See https://github.com/jruby/jruby-openssl/issues/254
Calls superclass method
Public Instance Methods
Source
# File lib/ronin/support/crypto/key/dh.rb, line 94 def g super() end
The ‘g` variable for the DH
key.
@return [OpenSSL::BN]
@see rubydoc.info/stdlib/openssl/OpenSSL/BN
Calls superclass method
Source
# File lib/ronin/support/crypto/key/dh.rb, line 68 def p super() end
The ‘p` variable for the DH
key.
@return [OpenSSL::BN]
@see rubydoc.info/stdlib/openssl/OpenSSL/BN
Calls superclass method
Source
# File lib/ronin/support/crypto/key/dh.rb, line 83 def q super() unless RUBY_ENGINE == 'jruby' end
The ‘q` variable for the DH
key.
@return [OpenSSL::BN, nil]
@see rubydoc.info/stdlib/openssl/OpenSSL/BN
@note
jruby's openssl does not implement `OpenSSL::PKey::DH#q`. See https://github.com/jruby/jruby-openssl/issues/253
Calls superclass method
Source
# File lib/ronin/support/crypto/key/dh.rb, line 114 def save(path) super(path) end
Saves the DH
key to the given file.
@param [String] path
The path to the output file.
Calls superclass method
Ronin::Support::Crypto::Key::Methods#save