Class: SAML2::Key::EncryptionMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/saml2/key.rb

Defined Under Namespace

Modules: Algorithm

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(algorithm = Algorithm::AES128_CBC, key_size = 128) ⇒ EncryptionMethod

Returns a new instance of EncryptionMethod.



17
18
19
# File 'lib/saml2/key.rb', line 17

def initialize(algorithm = Algorithm::AES128_CBC, key_size = 128)
  @algorithm, @key_size = algorithm, key_size
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



15
16
17
# File 'lib/saml2/key.rb', line 15

def algorithm
  @algorithm
end

#key_sizeObject

Returns the value of attribute key_size.



15
16
17
# File 'lib/saml2/key.rb', line 15

def key_size
  @key_size
end

Instance Method Details

#build(builder) ⇒ Object



21
22
23
24
25
# File 'lib/saml2/key.rb', line 21

def build(builder)
  builder['md'].EncryptionMethod('Algorithm' => algorithm) do |encryption_method|
    encryption_method['xenc'].KeySize(key_size) if key_size
  end
end