class PayPal::SDK::Core::Credential::Certificate

Certificate class for SSL Certificate authentication

Attributes

cert_path[R]

Public Class Methods

new(config) click to toggle source
# File lib/paypal-sdk/core/credential/certificate.rb, line 9
def initialize(config)
  super
  @cert_path = config.cert_path
end

Public Instance Methods

cert() click to toggle source

Return SSL certificate

# File lib/paypal-sdk/core/credential/certificate.rb, line 15
def cert
  @cert ||= OpenSSL::X509::Certificate.new(cert_content)
end
key() click to toggle source

Return SSL certificate key

# File lib/paypal-sdk/core/credential/certificate.rb, line 20
def key
  @key  = OpenSSL::PKey::RSA.new(cert_content)
end

Private Instance Methods

cert_content() click to toggle source

Return certificate content from the configured file.

# File lib/paypal-sdk/core/credential/certificate.rb, line 26
def cert_content
  @cert_content ||= File.read(cert_path)
end