Sha256: acd1513c19fe410dd0f59a3b03ecb8113dac63a90196319dd83a8d8802214f8d

Contents?: true

Size: 479 Bytes

Versions: 3

Compression:

Stored size: 479 Bytes

Contents

# frozen_string_literal: true

require 'xml/kit/crypto/oaep_cipher'
require 'xml/kit/crypto/rsa_cipher'
require 'xml/kit/crypto/symmetric_cipher'
require 'xml/kit/crypto/unknown_cipher'

module Xml
  module Kit
    module Crypto
      CIPHERS = [SymmetricCipher, RsaCipher, OaepCipher, UnknownCipher].freeze

      # @!visibility private
      def self.cipher_for(algorithm, key)
        CIPHERS.find { |x| x.matches?(algorithm) }.new(algorithm, key)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xml-kit-0.1.14 lib/xml/kit/crypto.rb
xml-kit-0.1.13 lib/xml/kit/crypto.rb
xml-kit-0.1.12 lib/xml/kit/crypto.rb