lib/xml/kit/encrypted_data.rb in xml-kit-0.3.0 vs lib/xml/kit/encrypted_data.rb in xml-kit-0.3.1
- old
+ new
@@ -5,19 +5,22 @@
# An implementation of the EncryptedKey element.
# https://www.w3.org/TR/xmlenc-core1/#sec-EncryptedData
#
# @since 0.3.0
class EncryptedData
+ attr_reader :id
attr_reader :key_info
attr_reader :symmetric_cipher
attr_reader :symmetric_cipher_value
def initialize(
raw_xml,
- symmetric_cipher:,
+ id: Id.generate,
+ symmetric_cipher: Xml::Kit::Crypto::SymmetricCipher.new,
asymmetric_cipher:,
key_info: nil
)
+ @id = id
@symmetric_cipher = symmetric_cipher
@symmetric_cipher_value = Base64.strict_encode64(
symmetric_cipher.encrypt(raw_xml)
)
@key_info = key_info || create_key_info_for(