Class: RTunnel::Crypto::KeySet
- Inherits:
-
Object
- Object
- RTunnel::Crypto::KeySet
- Defined in:
- lib/rtunnel/crypto.rb
Overview
A set of keys used by a server to authenticate clients.
Instance Method Summary collapse
- #[](key_fp) ⇒ Object
-
#initialize(key_list) ⇒ KeySet
constructor
A new instance of KeySet.
- #length ⇒ Object
Constructor Details
#initialize(key_list) ⇒ KeySet
Returns a new instance of KeySet.
64 65 66 67 |
# File 'lib/rtunnel/crypto.rb', line 64 def initialize(key_list) @keys_by_fp = {} key_list.each { |k| @keys_by_fp[RTunnel::Crypto.key_fingerprint(k)] = k } end |
Instance Method Details
#[](key_fp) ⇒ Object
69 70 71 |
# File 'lib/rtunnel/crypto.rb', line 69 def [](key_fp) @keys_by_fp[key_fp] end |
#length ⇒ Object
73 74 75 |
# File 'lib/rtunnel/crypto.rb', line 73 def length @keys_by_fp.length end |