Sha256: 04632ad4ea404d2e54e6b9a02d974f228b33aa9d4943c865f03ca204c83ee988

Contents?: true

Size: 396 Bytes

Versions: 2

Compression:

Stored size: 396 Bytes

Contents

module JWE
  module Enc
    # Helper to get OpenSSL cipher instance from a string.
    module Cipher
      class << self
        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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jwe-0.4.0 lib/jwe/enc/cipher.rb
jwe-0.3.1 lib/jwe/enc/cipher.rb