@@ -739,15 +739,15 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
739739 * To sign a document, a cryptographically secure hash of the document is
740740 * computed first, which is then signed using the private key.
741741 *
742- * digest = OpenSSL::Digest::SHA256 .new
742+ * digest = OpenSSL::Digest.new('SHA256')
743743 * signature = key.sign digest, document
744744 *
745745 * To validate the signature, again a hash of the document is computed and
746746 * the signature is decrypted using the public key. The result is then
747747 * compared to the hash just computed, if they are equal the signature was
748748 * valid.
749749 *
750- * digest = OpenSSL::Digest::SHA256 .new
750+ * digest = OpenSSL::Digest.new('SHA256')
751751 * if key.verify digest, signature, document
752752 * puts 'Valid'
753753 * else
@@ -782,7 +782,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
782782 * salt = OpenSSL::Random.random_bytes 16
783783 * iter = 20000
784784 * key_len = cipher.key_len
785- * digest = OpenSSL::Digest::SHA256 .new
785+ * digest = OpenSSL::Digest.new('SHA256')
786786 *
787787 * key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
788788 * cipher.key = key
@@ -805,7 +805,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
805805 * salt = ... # the one generated above
806806 * iter = 20000
807807 * key_len = cipher.key_len
808- * digest = OpenSSL::Digest::SHA256 .new
808+ * digest = OpenSSL::Digest.new('SHA256')
809809 *
810810 * key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
811811 * cipher.key = key
@@ -901,7 +901,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
901901 * certificate.
902902 *
903903 * cert.issuer = name
904- * cert.sign key, OpenSSL::Digest::SHA1 .new
904+ * cert.sign key, OpenSSL::Digest.new('SHA1')
905905 *
906906 * open 'certificate.pem', 'w' do |io| io.write cert.to_pem end
907907 *
@@ -977,7 +977,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
977977 *
978978 * Root CA certificates are self-signed.
979979 *
980- * ca_cert.sign ca_key, OpenSSL::Digest::SHA1 .new
980+ * ca_cert.sign ca_key, OpenSSL::Digest.new('SHA1')
981981 *
982982 * The CA certificate is saved to disk so it may be distributed to all the
983983 * users of the keys this CA will sign.
@@ -995,7 +995,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
995995 * csr.version = 0
996996 * csr.subject = name
997997 * csr.public_key = key.public_key
998- * csr.sign key, OpenSSL::Digest::SHA1 .new
998+ * csr.sign key, OpenSSL::Digest.new('SHA1')
999999 *
10001000 * A CSR is saved to disk and sent to the CA for signing.
10011001 *
@@ -1039,7 +1039,7 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
10391039 * csr_cert.add_extension \
10401040 * extension_factory.create_extension('subjectKeyIdentifier', 'hash')
10411041 *
1042- * csr_cert.sign ca_key, OpenSSL::Digest::SHA1 .new
1042+ * csr_cert.sign ca_key, OpenSSL::Digest.new('SHA1')
10431043 *
10441044 * open 'csr_cert.pem', 'w' do |io|
10451045 * io.write csr_cert.to_pem
0 commit comments