diff options
author | Kazuki Yamaguchi <[email protected]> | 2017-03-22 03:51:24 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <[email protected]> | 2021-03-16 19:16:10 +0900 |
commit | 10d360847baf3394b7d9cd0dca6fa6908a2ce604 () | |
tree | e002efb69ac76d6d34d47ff7d76f7c7d65c67339 | |
parent | efad0166c660d565d5e80e862cd9ff9457f8ed03 (diff) |
[ruby/openssl] pkey: prefer PKey.read over PKey::RSA.new in docs
https://.com/ruby/openssl/commit/cf92a3ffba
Notes: Merged: https://.com/ruby/ruby/pull/4275
-rw-r--r-- | ext/openssl/ossl.c | 6 | ||||
-rw-r--r-- | sample/openssl/echo_cli.rb | 2 | ||||
-rw-r--r-- | sample/openssl/echo_svr.rb | 2 | ||||
-rw-r--r-- | sample/openssl/gen_csr.rb | 2 | ||||
-rw-r--r-- | sample/openssl/smime_read.rb | 2 | ||||
-rw-r--r-- | sample/openssl/smime_write.rb | 2 |
6 files changed, 8 insertions, 8 deletions
@@ -682,13 +682,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.public? # => true * key2.private? # => true * * or * - * key3 = OpenSSL::PKey::RSA.new File.read 'public_key.pem' * key3.public? # => true * key3.private? # => false * @@ -700,7 +700,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 * * == RSA Encryption * @@ -15,7 +15,7 @@ ca_path = options["C"] ctx = OpenSSL::SSL::SSLContext.new() if cert_file && key_file ctx.cert = OpenSSL::X509::Certificate.new(File::read(cert_file)) - ctx.key = OpenSSL::PKey::RSA.new(File::read(key_file)) end if ca_path ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER @@ -13,7 +13,7 @@ ca_path = options["C"] if cert_file && key_file cert = OpenSSL::X509::Certificate.new(File::read(cert_file)) - key = OpenSSL::PKey::RSA.new(File::read(key_file)) else key = OpenSSL::PKey::RSA.new(512){ print "." } puts @@ -25,7 +25,7 @@ name = X509::Name.parse(name_str) keypair = nil if keypair_file - keypair = PKey::RSA.new(File.open(keypair_file).read) else keypair = PKey::RSA.new(1024) { putc "." } puts @@ -11,7 +11,7 @@ ca_path = options["C"] data = $stdin.read cert = X509::Certificate.new(File::read(cert_file)) -key = PKey::RSA.new(File::read(key_file)) p7enc = PKCS7::read_smime(data) data = p7enc.decrypt(key, cert) @@ -9,7 +9,7 @@ key_file = options["k"] rcpt_file = options["r"] cert = X509::Certificate.new(File::read(cert_file)) -key = PKey::RSA.new(File::read(key_file)) data = "Content-Type: text/plain\r\n" data << "\r\n" |