Class: Net::SSH::HostKeyEntries::PubKey
- Inherits:
-
Delegator
- Object
- Delegator
- Net::SSH::HostKeyEntries::PubKey
- Defined in:
- lib/net/ssh/known_hosts.rb
Overview
regular public key entry
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(key, comment: nil) ⇒ PubKey
constructor
rubocop:disable Lint/MissingSuper.
- #matches_key?(server_key) ⇒ Boolean
- #ssh_type ⇒ Object
- #ssh_types ⇒ Object
- #to_blob ⇒ Object
Constructor Details
#initialize(key, comment: nil) ⇒ PubKey
rubocop:disable Lint/MissingSuper
12 13 14 15 |
# File 'lib/net/ssh/known_hosts.rb', line 12 def initialize(key, comment: nil) # rubocop:disable Lint/MissingSuper @key = key @comment = comment end |
Instance Method Details
#__getobj__ ⇒ Object
29 30 31 32 |
# File 'lib/net/ssh/known_hosts.rb', line 29 def __getobj__ Kernel.warn("Calling Net::SSH::Buffer methods on HostKeyEntries PubKey is deprecated") @key end |
#matches_key?(server_key) ⇒ Boolean
34 35 36 |
# File 'lib/net/ssh/known_hosts.rb', line 34 def matches_key?(server_key) @key.ssh_type == server_key.ssh_type && @key.to_blob == server_key.to_blob end |
#ssh_type ⇒ Object
17 18 19 |
# File 'lib/net/ssh/known_hosts.rb', line 17 def ssh_type @key.ssh_type end |
#ssh_types ⇒ Object
21 22 23 |
# File 'lib/net/ssh/known_hosts.rb', line 21 def ssh_types [ssh_type] end |
#to_blob ⇒ Object
25 26 27 |
# File 'lib/net/ssh/known_hosts.rb', line 25 def to_blob @key.to_blob end |