Class: Saml::Kit::Crypto::RsaCipher

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/kit/crypto/rsa_cipher.rb

Constant Summary collapse

ALGORITHMS =
{
  'http://www.w3.org/2001/04/xmlenc#rsa-1_5' => true,
}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(algorithm, key) ⇒ RsaCipher

Returns a new instance of RsaCipher.



9
10
11
# File 'lib/saml/kit/crypto/rsa_cipher.rb', line 9

def initialize(algorithm, key)
  @key = key
end

Class Method Details

.matches?(algorithm) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/saml/kit/crypto/rsa_cipher.rb', line 13

def self.matches?(algorithm)
  ALGORITHMS[algorithm]
end

Instance Method Details

#decrypt(cipher_text) ⇒ Object



17
18
19
# File 'lib/saml/kit/crypto/rsa_cipher.rb', line 17

def decrypt(cipher_text)
  @key.private_decrypt(cipher_text)
end