Module: JWT::JWA::Compat::ClassMethods

Defined in:
lib/jwt/jwa/compat.rb

Instance Method Summary collapse

Instance Method Details

#from_algorithm(algorithm) ⇒ Object



7
8
9
# File 'lib/jwt/jwa/compat.rb', line 7

def from_algorithm(algorithm)
  new(algorithm)
end

#sign(algorithm, msg, key) ⇒ Object



11
12
13
14
15
# File 'lib/jwt/jwa/compat.rb', line 11

def sign(algorithm, msg, key)
  Deprecations.warning('Support for calling sign with positional arguments will be removed in future ruby-jwt versions')

  from_algorithm(algorithm).sign(data: msg, signing_key: key)
end

#verify(algorithm, key, signing_input, signature) ⇒ Object



17
18
19
20
21
# File 'lib/jwt/jwa/compat.rb', line 17

def verify(algorithm, key, signing_input, signature)
  Deprecations.warning('Support for calling verify with positional arguments will be removed in future ruby-jwt versions')

  from_algorithm(algorithm).verify(data: signing_input, signature: signature, verification_key: key)
end