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.


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

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.


27
28
29
# File 'lib/saml2/role.rb', line 27

def fingerprints
  @fingerprints
end

#keysArray<KeyDescriptor>

Returns:


52
53
54
# File 'lib/saml2/role.rb', line 52

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>)

23
24
25
# File 'lib/saml2/role.rb', line 23

def private_keys
  @private_keys
end

#supported_protocolsArray<String>

Returns:

  • (Array<String>)

See Also:


47
48
49
# File 'lib/saml2/role.rb', line 47

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

Instance Method Details

#encryption_keysArray<KeyDescriptor>

Returns:


62
63
64
# File 'lib/saml2/role.rb', line 62

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)

39
40
41
42
43
# File 'lib/saml2/role.rb', line 39

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

#signing_keysArray<KeyDescriptor>

Returns:


57
58
59
# File 'lib/saml2/role.rb', line 57

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