Class: Chef::EncryptedAttribute::LocalNode

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/encrypted_attribute/local_node.rb

Overview

Get name and keys from local Chef Node.

Instance Method Summary collapse

Instance Method Details

#keyOpenSSL::PKey::RSA

Gets the local node key.

The key has the private key and the public key embedded.


37
38
39
# File 'lib/chef/encrypted_attribute/local_node.rb', line 37

def key
  OpenSSL::PKey::RSA.new(open(Chef::Config[:client_key]).read)
end

#nameString

Note:

currently not used

Gets the local node name.


28
29
30
# File 'lib/chef/encrypted_attribute/local_node.rb', line 28

def name
  Chef::Config[:node_name]
end

#public_keyOpenSSL::PKey::RSA

Gets the local node public key.


44
45
46
# File 'lib/chef/encrypted_attribute/local_node.rb', line 44

def public_key
  key.public_key
end