Class: Transbank::Webpay::Vault

Inherits:
Object
  • Object
show all
Defined in:
lib/transbank/webpay/vault.rb

Class Method Summary collapse

Class Method Details

.certObject



6
7
8
# File 'lib/transbank/webpay/vault.rb', line 6

def cert
  @cert ||= OpenSSL::X509::Certificate.new open(Transbank::Webpay.configuration.cert_path)
end

.private_keyObject



10
11
12
# File 'lib/transbank/webpay/vault.rb', line 10

def private_key
  @private_key ||= OpenSSL::PKey::RSA.new open(Transbank::Webpay.configuration.key_path)
end

.pub_keyObject



21
22
23
# File 'lib/transbank/webpay/vault.rb', line 21

def pub_key
  server_cert.public_key
end

.server_certObject



14
15
16
17
18
19
# File 'lib/transbank/webpay/vault.rb', line 14

def server_cert
  @server_cert ||= begin
    path = Transbank::Webpay.configuration.server_cert_path
    OpenSSL::X509::Certificate.new File.read(path)
  end
end