Module: JsonJws::Decode
- Included in:
- JSON_JWS
- Defined in:
- lib/json_jws/decode.rb
Instance Method Summary collapse
Instance Method Details
#decode(jws, validate = true) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/json_jws/decode.rb', line 6 def decode(jws, validate = true) signatures = jws["signatures"].map do |signature| { protected: JSON.load(Base64.urlsafe_decode64(signature["protected"])), signature: signature["signature"], } end { "payload" => Base64.urlsafe_decode64(jws["payload"]), "signatures" => signatures, } end |