Bug #9243 » 0001-DOC-fix-example-to-exchane-key-using-DH.patch
ext/openssl/ossl_pkey_dh.c | ||
---|---|---|
*
|
||
* === Example of a key exchange
|
||
* dh1 = OpenSSL::PKey::DH.new(2048)
|
||
* params = dh1.public_key.to_der #you may send this publicly to the participating party
|
||
* der = dh1.public_key.to_der #you may send this publicly to the participating party
|
||
* dh2 = OpenSSL::PKey::DH.new(der)
|
||
* dh2.generate_key! #generate the per-session key pair
|
||
* symm_key1 = dh1.compute_key(dh2.pub_key)
|
||
... | ... | |
{
|
||
}
|
||
#endif /* NO_DH */
|
||