diff -U 5 -H -b -w -B -E -d -r -- qt-old/src/network/ssl/qsslkey.cpp qt-new/src/network/ssl/qsslkey.cpp
--- qt-old/src/network/ssl/qsslkey.cpp	2010-06-01 19:03:17.000000000 -0700
+++ qt-new/src/network/ssl/qsslkey.cpp	2010-09-13 21:58:06.245458109 -0700
@@ -68,10 +68,67 @@
 #include <QtCore/qdebug.h>
 
 QT_BEGIN_NAMESPACE
 #endif
 
+/*!
+    \internal
+ */
+QSslKeyPrivate * QSslKeyPrivate::generateRSAkey(quint32 numbits, quint64 exponent, QSsl::KeyType privPub ) 
+{
+	QSslKeyPrivate *retkey = new QSslKeyPrivate();
+	if ( retkey ) 
+	{
+		retkey->type = privPub;
+		retkey->algorithm = QSsl::Rsa;
+		retkey->rsa = q_RSA_generate_key(numbits, exponent, NULL, NULL); 
+		retkey->isNull = 0;
+		if ( retkey->rsa == NULL) 
+		{
+//			qDebug() << " retkey->rsa == NULL  in " << __func__ << "\n"; 
+			delete retkey;
+			retkey = NULL;
+		}
+//		qDebug() << " __func__ success \n";
+	}
+//	else 
+//		qDebug() << "Mem alloc error in: " << __func__ << "\n";
+	return retkey;
+}
+
+QSslKey * QSslKey::generateRSAkey(quint32 numbits, quint64 exponent, QSsl::KeyType privPub ) 
+{
+	QSslKeyPrivate *pData = QSslKeyPrivate::generateRSAkey(numbits, exponent, privPub);
+	QSslKey *retkey = new QSslKey(pData);
+	return retkey;
+}
+
+QSslKeyPrivate * QSslKeyPrivate::generateDSAkey(quint32 numbits, QSsl::KeyType privPub)
+{
+	QSslKeyPrivate *retkey = new QSslKeyPrivate();
+	if ( retkey ) 
+	{
+		retkey->type = privPub;
+		retkey->algorithm = QSsl::Dsa;
+		retkey->isNull = 0;
+		retkey->dsa = q_DSA_generate_parameters(numbits,NULL, 0, NULL, NULL, NULL, NULL);
+		if ( ( retkey->dsa == NULL) || ( q_DSA_generate_key(retkey->dsa) != 1 ) )
+		{
+			delete retkey; 
+			retkey = NULL;
+		}
+	}
+	return retkey;
+}
+
+QSslKey * QSslKey::generateDSAkey(quint32 numbits, QSsl::KeyType privPub ) 
+{
+	QSslKeyPrivate *pData = QSslKeyPrivate::generateDSAkey(numbits, privPub);
+	QSslKey *retkey = new QSslKey(pData);
+	return retkey;
+}
+
 
 /*!
     \internal
  */
 void QSslKeyPrivate::clear(bool deep)
@@ -146,10 +203,17 @@
 QSslKey::QSslKey()
     : d(new QSslKeyPrivate)
 {
 }
 
+QSslKey::QSslKey(QSslKeyPrivate *pData) 
+    : d(pData)
+{
+	qDebug() << "In QSslKey(pData)\n this " 
+	         << (quint64)(this) << "\n"; 
+}
+
 /*!
     \internal
 */
 QByteArray QSslKeyPrivate::pemHeader() const
 {
diff -U 5 -H -b -w -B -E -d -r -- qt-old/src/network/ssl/qsslkey.h qt-new/src/network/ssl/qsslkey.h
--- qt-old/src/network/ssl/qsslkey.h	2010-06-01 19:03:17.000000000 -0700
+++ qt-new/src/network/ssl/qsslkey.h	2010-09-13 21:30:16.433708153 -0700
@@ -87,14 +87,19 @@
     QByteArray toPem(const QByteArray &passPhrase = QByteArray()) const;
     QByteArray toDer(const QByteArray &passPhrase = QByteArray()) const;
 
     Qt::HANDLE handle() const;
 
+    static QSslKey *generateRSAkey(quint32 numbits, quint64 exponent, QSsl::KeyType privPub);
+    static QSslKey *generateDSAkey(quint32 numbits, QSsl::KeyType privPub );
+
     bool operator==(const QSslKey &key) const;
     inline bool operator!=(const QSslKey &key) const { return !operator==(key); }
 
 private:
+    // for static method keygen functions 
+    QSslKey(QSslKeyPrivate *pData);
     QExplicitlySharedDataPointer<QSslKeyPrivate> d;
     friend class QSslCertificate;
 };
 
 #ifndef QT_NO_DEBUG_STREAM
diff -U 5 -H -b -w -B -E -d -r -- qt-old/src/network/ssl/qsslkey_p.h qt-new/src/network/ssl/qsslkey_p.h
--- qt-old/src/network/ssl/qsslkey_p.h	2010-06-01 19:03:17.000000000 -0700
+++ qt-new/src/network/ssl/qsslkey_p.h	2010-09-13 09:20:36.147322009 -0700
@@ -81,10 +81,13 @@
     QByteArray pemHeader() const;
     QByteArray pemFooter() const;
     QByteArray pemFromDer(const QByteArray &der) const;
     QByteArray derFromPem(const QByteArray &pem) const;
 
+    static QSslKeyPrivate *generateRSAkey(quint32 numbits, quint64 exponent, QSsl::KeyType privPub );
+    static QSslKeyPrivate *generateDSAkey(quint32 numbits, QSsl::KeyType privPub);
+
     bool isNull;
     QSsl::KeyType type;
     QSsl::KeyAlgorithm algorithm;
     RSA *rsa;
     DSA *dsa;
diff -U 5 -H -b -w -B -E -d -r -- qt-old/src/network/ssl/qsslsocket_openssl_symbols.cpp qt-new/src/network/ssl/qsslsocket_openssl_symbols.cpp
--- qt-old/src/network/ssl/qsslsocket_openssl_symbols.cpp	2010-06-01 19:03:17.000000000 -0700
+++ qt-new/src/network/ssl/qsslsocket_openssl_symbols.cpp	2010-09-13 22:21:48.082707326 -0700
@@ -88,10 +88,30 @@
     Note: Take into account that these macros and declarations are processed
     at compile-time, and the result depends on the OpenSSL headers the
     compiling host has installed, but the symbols are resolved at run-time,
     possibly with a different version of OpenSSL.
 */
+// QSslKey generations definitions
+// ret, func, arg, a, err, funcret
+DEFINEFUNC(int, DSA_generate_key, 
+			  DSA *d, d, 
+			  return 0, return);
+DEFINEFUNC4(RSA *, RSA_generate_key, 
+				int num, num, 
+				unsigned long e, e, 
+				void (*callback)(int,int,void *), callback, 
+				void *cb_arg, cb_arg, 
+				return 0, return);
+DEFINEFUNC7(DSA *, DSA_generate_parameters, int bits, bits, 
+				unsigned char *seed, seed, 
+				int seed_len, seed_len, 
+				int *counter_ret, counter_ret, 
+				unsigned long *h_ret, h_ret,
+				void (*callback)(int, int, void *), callback,
+				void *cb_arg, cb_arg, 
+				return 0, return);
+// End QSslKey generation definitions
 
 #ifdef SSLEAY_MACROS
 DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return)
 #endif
 DEFINEFUNC(long, ASN1_INTEGER_get, ASN1_INTEGER *a, a, return 0, return)
@@ -729,10 +749,14 @@
     RESOLVEFUNC(d2i_RSAPrivateKey)
 #endif
     RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
     RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
 #endif // Q_OS_SYMBIAN
+    // qsslkey generation functions
+    RESOLVEFUNC(DSA_generate_parameters)
+    RESOLVEFUNC(DSA_generate_key)
+    RESOLVEFUNC(RSA_generate_key)
     symbolsResolved = true;
     delete libs.first;
     delete libs.second;
     return true;
 }
diff -U 5 -H -b -w -B -E -d -r -- qt-old/src/network/ssl/qsslsocket_openssl_symbols_p.h qt-new/src/network/ssl/qsslsocket_openssl_symbols_p.h
--- qt-old/src/network/ssl/qsslsocket_openssl_symbols_p.h	2010-06-01 19:03:17.000000000 -0700
+++ qt-new/src/network/ssl/qsslsocket_openssl_symbols_p.h	2010-09-13 21:07:32.835708665 -0700
@@ -413,8 +414,15 @@
 
 // Helper function
 class QDateTime;
 QDateTime q_getTimeFromASN1(const ASN1_TIME *aTime);
 
+// Added for QSslKey generation 
+RSA * q_RSA_generate_key(int num, unsigned long e, void (*callback)(int,int,void *), void *cb_arg );
+int q_DSA_generate_key(DSA *d);
+DSA * q_DSA_generate_parameters(int bits, unsigned char *seed, int seed_len, int *counter_ret, unsigned long *h_ret, void (*callback)(int, int, void *), void *cb_arg);
+// End of QSslKey generation required functions
+
+
 QT_END_NAMESPACE
 
 #endif