Class: RTunnel::Crypto::KeySet

Inherits:
Object
  • Object
show all
Defined in:
lib/rtunnel/crypto.rb

Overview

A set of keys used by a server to authenticate clients.

Instance Method Summary collapse

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

#lengthObject



73
74
75
# File 'lib/rtunnel/crypto.rb', line 73

def length
  @keys_by_fp.length
end