refactored a little. keys are now base64 encoded, still doesn't work with OpenSSL though.