Class: Xml::Kit::Encryption Deprecated

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

Overview

Deprecated.

Use EncryptedData class instead of this

Instance Attribute Summary collapse

Attributes inherited from EncryptedData

#symmetric_cipher

Instance Method Summary collapse

Methods inherited from EncryptedData

#render, #to_xml

Constructor Details

#initialize(raw_xml, public_key, symmetric_algorithm: Crypto::SymmetricCipher::DEFAULT_ALGORITHM, asymmetric_algorithm: Crypto::RsaCipher::ALGORITHM, key_info: nil) ⇒ Encryption

Returns a new instance of Encryption.



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

def initialize(
  raw_xml,
  public_key,
  symmetric_algorithm: Crypto::SymmetricCipher::DEFAULT_ALGORITHM,
  asymmetric_algorithm: Crypto::RsaCipher::ALGORITHM,
  key_info: nil
)
  @symmetric_algorithm = symmetric_algorithm
  @asymmetric_algorithm = asymmetric_algorithm
  Xml::Kit.deprecate('Encryption is deprecated. Use 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.



7
8
9
# File 'lib/xml/kit/encryption.rb', line 7

def asymmetric_algorithm
  @asymmetric_algorithm
end

#key_infoObject (readonly)

Returns the value of attribute key_info.



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

def key_info
  @key_info
end

#symmetric_algorithmObject (readonly)

Returns the value of attribute symmetric_algorithm.



8
9
10
# File 'lib/xml/kit/encryption.rb', line 8

def symmetric_algorithm
  @symmetric_algorithm
end

#symmetric_cipher_valueObject (readonly)

Returns the value of attribute symmetric_cipher_value.



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

def symmetric_cipher_value
  @symmetric_cipher_value
end

Instance Method Details

#template_pathObject



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

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