Class: Perkins::Build::Data::SshKey
- Defined in:
- lib/perkins/build/data.rb
Instance Attribute Summary collapse
-
#encoded ⇒ Object
Returns the value of attribute encoded.
-
#source ⇒ Object
Returns the value of attribute source.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#encoded ⇒ Object
Returns the value of attribute encoded
86 87 88 |
# File 'lib/perkins/build/data.rb', line 86 def encoded @encoded end |
#source ⇒ Object
Returns the value of attribute source
86 87 88 |
# File 'lib/perkins/build/data.rb', line 86 def source @source end |
#value ⇒ Object
Returns the value of attribute value
86 87 88 |
# File 'lib/perkins/build/data.rb', line 86 def value @value end |
Instance Method Details
#encoded? ⇒ Boolean
95 96 97 |
# File 'lib/perkins/build/data.rb', line 95 def encoded? encoded end |
#fingerprint ⇒ Object
99 100 101 102 103 |
# File 'lib/perkins/build/data.rb', line 99 def fingerprint rsa_key = OpenSSL::PKey::RSA.new(value) public_ssh_rsa = "\x00\x00\x00\x07ssh-rsa" + rsa_key.e.to_s(0) + rsa_key.n.to_s(0) OpenSSL::Digest::MD5.new(public_ssh_rsa).hexdigest.scan(/../).join(':') end |