Sha256: 6d9821c8faf3dc8f1c88312e9ee954cb2faf1917f7747b3e51c92fb62fba7813

Contents?: true

Size: 277 Bytes

Versions: 6

Compression:

Stored size: 277 Bytes

Contents

# coding: utf-8

module ChanPay
  module Encrypt
    module RSA

      def self.encrypt(key, content)
        rsa_pkey = OpenSSL::PKey::RSA.new(key)
        content_str = rsa_pkey.public_encrypt(content)
        Base64.strict_encode64(content_str)
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chan_pay-0.7.0 lib/chan_pay/encrypt/rsa.rb
chan_pay-0.6.0 lib/chan_pay/encrypt/rsa.rb
chan_pay-0.4.0 lib/chan_pay/encrypt/rsa.rb
chan_pay-0.3.0 lib/chan_pay/encrypt/rsa.rb
chan_pay-0.2.0 lib/chan_pay/encrypt/rsa.rb
chan_pay-0.1.0 lib/chan_pay/encrypt/rsa.rb