Sha256: de9ce4470f1d9f8f1299dcfaec6dd4e0a99199d5fb8aeb878fb773ab7edfc9ca

Contents?: true

Size: 488 Bytes

Versions: 11

Compression:

Stored size: 488 Bytes

Contents

module Xml
  module Kit
    module Crypto
      class RsaCipher
        ALGORITHM = "#{::Xml::Kit::Namespaces::XMLENC}rsa-1_5"

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

        def self.matches?(algorithm)
          ALGORITHM == algorithm
        end

        def encrypt(plain_text)
          @key.public_encrypt(plain_text)
        end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
xml-kit-0.1.11 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.10 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.9 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.8 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.7 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.6 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.5 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.4 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.3 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.2 lib/xml/kit/crypto/rsa_cipher.rb
xml-kit-0.1.1 lib/xml/kit/crypto/rsa_cipher.rb