Module: SyrupPay::JweSupportAlgorithm
- Included in:
- JweSerializer
- Defined in:
- lib/jose/jwe/jwe.rb
Constant Summary collapse
- ALG =
[:A128KW, :A256KW]
- ENC =
[:'A128CBC-HS256']
Instance Method Summary collapse
- #alg?(alg) ⇒ Boolean
- #enc?(enc) ⇒ Boolean
- #encryption_algorithm?(enc) ⇒ Boolean
- #json_to_hash(json) ⇒ Object
- #keywrap_algorithm?(alg) ⇒ Boolean
Instance Method Details
#alg?(alg) ⇒ Boolean
11 12 13 |
# File 'lib/jose/jwe/jwe.rb', line 11 def alg?(alg) ALG.include? alg end |
#enc?(enc) ⇒ Boolean
15 16 17 |
# File 'lib/jose/jwe/jwe.rb', line 15 def enc?(enc) ENC.include? enc end |
#encryption_algorithm?(enc) ⇒ Boolean
27 28 29 30 31 32 |
# File 'lib/jose/jwe/jwe.rb', line 27 def encryption_algorithm?(enc) case enc when :'A128CBC-HS256' then SyrupPay::Jwa::A128CbcHmac256Encryption.new else nil end end |
#json_to_hash(json) ⇒ Object
34 35 36 |
# File 'lib/jose/jwe/jwe.rb', line 34 def json_to_hash(json) ActiveSupport::JSON.decode(json).with_indifferent_access end |