class Xml::Kit::Crypto::RsaCipher

Constants

ALGORITHM

Attributes

algorithm[R]
key[R]

Public Class Methods

matches?(algorithm) click to toggle source
# File lib/xml/kit/crypto/rsa_cipher.rb, line 15
def self.matches?(algorithm)
  ALGORITHM == algorithm
end
new(algorithm, key) click to toggle source
# File lib/xml/kit/crypto/rsa_cipher.rb, line 10
def initialize(algorithm, key)
  @algorithm = algorithm
  @key = key
end

Public Instance Methods

decrypt(cipher_text) click to toggle source
# File lib/xml/kit/crypto/rsa_cipher.rb, line 23
def decrypt(cipher_text)
  @key.private_decrypt(cipher_text)
end
encrypt(plain_text) click to toggle source
# File lib/xml/kit/crypto/rsa_cipher.rb, line 19
def encrypt(plain_text)
  @key.public_encrypt(plain_text)
end