Sha256: 1832977336e5698d7d1584f7389276178d93337b2a4b5f18182a0f958a54d42b
Contents?: true
Size: 785 Bytes
Versions: 10
Compression:
Stored size: 785 Bytes
Contents
require 'spec_helper' require 'saml_idp/encryptor' module SamlIdp describe Encryptor do let (:encryption_opts) do { cert: Default::X509_CERTIFICATE, block_encryption: 'aes256-cbc', key_transport: 'rsa-oaep-mgf1p', } end subject { described_class.new encryption_opts } it "encrypts XML" do raw_xml = '<foo>bar</foo>' encrypted_xml = subject.encrypt(raw_xml) encrypted_xml.should_not match 'bar' encrypted_doc = Nokogiri::XML::Document.parse(encrypted_xml) encrypted_data = Xmlenc::EncryptedData.new(encrypted_doc.at_xpath('//xenc:EncryptedData', Xmlenc::NAMESPACES)) decrypted_xml = encrypted_data.decrypt(subject.encryption_key) decrypted_xml.should == raw_xml end end end
Version data entries
10 entries across 10 versions & 2 rubygems