Sha256: e351ff19b05cb06ec80602b0dfe863614f15c524086d5645a5ff071b2c234fa0

Contents?: true

Size: 599 Bytes

Versions: 7

Compression:

Stored size: 599 Bytes

Contents

require File.expand_path('../helper', __FILE__)

class TestCrypto < Test::Unit::TestCase
  def fixtures
    File.expand_path('../fixtures/rsa_keys', __FILE__)
	end

  def create_keys!(bits = 4096)
    Crypto.create_keys("#{fixtures}/rsa_key", "#{fixtures}/rsa_key.pub", bits)
  end

  def load_keys
    @priv_key = Crypto::Key.from_file("#{fixtures}/rsa_key")
    @pub_key =  Crypto::Key.from_file("#{fixtures}/rsa_key.pub")
	end

  def test_create_keys
    create_keys!

    assert_not_nil File.open("#{fixtures}/rsa_key").read
    assert_not_nil File.open("#{fixtures}/rsa_key.pub").read
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
encbs-0.2.1.beta2 test/fixtures/test_crypto.rb
encbs-0.2.1.beta1 test/fixtures/test_crypto.rb
encbs-0.2.1.alpha test/fixtures/test_crypto.rb
encbs-0.2.0.alpha test/fixtures/test_crypto.rb
encbs-0.1.3 test/fixtures/test_crypto.rb
encbs-0.1.2 test/fixtures/test_crypto.rb
encbs-0.1.1 test/fixtures/test_crypto.rb