Class: Akami::WSSE::Certs
- Inherits:
-
Object
- Object
- Akami::WSSE::Certs
- Defined in:
- lib/akami/wsse/certs.rb
Overview
Contains certs for WSSE::Signature
Instance Attribute Summary collapse
-
#cert_file ⇒ Object
Returns the value of attribute cert_file.
-
#private_key_file ⇒ Object
Returns the value of attribute private_key_file.
-
#private_key_password ⇒ Object
Returns the value of attribute private_key_password.
Instance Method Summary collapse
-
#cert ⇒ Object
Returns an
OpenSSL::X509::Certificate
for thecert_file
. -
#initialize(certs = {}) ⇒ Certs
constructor
A new instance of Certs.
-
#private_key ⇒ Object
Returns an
OpenSSL::PKey::RSA
for theprivate_key_file
.
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_file ⇒ Object
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_file ⇒ Object
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_password ⇒ Object
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
#cert ⇒ Object
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_key ⇒ Object
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 |