Class: Airtel::Pesa::Encryption
- Inherits:
-
Object
- Object
- Airtel::Pesa::Encryption
- Defined in:
- lib/airtel/pesa/encryption.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Encryption
constructor
A new instance of Encryption.
Constructor Details
#initialize ⇒ Encryption
Returns a new instance of Encryption.
10 |
# File 'lib/airtel/pesa/encryption.rb', line 10 def initialize; end |
Class Method Details
.call ⇒ Object
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 |