Sha256: ffca7acc3476085e5304e2e27480068a67b8538fc1a4f209375607526e4d0900

Contents?: true

Size: 498 Bytes

Versions: 63

Compression:

Stored size: 498 Bytes

Contents

module Minke
  module Encryption
    class KeyLocator
      def initialize(key_store_path)
        @key_store_path = key_store_path
      end

      def locate_key fingerprint
        Dir.entries(@key_store_path).each do |f|
          begin
            full_path = "#{@key_store_path}/#{f}"
            key = SSHKey.new(File.read(full_path))

            return full_path if key.fingerprint == fingerprint
          rescue

          end
        end

        return nil
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
minke-1.15.0 lib/minke/encryption/key_locator.rb
minke-1.14.5 lib/minke/encryption/key_locator.rb
minke-1.14.4 lib/minke/encryption/key_locator.rb
minke-1.14.3 lib/minke/encryption/key_locator.rb
minke-1.14.2 lib/minke/encryption/key_locator.rb
minke-1.14.1 lib/minke/encryption/key_locator.rb
minke-1.14.0 lib/minke/encryption/key_locator.rb
minke-1.13.20 lib/minke/encryption/key_locator.rb
minke-1.13.19 lib/minke/encryption/key_locator.rb
minke-1.13.18 lib/minke/encryption/key_locator.rb
minke-1.13.16 lib/minke/encryption/key_locator.rb
minke-1.13.15 lib/minke/encryption/key_locator.rb
minke-1.13.14 lib/minke/encryption/key_locator.rb
minke-1.13.13 lib/minke/encryption/key_locator.rb
minke-1.13.12 lib/minke/encryption/key_locator.rb
minke-1.13.11 lib/minke/encryption/key_locator.rb
minke-1.13.10 lib/minke/encryption/key_locator.rb
minke-1.13.9 lib/minke/encryption/key_locator.rb
minke-1.13.8 lib/minke/encryption/key_locator.rb
minke-1.13.7 lib/minke/encryption/key_locator.rb