Back to the topic,becouse qDou release depends on qOAuth and oAuth request using the HMAC-SHA1 signature method.
On the Windows or linux,In order to do that
the following steps are
1. build OpenSSL 0.9.6+
2. build qca-2.0.0
3. build the qca plugin for OpenSSL (the Capabilities of qca-ossl contains HMAC_SHA1)?
4. build qOAuth
But on the Symbian,as a result of different platform,you will have a lot of work to do.
even though you achieved,Maybe It doesn't work at last and you will get into trouble when deploy your apps on Symbian.em.........There is a easy way,Look this.
How to generate oauth signature using HMAC-SHA1 in Symbian C++
Follow These Tips .
we just need to do little stuff
1.add macro Q_OS_SYMBIAN to remove anything about QCA from *.cpp or *.h in qOAuth when Precompiled
2.generating your own random number method to replace the following codes
QCA::InitializationVector iv( 16 ); QByteArray nonce = iv.toByteArray().toHex();3.add these lines in function:createSignature
#ifdnef Q_OS_SYMBIAN ..... ..... ..... #else CSHA1* sha=CSHA1::NewL(); TBuf8<100> keyVal; keyVal.Copy(_L8(QByteArray(consumerSecret + "&" + tokenSecret).constData())); CHMAC* hmac=CHMAC::NewL(keyVal,sha); TBuf8<1024> baseString; TPtrC8 hashedSig(hmac->Hash(baseString)); TImCodecB64 b64enc; b64enc.Initialise(); HBufC8* buf = HBufC8::NewL(hashedSig.Length() * 2); buf->Des().Copy(hashedSig); TBuf8<512> result; b64enc.Encode(buf->Des(),result); result.Copy(result.Left(result.Length())); if(hmac) { delete hmac; hmac=NULL; } digest = QByteArray::fromRawData((char*)result.Ptr(),result.Length()); #endif
It's very easy right?
hope this is useful for thoses like me who want to use qOauth on Symbian
see you.