CDevEncKeyUtils Class Reference

class CDevEncKeyUtils : public CBase

Provides functions for creating and setting encryption keys.

Inherits from

Constructor & Destructor Documentation

CDevEncKeyUtils()

IMPORT_CCDevEncKeyUtils()

C++ constructor.

~CDevEncKeyUtils()

~CDevEncKeyUtils()[virtual]

Destructor.

Member Functions Documentation

Close()

IMPORT_C voidClose()

Connect()

IMPORT_C TIntConnect()

CreateSetKey(TRequestStatus &, HBufC8 *&, const TDesC8 &, const TInt)

IMPORT_C voidCreateSetKey(TRequestStatus &aStatus,
HBufC8 *&aResult,
const TDesC8 &aPassword,
const TIntaLength
)const

Creates a PKCS#5 key and takes it into use by loading it into the security driver. Asynchronous function.

Parameters

TRequestStatus & aStatusContains system-wide error code on completion
HBufC8 *& aResultOn successful completion, contains PKCS#5 encrypted key (externalized encryption data and ciphertext)
const TDesC8 & aPasswordThe user password to use for the key
const TInt aLengthThe desired length of the key

CreateSetKey(TRequestStatus &, const TInt)

IMPORT_C voidCreateSetKey(TRequestStatus &aStatus,
const TIntaLength
)const

Creates a PKCS#5 key and takes it into use by loading it into the security driver. Asynchronous function. A random password is generated and the resulting key is ignored. After completion, the key exists only in the security driver and cannot be retrieved.

Parameters

TRequestStatus & aStatusContains system-wide error code on completion
const TInt aLengthThe desired length of the key

DoCreateSetKeyL(const TDesC8 &, TInt)

voidDoCreateSetKeyL(const TDesC8 &aPassword,
TIntaLength
)const [private]

Parameters

const TDesC8 & aPassword
TInt aLength

DoCreateSetKeyL(HBufC8 *&, const TDesC8 &, const TInt)

voidDoCreateSetKeyL(HBufC8 *&aResult,
const TDesC8 &aPassword,
const TIntaLength
)const [private]

Parameters

HBufC8 *& aResult
const TDesC8 & aPassword
const TInt aLength

DoSetKeyL(const TDesC8 &, const TDesC8 &)

voidDoSetKeyL(const TDesC8 &aPkcs5Key,
const TDesC8 &aPassword
)const [private]

Parameters

const TDesC8 & aPkcs5Key
const TDesC8 & aPassword

ExternalizeKeyL(const CPBEncryptElement *, const TDesC8 &, TDes8 &)

voidExternalizeKeyL(const CPBEncryptElement *aElement,
const TDesC8 &aCiphertext,
TDes8 &aResult
)const [private]

Parameters

const CPBEncryptElement * aElement
const TDesC8 & aCiphertext
TDes8 & aResult

GetNewFileStoreL(RFs &, TDes &, CFileStore *&)

voidGetNewFileStoreL(RFs &aFs,
TDes &aFileName,
CFileStore *&aStore
)const [private]

Parameters

RFs & aFs
TDes & aFileName
CFileStore *& aStore

InternalizeKeyL(CPBEncryptElement *&, const TDesC8 &, HBufC8 *&, const TDesC8 &)

voidInternalizeKeyL(CPBEncryptElement *&aElement,
const TDesC8 &aPassword,
HBufC8 *&aCiphertext,
const TDesC8 &aSource
)const [private]

Parameters

CPBEncryptElement *& aElement
const TDesC8 & aPassword
HBufC8 *& aCiphertext
const TDesC8 & aSource

LoadDevEncEngineL()

voidLoadDevEncEngineL()[private]

LoadKeyLC(RFs &, const TFileName &, CPBEncryptionData *&, HBufC8 *&)

voidLoadKeyLC(RFs &aFs,
const TFileName &aFileName,
CPBEncryptionData *&aData,
HBufC8 *&aCiphertext
)const [private]

Parameters

RFs & aFs
const TFileName & aFileName
CPBEncryptionData *& aData
HBufC8 *& aCiphertext

Pkcs5RemovePadding(TPtr8 &)

voidPkcs5RemovePadding(TPtr8 &aInput)const [private]

Parameters

TPtr8 & aInput

ProcessHasCapability(TCapability)

TBool ProcessHasCapability(TCapabilityaCapability)const [private]

Parameters

TCapability aCapability

ResetKey(TRequestStatus &)

IMPORT_C voidResetKey(TRequestStatus &aStatus)const

Resets the key in the security driver. Asynchronous function.

Parameters

TRequestStatus & aStatusContains system-wide error code on completion

SaveKeyL(CFileStore *, const CPBEncryptElement *, const TDesC8 &)

voidSaveKeyL(CFileStore *aStore,
const CPBEncryptElement *aSet,
const TDesC8 &aCiphertext
)const [private]

Parameters

CFileStore * aStore
const CPBEncryptElement * aSet
const TDesC8 & aCiphertext

SetKey(TRequestStatus &, const TDesC8 &, const TDesC8 &)

IMPORT_C voidSetKey(TRequestStatus &aStatus,
const TDesC8 &aPkcs5Key,
const TDesC8 &aPassword
)const

Sets the specified PKCS#5 key in the security driver. Asynchronous function.

Parameters

TRequestStatus & aStatusContains system-wide error code on completion
const TDesC8 & aPkcs5KeyThe encrypted PKCS#5 key data (externalized encryption data and ciphertext)
const TDesC8 & aPasswordThe user password to use for the key

UnloadDevEncEngine()

voidUnloadDevEncEngine()[private]

Member Data Documentation

TBool iConnect

TBool iConnect[private]

CDevEncEngineBase * iDevEncEngine

CDevEncEngineBase *iDevEncEngine[private]

RLibrary iLibrary

RLibrary iLibrary[private]