Class: Akami::WSSE::Certs

Inherits:
Object
  • Object
show all
Defined in:
lib/akami/wsse/certs.rb

Overview

Contains certs for WSSE::Signature

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(certs = {}) ⇒ Certs

Returns a new instance of Certs.



6
7
8
9
10
# File 'lib/akami/wsse/certs.rb', line 6

def initialize(certs = {})
  certs.each do |key, value|
    self.send :"#{key}=", value
  end
end

Instance Attribute Details

#cert_fileObject

Returns the value of attribute cert_file.



12
13
14
# File 'lib/akami/wsse/certs.rb', line 12

def cert_file
  @cert_file
end

#private_key_fileObject

Returns the value of attribute private_key_file.



12
13
14
# File 'lib/akami/wsse/certs.rb', line 12

def private_key_file
  @private_key_file
end

#private_key_passwordObject

Returns the value of attribute private_key_password.



12
13
14
# File 'lib/akami/wsse/certs.rb', line 12

def private_key_password
  @private_key_password
end

Instance Method Details

#certObject

Returns an OpenSSL::X509::Certificate for the cert_file.



15
16
17
# File 'lib/akami/wsse/certs.rb', line 15

def cert
  @cert ||= OpenSSL::X509::Certificate.new File.read(cert_file) if cert_file
end

#private_keyObject

Returns an OpenSSL::PKey::RSA for the private_key_file.



20
21
22
# File 'lib/akami/wsse/certs.rb', line 20

def private_key
  @private_key ||= OpenSSL::PKey::RSA.new(File.read(private_key_file), private_key_password) if private_key_file
end