# File lib/rhc/rest/key.rb, line 13 def destroy debug "Deleting key #{self.name}" rest_method "DELETE" end
# File lib/rhc/rest/key.rb, line 19 def fingerprint @fingerprint ||= begin public_key = Net::SSH::KeyFactory.load_data_public_key("#{type} #{content}") public_key.fingerprint rescue NotImplementedError, OpenSSL::PKey::PKeyError => e 'Invalid key' end end
# File lib/rhc/rest/key.rb, line 8 def update(type, content) debug "Updating key #{self.name}" rest_method "UPDATE", :type => type, :content => content end
# File lib/rhc/rest/key.rb, line 28 def visible_to_ssh? Net::SSH::Authentication::Agent.connect.identities. find{ |i| fingerprint == i.fingerprint }.present? rescue false end