Commit 0791bab
2017-11-26 18:36:47
1 parent
0fe6c12
Changed files (2)
saml-kit
lib
saml
kit
crypto
saml-kit/lib/saml/kit/crypto/oaep_cipher.rb
@@ -2,12 +2,15 @@ module Saml
module Kit
module Crypto
class OaepCipher
+ ALGORITHMS = {
+ 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' => true,
+ }
def initialize(algorithm, key)
@key = key
end
def self.matches?(algorithm)
- 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p' == algorithm
+ ALGORITHMS[algorithm]
end
def decrypt(cipher_text)
saml-kit/lib/saml/kit/crypto/rsa_cipher.rb
@@ -2,12 +2,16 @@ module Saml
module Kit
module Crypto
class RsaCipher
+ ALGORITHMS = {
+ 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' => true,
+ }
+
def initialize(algorithm, key)
@key = key
end
def self.matches?(algorithm)
- 'http://www.w3.org/2001/04/xmlenc#rsa-1_5' == algorithm
+ ALGORITHMS[algorithm]
end
def decrypt(cipher_text)