1
0
Fork 0

Add more specs

This commit is contained in:
Alex Kotov 2019-09-12 08:30:54 +05:00
parent 600dfecf04
commit 33798046f4
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -107,6 +107,21 @@ RSpec.describe RSAPublicKey do
specify do
expect(subject.private_key_pem_ciphertext).not_to be_blank
end
specify do
cipher = OpenSSL::Cipher::AES256.new
cipher.encrypt
cipher.iv = subject.private_key_pem_iv
cipher.key = subject.private_key_pem_secret
ciphertext = [
cipher.update(cleartext),
cipher.final,
].join.freeze
expect(subject.private_key_pem_ciphertext).to eq ciphertext
end
end
end