×
Namespaces

Variants
Actions

How to create RInteger for RSA

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: savaj (20 Apr 2009)
Last edited: hamishwillee (22 Nov 2011)

To create CRSAPublicKey object from a specified modulus(n) and encryption exponent(e), we need to convert modulus and encryption exponent to RInteger. RInteger is a TInteger derived class allowing the construction of variable length big integers.

RInteger n = RInteger::NewL(exp);  //exp is a descriptor containing encryption exponent(e)
RInteger e = RInteger::NewL(mod); //mod is a descriptor containing modulus(n)
CleanupClosePushL(e);
CleanupClosePushL(n);
 
CRSAPublicKey* publicKey = CRSAPublicKey::NewL(e, n); // create RSA PublicKey
 
CleanupStack::PopAndDestroy(&n);
CleanupStack::PopAndDestroy(&e);


Related pages

This page was last modified on 22 November 2011, at 07:00.
52 page views in the last 30 days.
×