CDHKeyPair Class Reference

class CDHKeyPair : public CBase

This class is capable of generating a Diffie-Hellman (DH) public/private key pair.

Inherits from

Constructor & Destructor Documentation

CDHKeyPair(void)

IMPORT_CCDHKeyPair(void)[protected]

Default constructor

Parameters

void

CDHKeyPair(const CDHKeyPair &)

CDHKeyPair(const CDHKeyPair &)[private]

Parameters

const CDHKeyPair &

~CDHKeyPair(void)

IMPORT_C~CDHKeyPair(void)[virtual]

The destructor frees all resources owned by the object, prior to its destruction.

Parameters

void

Member Functions Documentation

ConstructL(RInteger &, RInteger &)

IMPORT_C voidConstructL(RInteger &aN,
RInteger &aG
)[protected]

Constructor

Parameters

RInteger & aNThe DH parameter, n (a large prime)
RInteger & aGThe DH parameter, g (the generator)

ConstructL(RInteger &, RInteger &, RInteger &)

IMPORT_C voidConstructL(RInteger &aN,
RInteger &aG,
RInteger &ax
)[protected]

Constructor

Parameters

RInteger & aNThe DH parameter, n (a large prime)
RInteger & aGThe DH parameter, g (the generator)
RInteger & axThe DH value, x (a random large integer)

NewL(RInteger &, RInteger &)

IMPORT_C CDHKeyPair *NewL(RInteger &aN,
RInteger &aG
)[static]

Creates a new DH key pair from a random large integer, and a specified large prime and generator.

leave
KErrArgument If aG is out of bounds

Parameters

RInteger & aNThe DH parameter, n (a large prime)
RInteger & aGThe DH parameter, g (the generator)

NewL(RInteger &, RInteger &, RInteger &)

IMPORT_C CDHKeyPair *NewL(RInteger &aN,
RInteger &aG,
RInteger &ax
)[static]

Creates a new DH key pair from a specified large prime, generator, and random large integer.

leave
KErrArgument If either aG or ax are out of bounds

Parameters

RInteger & aNThe DH parameter, n (a large prime)
RInteger & aGThe DH parameter, g (the generator)
RInteger & axThe DH value, x (a random large integer)

NewLC(RInteger &, RInteger &)

IMPORT_C CDHKeyPair *NewLC(RInteger &aN,
RInteger &aG
)[static]

Creates a new DH key pair from a random large integer, and a specified large prime and generator.

The returned pointer is put onto the cleanup stack.

leave
KErrArgument If aG is out of bounds

Parameters

RInteger & aNThe DH parameter, n (a large prime)
RInteger & aGThe DH parameter, g (the generator)

NewLC(RInteger &, RInteger &, RInteger &)

IMPORT_C CDHKeyPair *NewLC(RInteger &aN,
RInteger &aG,
RInteger &ax
)[static]

Creates a new DH key pair from a specified large prime, generator, and random large integer.

The returned pointer is put onto the cleanup stack.

leave
KErrArgument If either aG or ax are out of bounds

Parameters

RInteger & aNThe DH parameter, n (a large prime)
RInteger & aGThe DH parameter, g (the generator)
RInteger & axThe DH value, x (a random large integer)

PrivateKey(void)

IMPORT_C const CDHPrivateKey &PrivateKey(void)const

Gets the DH private key

Parameters

void

PublicKey(void)

IMPORT_C const CDHPublicKey &PublicKey(void)const

Gets the DH public key

Parameters

void

operator=(const CDHKeyPair &)

CDHKeyPair &operator=(const CDHKeyPair &)[private]

Parameters

const CDHKeyPair &

Member Data Documentation

CDHPrivateKey * iPrivate

CDHPrivateKey *iPrivate[protected]

The DH private key

CDHPublicKey * iPublic

CDHPublicKey *iPublic[protected]

The DH public key