Initial contribution of the Adaptation Documentation.
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE task
PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-6A770434-EF8A-5ECC-BB74-2E7FC4A9E360" xml:lang="en"><title> Listing
Keys</title><shortdesc>This section explains how to list keys in all the keystores.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<context><p>Use the <xref href="GUID-818689D6-EB99-382E-A435-D9C6C5D464DE.dita#GUID-818689D6-EB99-382E-A435-D9C6C5D464DE/GUID-8B22E1BC-D779-32DC-9C0A-CA37E4C0A81B"><apiname>CUnifiedKeyStore::List()</apiname></xref> function to
list the keys in all of the keystores. </p><p> The following steps explain
the process of listing keys:</p> </context>
<steps id="GUID-C16B6DEE-9CAD-59D1-8CDA-92C37A0179CB">
<step id="GUID-F131856E-BE3D-5ECD-B95B-23A025A8FDF0"><cmd/>
<info>Create a file system session using an <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita"><apiname>RFs</apiname></xref> object. </info>
</step>
<step id="GUID-79CA45DF-F8FE-5EB0-9600-A0D8238D065B"><cmd/>
<info>Create an object of type CUnifiedKeyStore using <xref href="GUID-818689D6-EB99-382E-A435-D9C6C5D464DE.dita#GUID-818689D6-EB99-382E-A435-D9C6C5D464DE/GUID-C7A96153-4179-3B3F-878D-1EAA64A98D39"><apiname>CUnifiedKeyStore::NewL()</apiname></xref> or <xref href="GUID-818689D6-EB99-382E-A435-D9C6C5D464DE.dita#GUID-818689D6-EB99-382E-A435-D9C6C5D464DE/GUID-217FBB3B-CEF5-36F2-A612-EDDA0982053C"><apiname>CUnifiedKeyStore::NewLC()</apiname></xref>. </info>
</step>
<step id="GUID-9CA5BA80-44A3-5117-8923-7C5E13F6CE2E"><cmd/>
<info>Initialise the member functions and keystore using the asynchronous
function <xref href="GUID-818689D6-EB99-382E-A435-D9C6C5D464DE.dita#GUID-818689D6-EB99-382E-A435-D9C6C5D464DE/GUID-6C5D732C-1FD1-3EF0-AC90-87690F891B8D"><apiname>CUnifiedKeyStore::Initialize()</apiname></xref>. </info>
</step>
<step id="GUID-FB673E4A-447F-5E6C-BE68-DDFE2C29372B"><cmd/>
<info>Use the <xref href="GUID-818689D6-EB99-382E-A435-D9C6C5D464DE.dita#GUID-818689D6-EB99-382E-A435-D9C6C5D464DE/GUID-8B22E1BC-D779-32DC-9C0A-CA37E4C0A81B"><apiname>CUnifiedKeyStore::List()</apiname></xref> function to list
the keys in the keystores. </info>
</step>
</steps>
<result><p>The <codeph>List()</codeph> function returns all the keys from
all the keystores. </p> </result>
<example><title>Example</title> <p>The following code snippet shows how to
set a file system session object, initialise keystore and member functions,
and list keys. </p> <codeblock id="GUID-AD94670F-BF1F-58F9-B283-0810234B1483" xml:space="preserve">
//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
...
//List the keys in the keystores
RPointerArray<CCTKeyInfo> iKeys; // This variable will contain the result after the completion of the list operation
TCTKeyAttributeFilter filter.iUsage = EPKCS15UsageAll;
keyStore->List(iKeys, filter, iStatus);
//Clean up
CleanupStack::PopAndDestroy(); // iFs</codeblock> </example>
</taskbody></task>