Currently I have a code base that uses openssl_public_encrypt/openssl_private_decrypt
. Now I would like to test my encryption and decryption methods with a unit test, since these are pretty vital.
To really test them I think I would like to simply mock the private and public keys. Is this viable and how would I go about mocking these keys without putting any sensitive information in my code base?
Of course I could circumvent the openssl public/private part and mock the outcome of that but this logic also throws some exceptions, etc. which I would like to test.