Class: RSAML::Identifier::Issuer

Inherits:
Name
  • Object
show all
Defined in:
lib/rsaml/identifier/issuer.rb

Overview

provides information about the issuer of a SAML assertion or protocol message. T Requires the use of a string to carry the issuer’s name

Instance Attribute Summary

Attributes inherited from Name

#sp_provided_id, #value

Attributes inherited from Base

#name_qualifier, #sp_name_qualifier

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Name

formats, #initialize

Constructor Details

This class inherits a constructor from RSAML::Identifier::Name

Class Method Details

.from_xml(element) ⇒ Object

Construct an Issuer instance from the given XML Element or fragment.



22
23
24
25
# File 'lib/rsaml/identifier/issuer.rb', line 22

def self.from_xml(element)
  element = REXML::Document.new(element).root if element.is_a?(String)
  Issuer.new(element.text)
end

Instance Method Details

#formatObject

If no Format value is provided with this element, then the value urn:oasis:names:tc:SAML:2.0:nameid-format:entity is in effect



8
9
10
# File 'lib/rsaml/identifier/issuer.rb', line 8

def format
  @format ||= Name.formats[:entity]
end

#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object

Construct an XML fragment representing the issuer



13
14
15
16
17
18
19
# File 'lib/rsaml/identifier/issuer.rb', line 13

def to_xml(xml=Builder::XmlMarkup.new)
  attributes = {'Format' => format}
  attributes['NameQualifier'] = name_qualifier unless name_qualifier.nil?
  attributes['SPNameQualifier'] = sp_name_qualifier unless sp_name_qualifier.nil?
  attributes['SPProvidedID'] = sp_provided_id unless sp_provided_id.nil?
  xml.tag!('saml:Issuer', value, attributes)
end