[前][次][番号順一覧][スレッド一覧]

ruby-changes:61238

From: Bart <ko1@a...>
Date: Wed, 13 May 2020 15:48:20 +0900 (JST)
Subject: [ruby-changes:61238] a7145c3de4 (master): [ruby/openssl] Fix signing example to not use Digest instance

https://git.ruby-lang.org/ruby.git/commit/?id=a7145c3de4

From a7145c3de4ddbe9f90bd6f087afac44a764fae04 Mon Sep 17 00:00:00 2001
From: Bart de Water <bartdewater@g...>
Date: Mon, 20 Apr 2020 18:18:57 -0400
Subject: [ruby/openssl] Fix signing example to not use Digest instance

https://github.com/ruby/openssl/commit/033fb4fbe4

diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 5d3ee74..2f54b86 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -739,16 +739,14 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl.c#L739
  * To sign a document, a cryptographically secure hash of the document is
  * computed first, which is then signed using the private key.
  *
- *   digest = OpenSSL::Digest.new('SHA256')
- *   signature = key.sign digest, document
+ *   signature = key.sign 'SHA256', document
  *
  * To validate the signature, again a hash of the document is computed and
  * the signature is decrypted using the public key. The result is then
  * compared to the hash just computed, if they are equal the signature was
  * valid.
  *
- *   digest = OpenSSL::Digest.new('SHA256')
- *   if key.verify digest, signature, document
+ *   if key.verify 'SHA256', signature, document
  *     puts 'Valid'
  *   else
  *     puts 'Invalid'
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]