Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
self
/
root
/
proc
/
self
/
root
/
opt
/
ruby-2.7
/
usr
/
share
/
ri
/
2.7.0
/
system
/
OpenSSL
/
PKey
/
DH
/
//proc/self/root/proc/self/root/opt/ruby-2.7/usr/share/ri/2.7.0/system/OpenSSL/PKey/DH/cdesc-DH.ri
U:RDoc::NormalClass[iI"DH:ETI"OpenSSL::PKey::DH;TI"OpenSSL::PKey::PKey;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"LAn implementation of the Diffie-Hellman key exchange protocol based on ;TI"Ldiscrete logarithms in finite fields, the same basis that DSA is built ;TI"on.;To:RDoc::Markup::BlankLine S:RDoc::Markup::Heading: leveli: textI"7Accessor methods for the Diffie-Hellman parameters;To:RDoc::Markup::List: @type: NOTE:@items[ o:RDoc::Markup::ListItem:@label[I" DH#p;T;[o; ;[I"AThe prime (an OpenSSL::BN) of the Diffie-Hellman parameters.;To;;[I" DH#g;T;[o; ;[I"GThe generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.;To;;[I"DH#pub_key;T;[o; ;[I"KThe per-session public key (an OpenSSL::BN) matching the private key. ;TI"/This needs to be passed to DH#compute_key.;To;;[I"DH#priv_key;T;[o; ;[I"1The per-session private key, an OpenSSL::BN.;T@S;;i; I"Example of a key exchange;To:RDoc::Markup::Verbatim;[ I"'dh1 = OpenSSL::PKey::DH.new(2048) ;TI"Xder = dh1.public_key.to_der #you may send this publicly to the participating party ;TI"&dh2 = OpenSSL::PKey::DH.new(der) ;TI":dh2.generate_key! #generate the per-session key pair ;TI".symm_key1 = dh1.compute_key(dh2.pub_key) ;TI".symm_key2 = dh2.compute_key(dh1.pub_key) ;TI" ;TI"*puts symm_key1 == symm_key2 # => true;T:@format0: @fileI"ext/openssl/ossl_pkey_dh.c;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ [ [[I" class;T[[:public[[I" generate;TI""../ext/openssl/ossl_pkey_dh.c;T[I"new;T@M[:protected[ [:private[ [I" instance;T[[;[[I"compute_key;T@M[I"export;T@M[I"generate_key!;T@M[I"initialize_copy;T@M[I"params;T@M[I"params_ok?;T@M[I" private?;T@M[I"public?;T@M[I"public_key;T@M[I"set_key;T@M[I"set_pqg;T@M[I"to_der;T@M[I"to_pem;T@M[I" to_s;T@M[I"to_text;T@M[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[I"ext/openssl/ossl_pkey.c;TI"OpenSSL::PKey;TcRDoc::NormalModule