Module: OAuth::Signature

Defined in:
lib/oauth/signature.rb,
lib/oauth/signature/md5.rb,
lib/oauth/signature/base.rb,
lib/oauth/signature/sha1.rb,
lib/oauth/signature/plaintext.rb

Defined Under Namespace

Modules: HMAC, RSA Classes: Base, MD5, PLAINTEXT, SHA1, UnknownSignatureMethod

Class Method Summary collapse

Class Method Details

.available_methodsObject



3
4
5
# File 'lib/oauth/signature.rb', line 3

def self.available_methods
  @available_methods ||= {}
end

.build(request, options = {}, &block) ⇒ Object



7
8
9
10
11
12
# File 'lib/oauth/signature.rb', line 7

def self.build(request, options = {}, &block)
  request = OAuth::RequestProxy.proxy(request, options)
  klass = available_methods[(request.signature_method || "").downcase]
  raise UnknownSignatureMethod, request.signature_method unless klass
  klass.new(request, options, &block)
end

.sign(request, options = {}, &block) ⇒ Object



14
15
16
# File 'lib/oauth/signature.rb', line 14

def self.sign(request, options = {}, &block)
  self.build(request, options, &block).signature
end

.signature_base_string(request, options = {}, &block) ⇒ Object



22
23
24
# File 'lib/oauth/signature.rb', line 22

def self.signature_base_string(request, options = {}, &block)
  self.build(request, options, &block).signature_base_string
end

.verify(request, options = {}, &block) ⇒ Object



18
19
20
# File 'lib/oauth/signature.rb', line 18

def self.verify(request, options = {}, &block)
  self.build(request, options, &block).verify
end