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