Details
-
Suggestion
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.3
-
None
-
Qt 4.6.3
OpenSuSE 11.2
Description
Was looking to be able to generate QSslKey s when I needed to - but the function was not available.
The attached patch - adds 2 static methods to the base class to enable key generation for DSA and RSA keys.
static QSslKey *generateRSAkey(quint32 numbits, quint64 exponent, QSsl::KeyType privPub);
static QSslKey *generateDSAkey(quint32 numbits, QSsl::KeyType privPub );
This enables the following type of code to get new keys generated;
QSslKey *s = QSslKey::generateDSAkey(1024, QSsl::PublicKey);
This generates 1024 bit public key.
The parameters to the statics could be adjusted to give more flexible key generation - but this is a start.
The patch was generated using Qt 4.6.3.
Files touched in the patch:
src/network/ssl/qsslsocket_openssl_symbols_p.h
src/network/ssl/qsslsocket_openssl_symbols_p.cpp
src/network/qsslkey_p.h
src/network/qsslkey.h
src/network/qsslkey.cpp