Class: Conjure::Identity

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/identity.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Identity

Returns a new instance of Identity.



5
6
7
# File 'lib/conjure/identity.rb', line 5

def initialize(config)
  @config = config
end

Instance Method Details

#private_key_pathObject



9
10
11
# File 'lib/conjure/identity.rb', line 9

def private_key_path
  Pathname.new(@config.config_path).join @config.private_key_file
end

#public_key_dataObject



17
18
19
# File 'lib/conjure/identity.rb', line 17

def public_key_data
  File.open(public_key_path, "rb") { |file| file.read }
end

#public_key_pathObject



13
14
15
# File 'lib/conjure/identity.rb', line 13

def public_key_path
  Pathname.new(@config.config_path).join @config.public_key_file
end

#unique_identifierObject



21
22
23
# File 'lib/conjure/identity.rb', line 21

def unique_identifier
  "conjure_#{Digest::MD5.hexdigest(public_key_data)[0..7]}"
end