diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-07-03 14:58:55 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-07-03 14:58:55 +0900 |
commit | 4bdb3b8fa7c39d497f7acd55981b776f3c014fae (patch) | |
tree | c8b1071e503e63c92132f28d08bbd64c46408bf0 | |
parent | 08e1881f5663ceb3527c8953f353dfaef42062fb (diff) | |
download | ruby-openssl-4bdb3b8fa7c39d497f7acd55981b776f3c014fae.tar.gz |
Improve 'Loading a key' section of the documentationtopic/fix-doc-pkey-loading
Show the return values of both PKey::RSA#public? and #private? for each
two .pem files. The current example is not technically incorrect, but
very confusing.
This is based on the reports by Rob Nichols and Brett Goulder.
[Bug #10115] [GH ruby/openssl#52]
-rw-r--r-- | ext/openssl/ossl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 83baa7b6..04120070 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -660,10 +660,12 @@ static void Init_ossl_locks(void) * * key2 = OpenSSL::PKey::RSA.new File.read 'private_key.pem' * key2.public? # => true + * key2.private? # => true * * or * * key3 = OpenSSL::PKey::RSA.new File.read 'public_key.pem' + * key3.public? # => true * key3.private? # => false * * === Loading an Encrypted Key |