eagleas / webmoney

Interface library for WebMoney Transfer payment system. Gem.
http://www.wmtransfer.com
44 stars 31 forks source link

How to get the key? #19

Closed phuongnd08 closed 9 years ago

phuongnd08 commented 9 years ago

From the kwm file, how do I get the key value to use with this:

class MyWM
  include Webmoney
end
@wm = MyWM.new(:wmid => '123456789012', :password => 'my_pass', :key => 'gQABAIR6...2cC8FZTyKyjBM=')

Thanks for help (I use Key Extractor but it gives me 2 value: Modulus and D)

eagleas commented 9 years ago

Hello. You should to use 'base64' utitity from original wmsigner tool: https://github.com/eagleas/wmsigner More information about wmsigner here: http://wiki.wmtransfer.com/projects/webmoney/wiki/WMSigner

phuongnd08 commented 9 years ago

I notice you changed the params of Webmoney#initialize a bit. I'm using it like this:

@wm = MyWM.new(
      :wmid => 'MyId',
      :password => 'mypassword',
      :key => "/path/to/my.kwm"
    )

but getting

OpenSSL::PKey::RSAError:
       Neither PUB key nor PRIV key: nested asn1 error
eagleas commented 9 years ago

:key => "/path/to/my.kwm" It's incorrect.