Class: Xml::Kit::Encryption Deprecated

Inherits:
EncryptedData show all
Defined in:
lib/xml/kit/encryption.rb

Overview

Deprecated.

Use EncryptedData class instead of this

Constant Summary collapse

DEFAULT_SYMMETRIC =
Crypto::SymmetricCipher::DEFAULT_ALGORITHM
DEFAULT_ASYMMETRIC =
Crypto::RsaCipher::ALGORITHM

Instance Attribute Summary collapse

Attributes inherited from EncryptedData

#id, #symmetric_cipher

Instance Method Summary collapse

Methods inherited from EncryptedData

#render, #to_xml

Constructor Details

#initialize(raw_xml, public_key, symmetric_algorithm: DEFAULT_SYMMETRIC, asymmetric_algorithm: DEFAULT_ASYMMETRIC, key_info: nil) ⇒ Encryption

Returns a new instance of Encryption.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/xml/kit/encryption.rb', line 15

def initialize(raw_xml, public_key,
               symmetric_algorithm: DEFAULT_SYMMETRIC,
               asymmetric_algorithm: DEFAULT_ASYMMETRIC, key_info: nil)
  @symmetric_algorithm = symmetric_algorithm
  @asymmetric_algorithm = asymmetric_algorithm
  Xml::Kit.deprecate('Encryption', alternative: 'EncryptedData')
  super(raw_xml,
    symmetric_cipher: symmetric(symmetric_algorithm),
    asymmetric_cipher: asymmetric(asymmetric_algorithm, public_key),
    key_info: key_info
  )
end

Instance Attribute Details

#asymmetric_algorithmObject (readonly)

Returns the value of attribute asymmetric_algorithm.



10
11
12
# File 'lib/xml/kit/encryption.rb', line 10

def asymmetric_algorithm
  @asymmetric_algorithm
end

#key_infoObject (readonly)

Returns the value of attribute key_info.



13
14
15
# File 'lib/xml/kit/encryption.rb', line 13

def key_info
  @key_info
end

#symmetric_algorithmObject (readonly)

Returns the value of attribute symmetric_algorithm.



11
12
13
# File 'lib/xml/kit/encryption.rb', line 11

def symmetric_algorithm
  @symmetric_algorithm
end

#symmetric_cipher_valueObject (readonly)

Returns the value of attribute symmetric_cipher_value.



12
13
14
# File 'lib/xml/kit/encryption.rb', line 12

def symmetric_cipher_value
  @symmetric_cipher_value
end

Instance Method Details

#template_pathObject



28
29
30
# File 'lib/xml/kit/encryption.rb', line 28

def template_path
  Template::TEMPLATES_DIR.join('encrypted_data.builder')
end