CDHKeyPair Class Reference

#include <asymmetrickeys.h>

class CDHKeyPair : public CBase

Inherits from

Detailed Description

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

Member Attribute Documentation

iPrivate

CDHPrivateKey *iPrivate[protected]

The DH private key

iPublic

CDHPublicKey *iPublic[protected]

The DH public key

Constructor & Destructor Documentation

CDHKeyPair ( void )

IMPORT_CCDHKeyPair(void)[protected]

Default constructor

~CDHKeyPair ( void )

IMPORT_C~CDHKeyPair(void)[virtual]

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

Member Function Documentation

ConstructL ( RInteger &, RInteger & )

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

Constructor

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

ConstructL ( RInteger &, RInteger &, RInteger & )

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

Constructor

Parameters
aNThe DH parameter, n (a large prime)
aGThe DH parameter, g (the generator)
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.

Parameters
aNThe DH parameter, n (a large prime)
aGThe DH parameter, g (the generator)
Return Value
A pointer to a new CDHKeyPair object
Leave Codes
KErrArgumentIf aG is out of bounds

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.

Parameters
aNThe DH parameter, n (a large prime)
aGThe DH parameter, g (the generator)
axThe DH value, x (a random large integer)
Return Value
A pointer to a new CDHKeyPair object
Leave Codes
KErrArgumentIf either aG or ax are out of bounds

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.

Parameters
aNThe DH parameter, n (a large prime)
aGThe DH parameter, g (the generator)
Return Value
A pointer to a new CDHKeyPair object
Leave Codes
KErrArgumentIf aG is out of bounds

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.

Parameters
aNThe DH parameter, n (a large prime)
aGThe DH parameter, g (the generator)
axThe DH value, x (a random large integer)
Return Value
A pointer to a new CDHKeyPair object
Leave Codes
KErrArgumentIf either aG or ax are out of bounds

PrivateKey ( void )

IMPORT_C const CDHPrivateKey &PrivateKey(void)const

Gets the DH private key

Return Value
The DH private key

PublicKey ( void )

IMPORT_C const CDHPublicKey &PublicKey(void)const

Gets the DH public key

Return Value
The DH public key