122
123
124
125
126
127
128
129
130
131
|
# File 'lib/json/jwt.rb', line 122
def decode_json_serialized(input, key_or_secret, algorithms = nil, encryption_methods = nil, allow_blank_payload = false)
input = input.with_indifferent_access
if (input[:signatures] || input[:signature]).present?
JWS.decode_json_serialized input, key_or_secret, algorithms, allow_blank_payload
elsif input[:ciphertext].present?
JWE.decode_json_serialized input, key_or_secret, algorithms, encryption_methods
else
raise InvalidFormat.new("Unexpected JOSE JSON Serialization Format.")
end
end
|