class SAML2::Subject::Confirmation

def build(builder)

(see Base#build)
def build(builder)
  builder["saml"].SubjectConfirmation("Method" => method) do |subject_confirmation|
    if in_response_to ||
       recipient ||
       not_before ||
       not_on_or_after
      subject_confirmation["saml"].SubjectConfirmationData do |subject_confirmation_data|
        subject_confirmation_data.parent["NotBefore"] = not_before.iso8601 if not_before
        subject_confirmation_data.parent["NotOnOrAfter"] = not_on_or_after.iso8601 if not_on_or_after
        subject_confirmation_data.parent["Recipient"] = recipient if recipient
        subject_confirmation_data.parent["InResponseTo"] = in_response_to if in_response_to
      end
    end
  end
end

def from_xml(node)

(see Base#from_xml)
def from_xml(node)
  super
  self.method = node["Method"]
  confirmation_data = node.at_xpath("saml:SubjectConfirmationData", Namespaces::ALL)
  return unless confirmation_data
  self.not_before = Time.parse(confirmation_data["NotBefore"]) if confirmation_data["NotBefore"]
  self.not_on_or_after = Time.parse(confirmation_data["NotOnOrAfter"]) if confirmation_data["NotOnOrAfter"]
  self.recipient = confirmation_data["Recipient"]
  self.in_response_to = confirmation_data["InResponseTo"]
end