|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-6A770434-EF8A-5ECC-BB74-2E7FC4A9E360" xml:lang="en"><title> Listing |
|
13 Keys</title><shortdesc>This section explains how to list keys in all the keystores.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
14 <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 |
|
15 list the keys in all of the keystores. </p><p> The following steps explain |
|
16 the process of listing keys:</p> </context> |
|
17 <steps id="GUID-C16B6DEE-9CAD-59D1-8CDA-92C37A0179CB"> |
|
18 <step id="GUID-F131856E-BE3D-5ECD-B95B-23A025A8FDF0"><cmd/> |
|
19 <info>Create a file system session using an <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita"><apiname>RFs</apiname></xref> object. </info> |
|
20 </step> |
|
21 <step id="GUID-79CA45DF-F8FE-5EB0-9600-A0D8238D065B"><cmd/> |
|
22 <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> |
|
23 </step> |
|
24 <step id="GUID-9CA5BA80-44A3-5117-8923-7C5E13F6CE2E"><cmd/> |
|
25 <info>Initialise the member functions and keystore using the asynchronous |
|
26 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> |
|
27 </step> |
|
28 <step id="GUID-FB673E4A-447F-5E6C-BE68-DDFE2C29372B"><cmd/> |
|
29 <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 |
|
30 the keys in the keystores. </info> |
|
31 </step> |
|
32 </steps> |
|
33 <result><p>The <codeph>List()</codeph> function returns all the keys from |
|
34 all the keystores. </p> </result> |
|
35 <example><title>Example</title> <p>The following code snippet shows how to |
|
36 set a file system session object, initialise keystore and member functions, |
|
37 and list keys. </p> <codeblock id="GUID-AD94670F-BF1F-58F9-B283-0810234B1483" xml:space="preserve"> |
|
38 //Create a file system session object |
|
39 RFs iFs; |
|
40 CleanupClosePushL(&iFs); |
|
41 |
|
42 |
|
43 //Initialise the keystore and member functions |
|
44 CUnifiedKeyStore* keyStore = CUnifiedKeyStore::NewL(fs); |
|
45 keyStore->Initialize(iStatus); //iStatus is a TRequestStatus object |
|
46 |
|
47 ... |
|
48 |
|
49 //List the keys in the keystores |
|
50 RPointerArray<CCTKeyInfo> iKeys; // This variable will contain the result after the completion of the list operation |
|
51 TCTKeyAttributeFilter filter.iUsage = EPKCS15UsageAll; |
|
52 keyStore->List(iKeys, filter, iStatus); |
|
53 |
|
54 //Clean up |
|
55 CleanupStack::PopAndDestroy(); // iFs</codeblock> </example> |
|
56 </taskbody></task> |