diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-48B61662-0A11-4356-9882-7523B04FFD96.dita --- a/Symbian3/SDK/Source/GUID-48B61662-0A11-4356-9882-7523B04FFD96.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-48B61662-0A11-4356-9882-7523B04FFD96.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,70 +1,70 @@ - - - - - -Changing -PassphraseThis section explains how to change the passphrase. -

The following steps explain the process of changing the passphrase:

- -Create a file system -session using an RFs object. - - -Create an object of type CUnifiedKeyStore using CUnifiedKeyStore::NewL() or CUnifiedKeyStore::NewLC(). - - -Initialize the member functions and keystore using the asynchronous -function CUnifiedKeyStore::Initialize(). - - -Obtain the authentication object of a key using the CCTKeyInfo::Protector() function. - - -Invoke the ChangeReferenceData() function for the -authentication object obtained. The keystore prompts the user to enter the -old and new passphrases. - - -

The passphrase is changed for the selected key, if the old passphrase -is entered correctly.

-Example

The -following code snippet shows how to set use policy for a key.

// 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 - - -... - - - -// Change the passphrase -void ChangePassphraseL(CCTKeyInfo& aKey) -{ - MCTAuthenticationObject* authObject = aKey.Protector(); - if (authObject == NULL) - User::Leave(KErrNotSupported); - - authObject->ChangeReferenceData(iStatus); - iState = EChangePassphrase; - SetActive(); -} - - -// Clean up -CleanupStack::PopAndDestroy(); // iFs
+ + + + + +Changing +PassphraseThis section explains how to change the passphrase. +

The following steps explain the process of changing the passphrase:

+ +Create a file system +session using an RFs object. + + +Create an object of type CUnifiedKeyStore using CUnifiedKeyStore::NewL() or CUnifiedKeyStore::NewLC(). + + +Initialize the member functions and keystore using the asynchronous +function CUnifiedKeyStore::Initialize(). + + +Obtain the authentication object of a key using the CCTKeyInfo::Protector() function. + + +Invoke the ChangeReferenceData() function for the +authentication object obtained. The keystore prompts the user to enter the +old and new passphrases. + + +

The passphrase is changed for the selected key, if the old passphrase +is entered correctly.

+Example

The +following code snippet shows how to set use policy for a key.

// 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 + + +... + + + +// Change the passphrase +void ChangePassphraseL(CCTKeyInfo& aKey) +{ + MCTAuthenticationObject* authObject = aKey.Protector(); + if (authObject == NULL) + User::Leave(KErrNotSupported); + + authObject->ChangeReferenceData(iStatus); + iState = EChangePassphrase; + SetActive(); +} + + +// Clean up +CleanupStack::PopAndDestroy(); // iFs
\ No newline at end of file