Sha256: b45b51b157c56b2cb752dc324cefff2112cc73394c77bbbaab35d6663fbecf18

Contents?: true

Size: 379 Bytes

Versions: 6

Compression:

Stored size: 379 Bytes

Contents

require "oauth/signature/base"

module OAuth::Signature::HMAC
  class SHA1 < OAuth::Signature::Base
    implements "hmac-sha1"

    def body_hash
      Base64.encode64(OpenSSL::Digest::SHA1.digest(request.body || "")).chomp.delete("\n")
    end

    private

    def digest
      OpenSSL::HMAC.digest(OpenSSL::Digest.new("sha1"), secret, signature_base_string)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
oauth-0.5.14 lib/oauth/signature/hmac/sha1.rb
oauth-0.5.13 lib/oauth/signature/hmac/sha1.rb
oauth-0.5.12 lib/oauth/signature/hmac/sha1.rb
oauth-0.5.11 lib/oauth/signature/hmac/sha1.rb
oauth-0.5.10 lib/oauth/signature/hmac/sha1.rb
oauth-0.5.9 lib/oauth/signature/hmac/sha1.rb