Class: Airtel::Pesa::Encryption

Inherits:
Object
  • Object
show all
Defined in:
lib/airtel/pesa/encryption.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEncryption

Returns a new instance of Encryption.



10
# File 'lib/airtel/pesa/encryption.rb', line 10

def initialize; end

Class Method Details

.callObject



12
13
14
15
16
17
18
# 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