Module: OAuth::Signature

### Home Classes Methods

### In Files

- lib/oauth/signature.rb
- lib/oauth/signature/base.rb
- lib/oauth/signature/md5.rb
- lib/oauth/signature/plaintext.rb
- lib/oauth/signature/sha1.rb

### Namespace

- MODULE OAuth::Signature::HMAC
- MODULE OAuth::Signature::RSA
- CLASS OAuth::Signature::Base
- CLASS OAuth::Signature::MD5
- CLASS OAuth::Signature::PLAINTEXT
- CLASS OAuth::Signature::SHA1
- CLASS OAuth::Signature::UnknownSignatureMethod

### Methods

- ::available_methods
- ::body_hash
- ::build
- ::sign
- ::signature_base_string
- ::verify

### Files

- LICENSE
- README.rdoc
- TODO

### Class/Module Index

Quicksearch

- OAuth
- OAuth::AccessToken
- OAuth::CLI
- OAuth::Client
- OAuth::Client::Helper
- OAuth::Consumer
- OAuth::ConsumerToken
- OAuth::Error
- OAuth::Helper
- OAuth::OAuthTestHelper
- OAuth::Problem
- OAuth::RequestProxy
- OAuth::RequestProxy::ActionControllerRequest
- OAuth::RequestProxy::Base
- OAuth::RequestProxy::Curl
- OAuth::RequestProxy::Curl::Easy
- OAuth::RequestProxy::EventMachine
- OAuth::RequestProxy::EventMachine::HttpRequest
- OAuth::RequestProxy::JabberRequest
- OAuth::RequestProxy::MockRequest
- OAuth::RequestProxy::Net
- OAuth::RequestProxy::Net::HTTP
- OAuth::RequestProxy::Net::HTTP::HTTPRequest
- OAuth::RequestProxy::RackRequest
- OAuth::RequestProxy::Typhoeus
- OAuth::RequestProxy::Typhoeus::Request
- OAuth::RequestProxy::UnknownRequestType
- OAuth::RequestToken
- OAuth::Server
- OAuth::ServerToken
- OAuth::Signature
- OAuth::Signature::Base
- OAuth::Signature::HMAC
- OAuth::Signature::HMAC::Base
- OAuth::Signature::HMAC::MD5
- OAuth::Signature::HMAC::RMD160
- OAuth::Signature::HMAC::SHA1
- OAuth::Signature::HMAC::SHA2
- OAuth::Signature::MD5
- OAuth::Signature::PLAINTEXT
- OAuth::Signature::RSA
- OAuth::Signature::RSA::SHA1
- OAuth::Signature::SHA1
- OAuth::Signature::UnknownSignatureMethod
- OAuth::Token
- OAuth::Unauthorized
- ActionController
- ActionController::Base
- ActionController::TestRequest
- Digest
- Digest::HMAC
- EventMachine
- EventMachine::HttpClient
- Net
- Net::HTTPGenericRequest
- Object
- String

No matching classes.

# OAuth::Signature

### Public Class Methods

available_methods() click to toggle source

Returns a list of available signature methods

    # File lib/oauth/signature.rb, line 4
    def self.available_methods
      @available_methods ||= {}
    end

body_hash(request, options = {}, &block) click to toggle source

Create the body hash for a request

    # File lib/oauth/signature.rb, line 39
    def self.body_hash(request, options = {}, &block)
      self.build(request, options, &block).body_hash
    end

build(request, options = {}, &block) click to toggle source

Build a signature from a `request`.

Raises UnknownSignatureMethod exception if the signature method is unknown.

    # File lib/oauth/signature.rb, line 11
    def self.build(request, options = {}, &block)
      request = OAuth::RequestProxy.proxy(request, options)
      klass = available_methods[
        (request.signature_method ||
        ((c = request.options[:consumer]) && c.options[:signature_method]) ||
        "").downcase]
      raise UnknownSignatureMethod, request.signature_method unless klass
      klass.new(request, options, &block)
    end

sign(request, options = {}, &block) click to toggle source

Sign a `request`

    # File lib/oauth/signature.rb, line 22
    def self.sign(request, options = {}, &block)
      self.build(request, options, &block).signature
    end

signature_base_string(request, options = {}, &block) click to toggle source

Create the signature base string for `request`. This string is the normalized parameter information.

See Also: OAuth core spec version 1.0, section 9.1.1

    # File lib/oauth/signature.rb, line 34
    def self.signature_base_string(request, options = {}, &block)
      self.build(request, options, &block).signature_base_string
    end

verify(request, options = {}, &block) click to toggle source

Verify the signature of `request`

    # File lib/oauth/signature.rb, line 27
    def self.verify(request, options = {}, &block)
      self.build(request, options, &block).verify
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.