Class: Conjure::Identity
- Inherits:
-
Object
- Object
- Conjure::Identity
- Defined in:
- lib/conjure/identity.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Identity
constructor
A new instance of Identity.
- #private_key_path ⇒ Object
- #public_key_data ⇒ Object
- #public_key_path ⇒ Object
- #unique_identifier ⇒ Object
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_path ⇒ Object
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_data ⇒ Object
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_path ⇒ Object
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_identifier ⇒ Object
21 22 23 |
# File 'lib/conjure/identity.rb', line 21 def unique_identifier "conjure_#{Digest::MD5.hexdigest(public_key_data)[0..7]}" end |