Class: QiwiPay::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/qiwi-pay/credentials.rb

Overview

QiwiPay access credentials

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(secret:, cert: nil, key: nil, key_pass: nil, p12: nil) ⇒ Credentials



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/qiwi-pay/credentials.rb', line 22

def initialize(secret:,
               cert: nil,
               key: nil,
               key_pass: nil,
               p12: nil)
  @secret = secret
  if p12
    @certificate, @key = load_p12(p12)
  else
    @certificate = create_cert(cert) if cert
    @key = create_key(key, key_pass) if key
  end
end

Instance Attribute Details

#certificateOpenSSL::X509::Certificate (readonly)



12
13
14
# File 'lib/qiwi-pay/credentials.rb', line 12

def certificate
  @certificate
end

#keyOpenSSL::PKey::RSA (readonly)



15
16
17
# File 'lib/qiwi-pay/credentials.rb', line 15

def key
  @key
end

#secretString (readonly)



9
10
11
# File 'lib/qiwi-pay/credentials.rb', line 9

def secret
  @secret
end