Commit 0fe6c12

mo <mo.khan@gmail.com>
2017-11-26 18:35:01
extract decryptors to a constant.
1 parent 7bdbbe5
Changed files (1)
saml-kit
lib
saml
saml-kit/lib/saml/kit/crypto.rb
@@ -6,9 +6,10 @@ require 'saml/kit/crypto/unknown_cipher'
 module Saml
   module Kit
     module Crypto
+      DECRYPTORS = [ SimpleCipher, RsaCipher, OaepCipher, UnknownCipher ]
+
       def self.decryptor_for(algorithm, key)
-        decryptors = [ SimpleCipher, RsaCipher, OaepCipher, UnknownCipher ]
-        decryptors.find { |x| x.matches?(algorithm) }.new(algorithm, key)
+        DECRYPTORS.find { |x| x.matches?(algorithm) }.new(algorithm, key)
       end
     end
   end