lib/xml/kit/encryption.rb in xml-kit-0.3.1 vs lib/xml/kit/encryption.rb in xml-kit-0.4.0
- old
+ new
@@ -2,24 +2,23 @@
module Xml
module Kit
# @deprecated Use {#Xml::Kit::EncryptedData} class instead of this
class Encryption < EncryptedData
+ DEFAULT_SYMMETRIC = Crypto::SymmetricCipher::DEFAULT_ALGORITHM
+ DEFAULT_ASYMMETRIC = Crypto::RsaCipher::ALGORITHM
+
attr_reader :asymmetric_algorithm
attr_reader :symmetric_algorithm
attr_reader :symmetric_cipher_value
attr_reader :key_info
- def initialize(
- raw_xml,
- public_key,
- symmetric_algorithm: Crypto::SymmetricCipher::DEFAULT_ALGORITHM,
- asymmetric_algorithm: Crypto::RsaCipher::ALGORITHM,
- key_info: nil
- )
+ 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 is deprecated. Use EncryptedData.')
+ 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
)