class Object

Public Instance Methods

digest() click to toggle source
# File lib/saml_idp/signable.rb, line 104
def digest
  # Make it check for inclusive at some point (https://github.com/onelogin/ruby-saml/blob/master/lib/xml_security.rb#L159)
  inclusive_namespaces = []
  # Also make customizable
  canon_algorithm = Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0
  canon_hashed_element = noko_raw.canonicalize(canon_algorithm, inclusive_namespaces)
  digest_algorithm = get_algorithm

  hash                          = digest_algorithm.digest(canon_hashed_element)
  Base64.strict_encode64(hash).gsub(/\n/, '')
end
get_algorithm() click to toggle source
# File lib/saml_idp/signable.rb, line 89
def get_algorithm
  send(self.class.algorithm_method)
end
get_digest() click to toggle source
# File lib/saml_idp/signable.rb, line 82
def get_digest
  without_signature do
    send(self.class.digest_method)
  end
end
get_raw() click to toggle source
# File lib/saml_idp/signable.rb, line 94
def get_raw
  send(self.class.raw_method)
end
get_reference_id() click to toggle source
# File lib/saml_idp/signable.rb, line 77
def get_reference_id
  send(self.class.reference_id_method)
end
noko_raw() click to toggle source
# File lib/saml_idp/signable.rb, line 99
def noko_raw
  Nokogiri::XML::Document.parse(get_raw)
end
sign?() click to toggle source
# File lib/saml_idp/signable.rb, line 62
def sign?
  !!@sign
end
signature() click to toggle source
# File lib/saml_idp/signable.rb, line 67
def signature
  SignatureBuilder.new(signed_info_builder).raw
end
signed_info_builder() click to toggle source
# File lib/saml_idp/signable.rb, line 72
def signed_info_builder
  SignedInfoBuilder.new(get_reference_id, get_digest, get_algorithm)
end