About converting from a string reference

I am doing RSA encryption

I want to convert a public key class reference to a string so that I can navigate to the server

//declaration

const CRSAPrivateKey &iRSAPrivateKey =iRSAKeyPair->PrivateKey();

const CRSAPublicKey &iRSAPublicKey =iRSAKeyPair->PublicKey() ;

      

i convert &iRSAPublicKey

toTBuf

I tried a lot but was unable to convert

Plz help me in the situation

early

+1


a source to share


1 answer


If you are using CRSAPublicKey you probably downloaded the Symbian Crypto Library and its documentation from http://developer.symbian.com/main/tools_and_sdks/developer_tools/supported/crypto_api/index.jsp

Granted, the documentation is not explicit, but I would take the risk that you can simply send the module and exponent components to any other RSA mechanism to recover the public key:

HBufC8* localModulusBuffer = iRSAPublicKey.N().BufferLC();

HBufC8* localExponentBuffer = iRSAPublicKey.E().BufferLC();

      



Then just copy 2 HBufC8 to TBuf if you really need it.

Just remember that methods with a trailing "C" leave what they return to the cleanup stack.

+1


a source







All Articles