Class: Net::SSH::HostKeyEntries::CertAuthority
- Inherits:
-
Object
- Object
- Net::SSH::HostKeyEntries::CertAuthority
- Defined in:
- lib/net/ssh/known_hosts.rb
Overview
@cert-authority entry
Instance Method Summary collapse
-
#initialize(key, comment: nil) ⇒ CertAuthority
constructor
A new instance of CertAuthority.
- #matches_key?(server_key) ⇒ Boolean
- #ssh_types ⇒ Object
Constructor Details
#initialize(key, comment: nil) ⇒ CertAuthority
Returns a new instance of CertAuthority.
52 53 54 55 |
# File 'lib/net/ssh/known_hosts.rb', line 52 def initialize(key, comment: nil) @key = key @comment = comment end |
Instance Method Details
#matches_key?(server_key) ⇒ Boolean
57 58 59 60 61 62 63 |
# File 'lib/net/ssh/known_hosts.rb', line 57 def matches_key?(server_key) if ssh_types.include?(server_key.ssh_type) server_key.signature_valid? && (server_key.signature_key.to_blob == @key.to_blob) else false end end |
#ssh_types ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/net/ssh/known_hosts.rb', line 41 def ssh_types %w[ [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ] end |