Sha256: 2ea2aac998b2997f5840276f2eec630c34a9c2cdf221bc44d911f732830bbc77

Contents?: true

Size: 474 Bytes

Versions: 17

Compression:

Stored size: 474 Bytes

Contents

module Saml
  module Kit
    module Builders
      class XmlEncryption
        attr_reader :public_key
        attr_reader :key, :iv, :encrypted

        def initialize(raw_xml, public_key)
          @public_key = public_key
          cipher = OpenSSL::Cipher.new('AES-256-CBC')
          cipher.encrypt
          @key = cipher.random_key
          @iv = cipher.random_iv
          @encrypted = cipher.update(raw_xml) + cipher.final
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
saml-kit-0.3.0 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.18 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.17 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.16 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.15 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.14 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.13 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.12 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.11 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.10 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.9 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.8 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.7 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.6 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.5 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.4 lib/saml/kit/builders/xml_encryption.rb
saml-kit-0.2.3 lib/saml/kit/builders/xml_encryption.rb