Class: PayPal::SDK::Core::Credential::Certificate

Inherits:
Base
  • Object
show all
Defined in:
lib/paypal-sdk/core/credential/certificate.rb

Overview

Certificate class for SSL Certificate authentication

Instance Attribute Summary collapse

Attributes inherited from Base

#app_id, #device_ipaddress, #password, #sandbox_email_address, #username

Instance Method Summary collapse

Methods inherited from Base

#properties

Constructor Details

#initialize(config) ⇒ Certificate

Returns a new instance of Certificate.



9
10
11
12
# File 'lib/paypal-sdk/core/credential/certificate.rb', line 9

def initialize(config)
  super
  @cert_path = config.cert_path
end

Instance Attribute Details

#cert_pathObject (readonly)

Returns the value of attribute cert_path.



7
8
9
# File 'lib/paypal-sdk/core/credential/certificate.rb', line 7

def cert_path
  @cert_path
end

Instance Method Details

#certObject

Return SSL certificate



15
16
17
# File 'lib/paypal-sdk/core/credential/certificate.rb', line 15

def cert
  @cert ||= OpenSSL::X509::Certificate.new(cert_content)
end

#keyObject

Return SSL certificate key



20
21
22
# File 'lib/paypal-sdk/core/credential/certificate.rb', line 20

def key
  @key  = OpenSSL::PKey::RSA.new(cert_content)
end