diff options
author | Bart de Water <bartdewater@gmail.com> | 2020-04-20 18:18:57 -0400 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2020-05-13 15:47:51 +0900 |
commit | a7145c3de4ddbe9f90bd6f087afac44a764fae04 (patch) | |
tree | d9216a3a62d46b4f65e2af870bda7b8aabe84839 /ext/openssl | |
parent | c85789f9b2882bc95364c5da182a24aa72ca52cc (diff) |
[ruby/openssl] Fix signing example to not use Digest instance
https://github.com/ruby/openssl/commit/033fb4fbe4
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/ossl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 5d3ee741af..2f54b861f1 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) * 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' |