Sha256: cb7efaa3a1d3f5b552169c0cb2e23b3b457be6f5865f91d7497b655f576cdd0b

Contents?: true

Size: 774 Bytes

Versions: 32

Compression:

Stored size: 774 Bytes

Contents

require 'spec_helper'
require 'tempfile'

describe Cuboid::Support::Crypto::RSA_AES_CBC do

    SEED = 'seed data'

    let(:public_key_file_path) do
        key  = private_key.public_key
        file = Tempfile.new( 'public_key.pem' )
        file.write( key.to_pem )
        file.close
        file.path
    end
    let(:private_key_file_path) do
        file = Tempfile.new( 'private_key.pem' )
        file.write( private_key.to_pem )
        file.close
        file.path
    end
    let(:private_key) { OpenSSL::PKey::RSA.generate( 1024 ) }
    subject { described_class.new( public_key_file_path, private_key_file_path ) }

    it 'generates matching encrypted and decrypted data' do
        expect(subject.decrypt( subject.encrypt( SEED ) )).to eq(SEED)
    end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
cuboid-0.1.5 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.1.4 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.1.3 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.1.2 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.1.1 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.1.0 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.0.5 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.0.4 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.0.3 spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.0.3alpha spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.0.2alpha spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb
cuboid-0.0.1alpha spec/cuboid/support/crypto/rsa_aes_cbc_spec.rb