CPBEncryptParms Class Reference

class CPBEncryptParms : public CBase

Contains the Password Based Encryption parameters. An object of this class can be input for CPBEncryptElement or CPBEncryptSet objects.

Since
v7.0s

Inherits from

Nested Classes and Structures

Public Member Functions
~CPBEncryptParms(void)
IMPORT_C TPBECipherCipher()
voidDeriveKeyL(const TDesC8 &, TDes8 &)
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C TPtrC8IV()
IMPORT_C TIntIterations()
IMPORT_C TKdfKdf()
IMPORT_C CPBEncryptParms *NewL(TPBECipher, const TDesC8 &, const TDesC8 &, TUint)
IMPORT_C CPBEncryptParms *NewL(const CPBEncryptParms &)
IMPORT_C CPBEncryptParms *NewL(RReadStream &)
IMPORT_C CPBEncryptParms *NewL()
IMPORT_C CPBEncryptParms *NewLC(TPBECipher, const TDesC8 &, const TDesC8 &, TUint)
IMPORT_C CPBEncryptParms *NewLC(const CPBEncryptParms &)
IMPORT_C CPBEncryptParms *NewLC(RReadStream &)
IMPORT_C CPBEncryptParms *NewLC()
IMPORT_C voidResizeSaltL(TInt)
IMPORT_C TPtrC8Salt()
IMPORT_C voidSetCipher(TPBECipher)
voidSetCipherL(TPBECipher)
IMPORT_C voidSetIV(const TDesC8 &)
IMPORT_C voidSetIterations(TInt)
IMPORT_C voidSetKdf(TKdf)
Protected Member Functions
CPBEncryptParms(void)
voidConstructL()
voidConstructL(TPBECipher, const TDesC8 &, const TDesC8 &, TUint)
voidConstructL(const CPBEncryptParms &)
voidConstructL(RReadStream &)
Private Member Functions
CPBEncryptParms(const CPBEncryptParms &)
CPBEncryptParms &operator=(const CPBEncryptParms &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTKdf { EKdfPkcs5, EKdfPkcs12 }
Private Attributes
TParamsData *iData
HBufC8 *iIV
TUint iIterations
HBufC8 *iSalt

Constructor & Destructor Documentation

CPBEncryptParms(void)

IMPORT_CCPBEncryptParms(void)[protected]

Constructor

Parameters

void

CPBEncryptParms(const CPBEncryptParms &)

CPBEncryptParms(const CPBEncryptParms &)[private]

Parameters

const CPBEncryptParms &

~CPBEncryptParms(void)

~CPBEncryptParms(void)[virtual]

Destructor

Parameters

void

Member Functions Documentation

Cipher()

IMPORT_C TPBECipherCipher()const

Gets the PBE cipher

ConstructL()

voidConstructL()[protected]

Initialize this object with default cipher, kdf (PKCS#5,) salt length, iteration count, and IV.

ConstructL(TPBECipher, const TDesC8 &, const TDesC8 &, TUint)

voidConstructL(TPBECipheraCipher,
const TDesC8 &aSalt,
const TDesC8 &aIV,
TUintaIterations
)[protected]

Parameters

TPBECipher aCipher
const TDesC8 & aSalt
const TDesC8 & aIV
TUint aIterations

ConstructL(const CPBEncryptParms &)

voidConstructL(const CPBEncryptParms &aParms)[protected]

Parameters

const CPBEncryptParms & aParms

ConstructL(RReadStream &)

voidConstructL(RReadStream &aStream)[protected]

Parameters

RReadStream & aStream

DeriveKeyL(const TDesC8 &, TDes8 &)

voidDeriveKeyL(const TDesC8 &aPassword,
TDes8 &aKeyBuf
)const

Derive a key from this object's kdf, salt, amd iteration count.

Parameters

const TDesC8 & aPasswordUser-supplied password used to generate key.
TDes8 & aKeyBufBuffer to populate with new key. On entry it must be set to the required key length.

ExternalizeL(RWriteStream &)

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalizes the encryption parameters into a write stream.

Parameters

RWriteStream & aStreamThe stream to write to

IV()

IMPORT_C TPtrC8IV()const

Gets the PBE Initialization Vector

Iterations()

IMPORT_C TIntIterations()const

Gets the number of iterations for the PKCS#5 algorithm.

Kdf()

IMPORT_C TKdfKdf()const

Gets the key derivation function (KDF.)

Accessor function returns the key derivation function (KDF) specified by this object.

NewL(TPBECipher, const TDesC8 &, const TDesC8 &, TUint)

IMPORT_C CPBEncryptParms *NewL(TPBECipheraCipher,
const TDesC8 &aSalt,
const TDesC8 &aIV,
TUintaIterations
)[static]

Creates a new CPBEncryptParms object.

Parameters

TPBECipher aCipherThe cipher to use
const TDesC8 & aSaltThe salt
const TDesC8 & aIVThe Initialization Vector
TUint aIterationsThe number of iterations of the PBE algorithm

NewL(const CPBEncryptParms &)

IMPORT_C CPBEncryptParms *NewL(const CPBEncryptParms &aParms)[static]

Creates a new CPBEncryptParms object from an existing object.

Parameters

const CPBEncryptParms & aParmsThe existing encryption parameters object

NewL(RReadStream &)

IMPORT_C CPBEncryptParms *NewL(RReadStream &aStream)[static]

Internalizes encryption parameter data from a read stream.

Parameters

RReadStream & aStreamThe read stream to be internalized

NewL()

IMPORT_C CPBEncryptParms *NewL()[static]

This factory function allocates an encryption parameters object with default settings. The individual settings can be retrieved and modified with the accessor and mutator functions after this object has been created.

This factory function is provided so that individual parameters can be modified without providing many factory functions.

NewLC(TPBECipher, const TDesC8 &, const TDesC8 &, TUint)

IMPORT_C CPBEncryptParms *NewLC(TPBECipheraCipher,
const TDesC8 &aSalt,
const TDesC8 &aIV,
TUintaIterations
)[static]

Creates a new CPBEncryptParms object and puts a pointer to it onto the cleanup stack.

Parameters

TPBECipher aCipherThe cipher to use
const TDesC8 & aSaltThe salt
const TDesC8 & aIVThe Initialization Vector
TUint aIterationsThe number of iterations of the PBE algorithm

NewLC(const CPBEncryptParms &)

IMPORT_C CPBEncryptParms *NewLC(const CPBEncryptParms &aParms)[static]

Creates a new CPBEncryptParms object from an existing object and puts a pointer to it onto the cleanup stack.

Parameters

const CPBEncryptParms & aParmsThe existing encryption parameters object

NewLC(RReadStream &)

IMPORT_C CPBEncryptParms *NewLC(RReadStream &aStream)[static]

Internalizes encryption parameter data from a read stream, and puts a pointer to the new object onto the cleanup stack.

Parameters

RReadStream & aStreamThe read stream to be internalized

NewLC()

IMPORT_C CPBEncryptParms *NewLC()[static]

Similar to the NewL overload which takes no arguments, this function additionally puts the allocated instance of CPBEncryptParms on the cleanup stack.

ResizeSaltL(TInt)

IMPORT_C voidResizeSaltL(TIntaNewLen)

Resize the current salt and replace its contents.

Parameters

TInt aNewLenNew salt length.

Salt()

IMPORT_C TPtrC8Salt()const

Gets the PBE salt

SetCipher(TPBECipher)

IMPORT_C voidSetCipher(TPBECipheraCipher)

Replace the current cipher. This function resizes the IV and replaces its existing contents.

Use SetCipherL instead. SetCipherL

Parameters

TPBECipher aCipherNew cipher.

SetCipherL(TPBECipher)

voidSetCipherL(TPBECipheraCipher)[inline]

Replace the current cipher. This function resizes the IV and replaces its existing contents.

leave
System wide error code.

Parameters

TPBECipher aCipherNew cipher.

SetIV(const TDesC8 &)

IMPORT_C voidSetIV(const TDesC8 &aNewIv)

Replace the initialization vector.

Parameters

const TDesC8 & aNewIvNew initialization vector length. This must have no more than KPBEMaxCipherIVBytes bytes.

SetIterations(TInt)

IMPORT_C voidSetIterations(TIntaIterCount)

Replace the current iteration count with the supplied value.

Parameters

TInt aIterCountNumber of iterations to apply in the KDF.

SetKdf(TKdf)

IMPORT_C voidSetKdf(TKdfaKdf)

Replace the current key derivation function.

Parameters

TKdf aKdfKey derivation function.

operator=(const CPBEncryptParms &)

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

Parameters

const CPBEncryptParms &

Member Enumerations Documentation

Enum TKdf

Key derivation function. This does not affect the authentication key, which always uses PKCS#5.

Enumerators

EKdfPkcs5
EKdfPkcs12

Member Data Documentation

TParamsData * iData

TParamsData *iData[private]

HBufC8 * iIV

HBufC8 *iIV[private]

TUint iIterations

TUint iIterations[private]

HBufC8 * iSalt

HBufC8 *iSalt[private]