Sha256: 07cf9ee4b5d4427a353f2f0fcfe9b087786f97465f130adb56e2d9129edb6317

Contents?: true

Size: 508 Bytes

Versions: 72

Compression:

Stored size: 508 Bytes

Contents

module Minke
  module Encryption
    class Encryption
      def initialize(private_key_file)
        @key_file = private_key_file
        @key = OpenSSL::PKey::RSA.new File.read private_key_file
      end

      def encrypt_string(string)
        Base64.encode64(@key.public_encrypt(string))
      end

      def decrypt_string(string)
        @key.private_decrypt(Base64.decode64(string))
      end

      def fingerprint
        SSHKey.new(File.read(@key_file)).md5_fingerprint
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
minke-1.13.6 lib/minke/encryption/encryption.rb
minke-1.13.5 lib/minke/encryption/encryption.rb
minke-1.13.4 lib/minke/encryption/encryption.rb
minke-1.13.3 lib/minke/encryption/encryption.rb
minke-1.13.2 lib/minke/encryption/encryption.rb
minke-1.13.1 lib/minke/encryption/encryption.rb
minke-1.13.0 lib/minke/encryption/encryption.rb
minke-1.12.9 lib/minke/encryption/encryption.rb
minke-1.12.8 lib/minke/encryption/encryption.rb
minke-1.12.7 lib/minke/encryption/encryption.rb
minke-1.12.5 lib/minke/encryption/encryption.rb
minke-1.12.4 lib/minke/encryption/encryption.rb
minke-1.12.3 lib/minke/encryption/encryption.rb
minke-1.12.2 lib/minke/encryption/encryption.rb
minke-1.12.0 lib/minke/encryption/encryption.rb
minke-1.11.9 lib/minke/encryption/encryption.rb
minke-1.11.8 lib/minke/encryption/encryption.rb
minke-1.11.7 lib/minke/encryption/encryption.rb
minke-1.11.6 lib/minke/encryption/encryption.rb
minke-1.11.5 lib/minke/encryption/encryption.rb