class RHC::Rest::Key

Attributes

content[R]
name[R]
type[R]

Public Instance Methods

delete() click to toggle source
Alias for: destroy
destroy() click to toggle source
# File lib/rhc/rest/key.rb, line 13
def destroy
  debug "Deleting key #{self.name}"
  rest_method "DELETE"
end
Also aliased as: delete
fingerprint() click to toggle source
# File lib/rhc/rest/key.rb, line 19
def 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
update(type, content) click to toggle source
# 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