Class: RSAML::EncryptedAttribute

Inherits:
Encrypted show all
Defined in:
lib/rsaml/attribute.rb

Overview

An encrypted attribute.

Instance Attribute Summary

Attributes inherited from Encrypted

#encrypted_data

Instance Method Summary collapse

Methods inherited from Encrypted

#encrypted_keys

Instance Method Details

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

Construct an XML fragment representing the encrypted attribute



69
70
71
72
73
74
# File 'lib/rsaml/attribute.rb', line 69

def to_xml(xml=Builder::XmlMarkup.new)
  xml.tag!('saml:EncryptedAttribute') {
    xml.tag!('xenc:EncryptedData', encrypted_data)
    encrypted_keys.each { |key| xml << key.to_xml }
  }
end

#validateObject

Validate the structure

Raises:



64
65
66
# File 'lib/rsaml/attribute.rb', line 64

def validate
  raise ValidationError, "Encrypted data is required" if encrypted_data.nil?
end