Class: SAML2::Role Abstract

Inherits:
Base
  • Object
show all
Includes:
OrganizationAndContacts, Signable
Defined in:
lib/saml2/role.rb

Overview

This class is abstract.

Direct Known Subclasses

SSO

Defined Under Namespace

Modules: Protocols

Instance Attribute Summary collapse

Attributes included from OrganizationAndContacts

#contacts, #organization

Attributes inherited from Base

#xml

Instance Method Summary collapse

Methods included from Signable

#sign, #signature, #signed?, #signing_key, #valid_signature?, #validate_signature

Methods inherited from Base

#decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml

Constructor Details

#initializeRole

Returns a new instance of Role.



31
32
33
34
35
36
37
38
# File 'lib/saml2/role.rb', line 31

def initialize
  super
  @supported_protocols = Set.new
  @supported_protocols << Protocols::SAML2
  @keys = []
  @private_keys = []
  @fingerprints = []
end

Instance Attribute Details

#fingerprintsObject

Non-serialized field representing fingerprints of certificates that you don’t actually have the full certificate for.



29
30
31
# File 'lib/saml2/role.rb', line 29

def fingerprints
  @fingerprints
end

#keysArray<KeyDescriptor>

Returns:



54
55
56
# File 'lib/saml2/role.rb', line 54

def keys
  @keys ||= load_object_array(xml, "md:KeyDescriptor", KeyDescriptor)
end

#private_keysArray<OpenSSL::PKey>

Non-serialized field representing private keys for performing decryption/signing operations

Returns:

  • (Array<OpenSSL::PKey>)


25
26
27
# File 'lib/saml2/role.rb', line 25

def private_keys
  @private_keys
end

#supported_protocolsArray<String>

Returns:

  • (Array<String>)

See Also:



49
50
51
# File 'lib/saml2/role.rb', line 49

def supported_protocols
  @supported_protocols ||= xml["protocolSupportEnumeration"].split
end

Instance Method Details

#encryption_keysArray<KeyDescriptor>

Returns:



64
65
66
# File 'lib/saml2/role.rb', line 64

def encryption_keys
  keys.select(&:encryption?)
end

#from_xml(node) ⇒ void

This method returns an undefined value.

Parse an XML element into this object.

Parameters:

  • node (Nokogiri::XML::Element)


41
42
43
44
45
# File 'lib/saml2/role.rb', line 41

def from_xml(node)
  super
  @supported_protocols = nil
  @keys = nil
end

#signing_keysArray<KeyDescriptor>

Returns:



59
60
61
# File 'lib/saml2/role.rb', line 59

def signing_keys
  keys.select(&:signing?)
end