From cf92a3ffba6e5e588540e88c0be7db60cf774572 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Wed, 22 Mar 2017 03:51:24 +0900 Subject: pkey: prefer PKey.read over PKey::RSA.new in docs --- ext/openssl/ossl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 2f54b861..ab418764 100644 --- a/ext/openssl/ossl.c +++ b/ext/openssl/ossl.c @@ -679,13 +679,13 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2) * * A key can also be loaded from a file. * - * key2 = OpenSSL::PKey::RSA.new File.read 'private_key.pem' + * key2 = OpenSSL::PKey.read File.read 'private_key.pem' * key2.public? # => true * key2.private? # => true * * or * - * key3 = OpenSSL::PKey::RSA.new File.read 'public_key.pem' + * key3 = OpenSSL::PKey.read File.read 'public_key.pem' * key3.public? # => true * key3.private? # => false * @@ -697,7 +697,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2) * * key4_pem = File.read 'private.secure.pem' * pass_phrase = 'my secure pass phrase goes here' - * key4 = OpenSSL::PKey::RSA.new key4_pem, pass_phrase + * key4 = OpenSSL::PKey.read key4_pem, pass_phrase * * == RSA Encryption * -- cgit v1.2.3