Make sure key is set before calling OpenSSL.