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.13.6 lib/minke/encryption/key_locator.rb
minke-1.13.5 lib/minke/encryption/key_locator.rb
minke-1.13.4 lib/minke/encryption/key_locator.rb
minke-1.13.3 lib/minke/encryption/key_locator.rb
minke-1.13.2 lib/minke/encryption/key_locator.rb
minke-1.13.1 lib/minke/encryption/key_locator.rb
minke-1.13.0 lib/minke/encryption/key_locator.rb
minke-1.12.9 lib/minke/encryption/key_locator.rb
minke-1.12.8 lib/minke/encryption/key_locator.rb
minke-1.12.7 lib/minke/encryption/key_locator.rb
minke-1.12.5 lib/minke/encryption/key_locator.rb
minke-1.12.4 lib/minke/encryption/key_locator.rb
minke-1.12.3 lib/minke/encryption/key_locator.rb
minke-1.12.2 lib/minke/encryption/key_locator.rb
minke-1.12.0 lib/minke/encryption/key_locator.rb
minke-1.11.9 lib/minke/encryption/key_locator.rb
minke-1.11.8 lib/minke/encryption/key_locator.rb
minke-1.11.7 lib/minke/encryption/key_locator.rb
minke-1.11.6 lib/minke/encryption/key_locator.rb
minke-1.11.5 lib/minke/encryption/key_locator.rb