Module: JWE::Enc::Cipher

Defined in:
lib/jwe/enc/cipher.rb

Overview

Helper to get OpenSSL cipher instance from a string.

Class Method Summary collapse

Class Method Details

.for(cipher_name) ⇒ Object


6
7
8
9
10
# File 'lib/jwe/enc/cipher.rb', line 6

def for(cipher_name)
  OpenSSL::Cipher.new(cipher_name)
rescue RuntimeError
  raise JWE::NotImplementedError.new("The version of OpenSSL linked to your Ruby does not support the cipher #{cipher_name}.")
end