CSecureStore Class Reference

class CSecureStore : public CStreamStore

A stream store whose streams are encrypted.

The secure store is layered over another stream store which acts as the host for the encrypted streams. This stream store is not owned by the secure store, which means that it is possible to to use the secure store to store only a portion of the streams in encrypted form.

Access to the streams in this store is via the normal RStoreWriteStream and RStoreReadStream classes. Internally, TEncryptFilter and TDecryptFilter objects are attached to the streams from the host store in order to do the encryption and decryption.

RStoreWriteStream RStoreReadStream TEncryptFilter TDecryptFilter

Inherits from

Constructor & Destructor Documentation

CSecureStore(CStreamStore &, const CPBEncryptSet &)

CSecureStore ( CStreamStore & aHost,
const CPBEncryptSet & aKey
)

Parameters

CStreamStore & aHost
const CPBEncryptSet & aKey

Member Functions Documentation

DoCommitL()

IMPORT_C void DoCommitL ( ) [protected, virtual]

Commits any changes to the store. For a store that provides atomic updates, this writes all of the pending updates to the to the permanent storage medium. After committing the store contains all or none of the updates since the last commit/revert.

This function provides the implementation for the public CommitL() function.

DoCreateL(TStreamId &)

IMPORT_C MStreamBuf * DoCreateL ( TStreamId & anId ) [protected, virtual]

Creates a new stream in the store. The function gets the allocated stream id in the anId parameter. A stream buffer for the stream should be returned, ready to write into the new stream. This provides the implementation for the RStoreWriteStream::CreateL() functions.

Parameters

TStreamId & anId On return, contains the allocated stream id.

DoDeleteL(TStreamId)

IMPORT_C void DoDeleteL ( TStreamId anId ) [protected, virtual]

Parameters

TStreamId anId

DoExtendL()

IMPORT_C TStreamId DoExtendL ( ) [protected, virtual]

Generates a new stream within this store, and returns its id. This function is intended to create a new stream in advance of being written to.

This is called by ExtendL() .

CStreamStore::ExtendL()

DoReadL(TStreamId)

IMPORT_C MStreamBuf * DoReadL ( TStreamId anId ) const [protected, virtual]

Opens the requested stream for reading. The function should return a stream buffer positioned at the beginning of this stream.

This function is called by the OpenL() and OpenLC() member functions of RStoreReadStream .

RStoreReadStream::OpenL() RStoreReadStream::OpenLC()

Parameters

TStreamId anId The stream to be read.

DoReplaceL(TStreamId)

IMPORT_C MStreamBuf * DoReplaceL ( TStreamId anId ) [protected, virtual]

Parameters

TStreamId anId

DoRevertL()

IMPORT_C void DoRevertL ( ) [protected, virtual]

Discards any pending changes to the store. This includes all changes which have not been committed to a permanent storage medium.

This function provides the implementation for the public Revert() function.

Note:

The function need only be implemented by stores that provide atomic updates, as revert has no meaning for other implementations.

DoWriteL(TStreamId)

IMPORT_C MStreamBuf * DoWriteL ( TStreamId anId ) [protected, virtual]

Parameters

TStreamId anId

Host()

CStreamStore & Host ( ) [private, inline]

Host()

const CStreamStore & Host ( ) const [private, inline]

NewL(CStreamStore &, const CPBEncryptSet &)

IMPORT_C CSecureStore * NewL ( CStreamStore & aHost,
const CPBEncryptSet & aKey
) [static]

Instantiates a secure store.

leave
KErrNoMemory

Parameters

CStreamStore & aHost The stream store acting as host for the secure store's streams.
const CPBEncryptSet & aKey A Password Based Encryption Object used to generate decryption and encryption handling objects. Ownership of this object remains with the caller who should delete it when it is no longer needed.

NewLC(CStreamStore &, const CPBEncryptSet &)

IMPORT_C CSecureStore * NewLC ( CStreamStore & aHost,
const CPBEncryptSet & aKey
) [static]

Instantiates a secure store and pushes a pointer to the object onto the cleanup stack.

leave
KErrNoMemory

Parameters

CStreamStore & aHost The stream store acting as host for the secure store's streams.
const CPBEncryptSet & aKey A Password Based Encryption Object used to generate decryption and encryption handling objects. Ownership of this object remains with the caller who should delete it when it is no longer needed.

PBEKey()

const CPBEncryptSet & PBEKey ( ) const [private, inline]

setEncryptFilterL(HEncryptFilter &, RStoreWriteStream &)

void setEncryptFilterL ( HEncryptFilter & aFilter,
RStoreWriteStream & aStream
) [private]

Parameters

HEncryptFilter & aFilter
RStoreWriteStream & aStream

Member Data Documentation

CStreamStore * iHost

CStreamStore * iHost [private]

const CPBEncryptSet & iKey

const CPBEncryptSet & iKey [private]