diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-1733B4E1-3264-58DF-957B-F5C0AE1E0644.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-1733B4E1-3264-58DF-957B-F5C0AE1E0644.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,70 @@ + + + + + +Retrieving +KeystoresThis section explains how to retrieve keystore implementations. +

Keystores can be used in manager mode or user mode. In manager +mode, modifications to an existing keystore can be performed through the MCTKeyStoreManager interface. +In user mode, a keystore can be viewed using the MCTKeyStore interface.

The +following steps explain the process of retrieving keystores:

+ + +Create an object of type CUnifiedKeyStore using CUnifiedKeyStore::NewL() or CUnifiedKeyStore::NewLC(). + + +Initialise the member functions and keystore using the asynchronous +function CUnifiedKeyStore::Initialize(). + + +Retrieve the keystore in either of the following modes. + + +Read/write mode +Use the CUnifiedKeyStore::KeyStoreManager() function +to get the required MCTKeyStoreManager object using an +appropriate index of the keystore. + + +Read-only mode +Use the CUnifiedKeyStore::KeyStore() function to +get the required MCTKeyStore object using an appropriate +index of the keystore. + + + + +

Returns a keystore, which can be used to perform operations.

The +following code snippet shows how to retrieve keystores in manager mode.

+//Create a file system session object +RFs iFs; +CleanupClosePushL(&iFs); + +... + + +//Initialise the keystore and member functions +CUnifiedKeyStore* keyStore = CUnifiedKeyStore::NewL(fs); +keyStore->Initialize(iStatus); //iStatus is a TRequestStatus object + +... + + +//Retrieve the keystore present at the specified index +//If the keystore index is invalid +//or the specified keystore cannot be opened in manager mode +//then the manager object is NULL + +MCTKeyStoreManager& manager = keyStore->KeyStoreManager(0); + + +//Clean up +CleanupStack::PopAndDestroy(); // iFs
+
\ No newline at end of file