Commit f41efac

mokha <mo@mokhan.ca>
2018-11-26 05:53:49
use full namespace path.
1 parent cc50af5
Changed files (2)
lib/xml/kit/decryption.rb
@@ -7,7 +7,7 @@ module Xml
       # The list of private keys to use to attempt to decrypt the document.
       attr_reader :cipher_registry, :private_keys
 
-      def initialize(private_keys:, cipher_registry: Crypto)
+      def initialize(private_keys:, cipher_registry: ::Xml::Kit::Crypto)
         @private_keys = private_keys
         @cipher_registry = cipher_registry
       end
lib/xml/kit/encryption.rb
@@ -16,15 +16,11 @@ module Xml
       )
         @symmetric_algorithm = symmetric_algorithm
         symmetric_cipher = symmetric(symmetric_algorithm)
-        @symmetric_cipher_value = Base64.strict_encode64(
-          symmetric_cipher.encrypt(raw_xml)
-        )
+        @symmetric_cipher_value = Base64.strict_encode64(symmetric_cipher.encrypt(raw_xml))
 
         @asymmetric_algorithm = asymmetric_algorithm
         asymmetric_cipher = asymmetric(asymmetric_algorithm, public_key)
-        @asymmetric_cipher_value = Base64.strict_encode64(
-          asymmetric_cipher.encrypt(symmetric_cipher.key)
-        )
+        @asymmetric_cipher_value = Base64.strict_encode64(asymmetric_cipher.encrypt(symmetric_cipher.key))
       end
 
       def to_xml(xml: ::Builder::XmlMarkup.new)