Sha256: 8d0fd8c9d3416be38c9f305a755f2db4b7ad0f76dcca956f6b495496c801454e

Contents?: true

Size: 659 Bytes

Versions: 4

Compression:

Stored size: 659 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

        throw "Unable to find SSL key matching fingerprint if your SSL keys are not in ~/.ssh you can set the environment variable SSL_KEY_PATH to point to the correct directory."
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
minke-1.5.8 lib/minke/encryption/key_locator.rb
minke-1.5.7 lib/minke/encryption/key_locator.rb
minke-1.5.6 lib/minke/encryption/key_locator.rb
minke-1.5.5 lib/minke/encryption/key_locator.rb