class Airtel::Pesa::Encryption

Public Class Methods

call() click to toggle source
# File lib/airtel/pesa/encryption.rb, line 12
def self.call
  string = '3333';
  public_key = OpenSSL::PKey::RSA.new(Base64.decode64(key))
  encrypted_string = Base64.encode64(public_key.public_encrypt(string))

  OpenStruct.new(result: encrypted_string, error: nil)
end
new() click to toggle source
# File lib/airtel/pesa/encryption.rb, line 10
def initialize; end

Private Instance Methods

key() click to toggle source
# File lib/airtel/pesa/encryption.rb, line 22
def key
  "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkq3XbDI1s8Lu7SpUBP+bqOs/MC6PKWz6n/0UkqTiOZqKqaoZClI3BUDTrSIJsrN1Qx7ivBzsaAYfsB0CygSSWay4iyUcnMVEDrNVOJwtWvHxpyWJC5RfKBrweW9b8klFa/CfKRtkK730apy0Kxjg+7fF0tB4O3Ic9Gxuv4pFkbQIDAQAB"
end