Hi
I have recently been learning Qt, and am now working on a project that utilizes its SSL capabilities. I am using OpenSSL 0.9.8 on 64bit Kubuntu Fiesty, with Qt 4.4 compiled with SSL support. When I try reading a private key I created with the openssl command, the QSslKey object is always null. This is strange, because the self-signed certificate I created with the private key in question is read just fine. Below is the code I'm using to load the key.
Code:
QSslKey key(new QFile(filename), QSsl::Rsa);
where filename is a QString containing a filename. The key I'm using (for testing) is:
Code:
-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAAKBgQCyYhZBQEF3dzLJxbtGxLVNIAa3XIb1T+a8zznmZHs2wshtAEcT
DrOG+9CyE6MUmuzkCk2+Sg/2lxJWkVDLn3Gw2qe1LKh/Aapk+snnfSD/Tt49XjwL
P8MU8Y44MW/PkrIe+D1fBlYlPYIbs3w1AcBmvbl6RWgmcBoAnKwRCwbSLQIDAQAB
AoGASkLBRwrL9kL+NreFXlG3tFLX2O/BE1DfGs0eKoa8MLDoJVCPRiTBojkkyW2Z
X5ObeNe9Q7GrcZm0vasjOpG3DxnZ9XR1QJqq+PHwy31wDrZIY/WPa+AWw3l61l+U
c+7DflSmkU9Ul2GFTv+7ltM0YipFP9Lb1bj2jLy8rDm2X6ECQQDhafQohFRObE78
Ulw9K+ddf/g2Bz8aqo0CrA+pOqqk1tw5RYGEZA+nPaxb83HxMzzQMzc4jjlqvzUB
KxRQZmHZAkEAypZ1j//mgRpgmaD+nP7SisDbQAbE4w+LyY3tZUkDTq1R7TDD07FC
S+sVeEtrUMbp2ona0kQll/3ggqdKHhKqdQJAYVguVqj+93cSjSjMKKajHd+7wylR
+SQaDUNc6Aor00/uftUjX5cOo3ygyHzTggRMiOT1Pfk9lnnIXB7MgQQV0QJANg/a
xZfDmnZAix7Uc27pHpACsl5cEj/mzN2sGVhXoppL/6EA0TA/geT1MMnnlIHQjDo3
g98drSbZz+P2unm+tQJAPy61mvQvYLNJHPqEi7SNqjmG+jmlBz260MLpljyF5u7J
SxphezQSFZHMY9E7ojQ0MwmZtptkjAzMw1/dJ7/YpA==
-----END RSA PRIVATE KEY-----
The command I used to create the key:
Code:
openssl genrsa -out key.pem 1024
I tried googling this, but couldn't seem to find anything. I'm not doing anything terribly complex in loading the key, so I'm guessing the problem's not that complicated, but I haven't worked a lot (as a programmer) with cryptography or ssl or qt before, so any suggestions are appreciated!
Thanks,
Syd