Sha256: d2e64982902e8b0f44a2843ac7b7e9d0d2ce0867f31748d771e9a6ef53988839

Contents?: true

Size: 489 Bytes

Versions: 5

Compression:

Stored size: 489 Bytes

Contents

require "openssl"
module SymmetricEncryption
  # DEPRECATED - Internal use only
  class RSAKey
    # DEPRECATED - Internal use only
    def initialize(private_rsa_key)
      @rsa = OpenSSL::PKey::RSA.new(private_rsa_key)
    end

    # DEPRECATED - Internal use only
    def encrypt(key)
      rsa.public_encrypt(key)
    end

    # DEPRECATED - Internal use only
    def decrypt(encrypted_key)
      rsa.private_decrypt(encrypted_key)
    end

    private

    attr_reader :rsa
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
symmetric-encryption-4.6.0 lib/symmetric_encryption/rsa_key.rb
symmetric-encryption-4.5.0 lib/symmetric_encryption/rsa_key.rb
symmetric-encryption-4.4.0 lib/symmetric_encryption/rsa_key.rb
symmetric-encryption-4.3.3 lib/symmetric_encryption/rsa_key.rb
symmetric-encryption-4.3.2 lib/symmetric_encryption/rsa_key.rb