summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkey_dh.c
diff options
context:
space:
mode:
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 01:58:09 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 01:58:09 +0000
commita27b63d3fc1c491eda62a8a48527df53301f45ce (patch)
tree79f9a2aecb1e1e1f45044a87c31a99e715bee099 /ext/openssl/ossl_pkey_dh.c
parent149f35fc6ee42eb006300378daf002d998a9a07f (diff)
* ext/openssl/pkey_dh.c: corrected documentation.
* test/openssl/utils.rb: add test key for DH. * test/openssl/test_pkey_dh.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_dh.c')
-rw-r--r--ext/openssl/ossl_pkey_dh.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 464f41b..d0faef5 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -137,9 +137,9 @@ ossl_dh_s_generate(int argc, VALUE *argv, VALUE klass)
*
* Either generates a DH instance from scratch or by reading already existing
* DH parameters from +string+. Note that when reading a DH instance from
- * data that was encoded from a DH#public_key DH instance the result
- * will *not* contain a public/private key pair yet. This needs to be
- * generated using DH#generate_key! first.
+ * data that was encoded from a DH instance by using DH#to_pem or DH#to_der
+ * the result will *not* contain a public/private key pair yet. This needs to
+ * be generated using DH#generate_key! first.
*
* === Parameters
* * +size+ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
@@ -150,9 +150,7 @@ ossl_dh_s_generate(int argc, VALUE *argv, VALUE klass)
* DH.new # -> dh
* DH.new(1024) # -> dh
* DH.new(1024, 5) # -> dh
- * #Reading a "private" DH key
- * DH.new(File.read('key.pem')) # -> dh
- * #Reading public DH parameters
+ * #Reading DH parameters
* dh = DH.new(File.read('parameters.pem')) # -> dh, but no public/private key yet
* dh.generate_key! # -> dh with public and private key
*/
@@ -237,7 +235,9 @@ ossl_dh_is_private(VALUE self)
* call-seq:
* dh.to_pem -> aString
*
- * Encodes this DH to its PEM encoding.
+ * Encodes this DH to its PEM encoding. Note that any existing per-session
+ * public/private keys will *not* get encoded, just the Diffie-Hellman
+ * parameters will be encoded.
*/
static VALUE
ossl_dh_export(VALUE self)
@@ -263,7 +263,10 @@ ossl_dh_export(VALUE self)
* call-seq:
* dh.to_der -> aString
*
- * Encodes this DH to its DER encoding.
+ * Encodes this DH to its DER encoding. Note that any existing per-session
+ * public/private keys will *not* get encoded, just the Diffie-Hellman
+ * parameters will be encoded.
+
*/
static VALUE
ossl_dh_to_der(VALUE self)