CDevEncKeyUtils Class Reference

class CDevEncKeyUtils : public CBase

Provides functions for creating and setting encryption keys.

Inherits from

Constructor & Destructor Documentation

CDevEncKeyUtils()

IMPORT_C CDevEncKeyUtils ( )

C++ constructor.

~CDevEncKeyUtils()

~CDevEncKeyUtils ( ) [virtual]

Destructor.

Member Functions Documentation

Close()

IMPORT_C void Close ( )

Connect()

IMPORT_C TInt Connect ( )

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

IMPORT_C void CreateSetKey ( TRequestStatus & aStatus,
HBufC8 *& aResult,
const TDesC8 & aPassword,
const TInt aLength
) const

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

Parameters

TRequestStatus & aStatus Contains system-wide error code on completion
HBufC8 *& aResult On successful completion, contains PKCS#5 encrypted key (externalized encryption data and ciphertext)
const TDesC8 & aPassword The user password to use for the key
const TInt aLength The desired length of the key

CreateSetKey(TRequestStatus &, const TInt)

IMPORT_C void CreateSetKey ( TRequestStatus & aStatus,
const TInt aLength
) 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 & aStatus Contains system-wide error code on completion
const TInt aLength The desired length of the key

DoCreateSetKeyL(const TDesC8 &, TInt)

void DoCreateSetKeyL ( const TDesC8 & aPassword,
TInt aLength
) const [private]

Parameters

const TDesC8 & aPassword
TInt aLength

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

void DoCreateSetKeyL ( HBufC8 *& aResult,
const TDesC8 & aPassword,
const TInt aLength
) const [private]

Parameters

HBufC8 *& aResult
const TDesC8 & aPassword
const TInt aLength

DoSetKeyL(const TDesC8 &, const TDesC8 &)

void DoSetKeyL ( const TDesC8 & aPkcs5Key,
const TDesC8 & aPassword
) const [private]

Parameters

const TDesC8 & aPkcs5Key
const TDesC8 & aPassword

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

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

Parameters

const CPBEncryptElement * aElement
const TDesC8 & aCiphertext
TDes8 & aResult

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

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

Parameters

RFs & aFs
TDes & aFileName
CFileStore *& aStore

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

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

Parameters

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

LoadDevEncEngineL()

void LoadDevEncEngineL ( ) [private]

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

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

Parameters

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

Pkcs5RemovePadding(TPtr8 &)

void Pkcs5RemovePadding ( TPtr8 & aInput ) const [private]

Parameters

TPtr8 & aInput

ProcessHasCapability(TCapability)

TBool ProcessHasCapability ( TCapability aCapability ) const [private]

Parameters

TCapability aCapability

ResetKey(TRequestStatus &)

IMPORT_C void ResetKey ( TRequestStatus & aStatus ) const

Resets the key in the security driver. Asynchronous function.

Parameters

TRequestStatus & aStatus Contains system-wide error code on completion

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

void SaveKeyL ( 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 void SetKey ( TRequestStatus & aStatus,
const TDesC8 & aPkcs5Key,
const TDesC8 & aPassword
) const

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

Parameters

TRequestStatus & aStatus Contains system-wide error code on completion
const TDesC8 & aPkcs5Key The encrypted PKCS#5 key data (externalized encryption data and ciphertext)
const TDesC8 & aPassword The user password to use for the key

UnloadDevEncEngine()

void UnloadDevEncEngine ( ) [private]

Member Data Documentation

TBool iConnect

TBool iConnect [private]

CDevEncEngineBase * iDevEncEngine

CDevEncEngineBase * iDevEncEngine [private]

RLibrary iLibrary

RLibrary iLibrary [private]