Class: PoiseTlsRemoteFile::Resources::PoiseTlsRemoteFile::Resource
- Inherits:
-
Chef::Resource::RemoteFile
- Object
- Chef::Resource::RemoteFile
- PoiseTlsRemoteFile::Resources::PoiseTlsRemoteFile::Resource
- Defined in:
- lib/poise_tls_remote_file/resources/poise_tls_remote_file.rb
Overview
A tls_remote_file
resource to do something.
Instance Method Summary collapse
- #ca_objs ⇒ Object
- #client_cert_obj ⇒ Object
- #client_key_obj ⇒ Object
-
#initialize(*args) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(*args) ⇒ Resource
Returns a new instance of Resource.
38 39 40 41 |
# File 'lib/poise_tls_remote_file/resources/poise_tls_remote_file.rb', line 38 def initialize(*args) super @provider = PoiseTlsRemoteFile::Provider if defined?(@provider) end |
Instance Method Details
#ca_objs ⇒ Object
64 65 66 67 68 |
# File 'lib/poise_tls_remote_file/resources/poise_tls_remote_file.rb', line 64 def ca_objs Array(ca).map do |path| OpenSSL::X509::Certificate.new(maybe_read_file(path)) if path end end |
#client_cert_obj ⇒ Object
47 48 49 |
# File 'lib/poise_tls_remote_file/resources/poise_tls_remote_file.rb', line 47 def client_cert_obj OpenSSL::X509::Certificate.new(maybe_read_file(client_cert)) if client_cert end |
#client_key_obj ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/poise_tls_remote_file/resources/poise_tls_remote_file.rb', line 51 def client_key_obj if client_key OpenSSL::PKey::RSA.new(maybe_read_file(client_key)) elsif client_cert begin OpenSSL::PKey::RSA.new(maybe_read_file(client_cert)) rescue OpenSSL::PKey::RSAError # It didn't have a key in it, oh well. nil end end end |