@@ -3665,6 +3665,23 @@ module OpenSSL
36653665 #
36663666 def self.hexdigest : (String | Digest algo, String key, String data) -> String
36673667
3668+ # <!--
3669+ # rdoc-file=ext/openssl/lib/openssl/hmac.rb
3670+ # - HMAC.base64digest(digest, key, data) -> aString
3671+ # -->
3672+ # Returns the authentication code as a Base64-encoded string. The *digest*
3673+ # parameter specifies the digest algorithm to use. This may be a String
3674+ # representing the algorithm name or an instance of OpenSSL::Digest.
3675+ #
3676+ # ### Example
3677+ # key = 'key'
3678+ # data = 'The quick brown fox jumps over the lazy dog'
3679+ #
3680+ # hmac = OpenSSL::HMAC.base64digest('SHA1', key, data)
3681+ # #=> "3nybhbi3iqa8ino29wqQcBydtNk="
3682+ #
3683+ def self.base64digest : (String | Digest algo, String key, String data) -> String
3684+
36683685 # <!-- rdoc-file=ext/openssl/ossl_hmac.c -->
36693686 # Returns *hmac* updated with the message to be authenticated. Can be called
36703687 # repeatedly with chunks of the message.
@@ -3712,6 +3729,14 @@ module OpenSSL
37123729 #
37133730 def hexdigest : () -> String
37143731
3732+ # <!--
3733+ # rdoc-file=ext/openssl/lib/openssl/hmac.rb
3734+ # - hmac.base64digest -> string
3735+ # -->
3736+ # Returns the authentication code an a Base64-encoded string.
3737+ #
3738+ def base64digest : () -> String
3739+
37153740 # <!-- rdoc-file=ext/openssl/lib/openssl/hmac.rb -->
37163741 # Returns the authentication code as a hex-encoded string. The *digest*
37173742 # parameter specifies the digest algorithm to use. This may be a String
0 commit comments