Sha256: ac2cbbbcc90e9db697083a855d467d97022df133ce983ccfe62ca0dc31296c3c

Contents?: true

Size: 1.4 KB

Versions: 20

Compression:

Stored size: 1.4 KB

Contents

require 'spec_helper'
module SamlIdp
  describe SignedInfoBuilder do
    let(:reference_id) { "abc" }
    let(:digest) { "em8csGAWynywpe8S4nN64o56/4DosXi2XWMY6RJ6YfA=" }
    let(:algorithm) { :sha256 }
    subject { described_class.new(
      reference_id,
      digest,
      algorithm
    ) }

    before do
      Time.stub now: Time.parse("Jul 31 2013")
    end

    it "builds a legit raw XML file" do
      subject.raw.should == "<ds:SignedInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"><ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"></ds:CanonicalizationMethod><ds:SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\"></ds:SignatureMethod><ds:Reference URI=\"#_abc\"><ds:Transforms><ds:Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"></ds:Transform><ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\"></ds:DigestMethod><ds:DigestValue>em8csGAWynywpe8S4nN64o56/4DosXi2XWMY6RJ6YfA=</ds:DigestValue></ds:Reference></ds:SignedInfo>"
    end

    it "builds a legit digest of the XML file" do
      subject.signed.should == "hKLeWLRgatHcV6N5Fc8aKveqNp6Y/J4m2WSYp0awGFtsCTa/2nab32wI3du+3kuuIy59EDKeUhHVxEfyhoHUo6xTZuO2N7XcTpSonuZ/CB3WjozC2Q/9elss3z1rOC3154v5pW4puirLPRoG+Pwi8SmptxNRHczr6NvmfYmmGfo="
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
saml_idp-0.7.2 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.7.1 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.7.0 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.6.0 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.5.0 spec/lib/saml_idp/signed_info_builder_spec.rb
icn_saml_idp-0.4.1 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.4.0 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.3.2 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.3.1 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.3.0 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.2.1 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.2.0 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.2.0.pre spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.1.1 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.1.0 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.0.10 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.0.9 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.0.8 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.0.7 spec/lib/saml_idp/signed_info_builder_spec.rb
saml_idp-0.0.6 spec/lib/saml_idp/signed_info_builder_spec.rb