Sha256: 0605b7c09544c9626d1558133f7a0f67ebc50981075cb3bb3cd414ff08a06396
Contents?: true
Size: 692 Bytes
Versions: 19
Compression:
Stored size: 692 Bytes
Contents
require 'helper' module Bixby module Test class TestCryptoUtil < TestCase def test_crypto_cycle key1 = CryptoUtil.generate_keypair key2 = CryptoUtil.generate_keypair data = {"foo" => "bar"} uuid = "123456" encrypted = CryptoUtil.encrypt(MultiJson.dump(data), uuid, key1, key2) assert encrypted encrypted_io = StringIO.new(encrypted) assert_equal uuid, encrypted_io.readline.strip decrypted = CryptoUtil.decrypt(encrypted_io, key1, key2) assert decrypted data_out = MultiJson.load(decrypted) assert data_out assert_kind_of Hash, data_out assert_equal "bar", data_out["foo"] end end # TestCryptoUtil end # Test end # Bixby
Version data entries
19 entries across 19 versions & 1 rubygems