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.15.0 lib/minke/encryption/encryption.rb
minke-1.14.5 lib/minke/encryption/encryption.rb
minke-1.14.4 lib/minke/encryption/encryption.rb
minke-1.14.3 lib/minke/encryption/encryption.rb
minke-1.14.2 lib/minke/encryption/encryption.rb
minke-1.14.1 lib/minke/encryption/encryption.rb
minke-1.14.0 lib/minke/encryption/encryption.rb
minke-1.13.20 lib/minke/encryption/encryption.rb
minke-1.13.19 lib/minke/encryption/encryption.rb
minke-1.13.18 lib/minke/encryption/encryption.rb
minke-1.13.16 lib/minke/encryption/encryption.rb
minke-1.13.15 lib/minke/encryption/encryption.rb
minke-1.13.14 lib/minke/encryption/encryption.rb
minke-1.13.13 lib/minke/encryption/encryption.rb
minke-1.13.12 lib/minke/encryption/encryption.rb
minke-1.13.11 lib/minke/encryption/encryption.rb
minke-1.13.10 lib/minke/encryption/encryption.rb
minke-1.13.9 lib/minke/encryption/encryption.rb
minke-1.13.8 lib/minke/encryption/encryption.rb
minke-1.13.7 lib/minke/encryption/encryption.rb