This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

OpenSSL::PKey::DH

        # OpenSSL::PKey::DH < OpenSSL::PKey::PKey

---
# Includes:
OpenSSL::Marshal (from ruby core)

(from ruby core)
---

An implementation of the Diffie-Hellman key exchange protocol based on
discrete logarithms in finite fields, the same basis that DSA is built
on.

### Accessor methods for the Diffie-Hellman parameters
DH#p
:   The prime (an OpenSSL::BN) of the Diffie-Hellman parameters.
DH#g
:   The generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.
DH#pub_key
:   The per-session public key (an OpenSSL::BN) matching the private
    key. This needs to be passed to DH#compute_key.
DH#priv_key
:   The per-session private key, an OpenSSL::BN.


### Example of a key exchange
    # you may send the parameters (der) and own public key (pub1) publicly
    # to the participating party
    dh1 = OpenSSL::PKey::DH.new(2048)
    der = dh1.to_der
    pub1 = dh1.pub_key

    # the other party generates its per-session key pair
    dhparams = OpenSSL::PKey::DH.new(der)
    dh2 = OpenSSL::PKey.generate_key(dhparams)
    pub2 = dh2.pub_key

    symm_key1 = dh1.compute_key(pub2)
    symm_key2 = dh2.compute_key(pub1)
    puts symm_key1 == symm_key2 # => true
---
# Class methods:

    generate
    new

# Instance methods:

    compute_key
    export
    generate_key!
    initialize_copy
    params
    params_ok?
    private?
    public?
    public_key
    set_key
    set_pqg
    to_der
    to_pem
    to_s


      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.