cpsecplugins/cpadvancedsecplugin/inc/cpcertdatacontainer.h
branchRCL_3
changeset 22 03674e5abf46
parent 21 09b1ac925e3f
child 23 94da73d93b58
equal deleted inserted replaced
21:09b1ac925e3f 22:03674e5abf46
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Declaration of the CCertManUIKeeper class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef  CPCERTDATACONTAINER_H
       
    19 #define  CPCERTDATACONTAINER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <unifiedcertstore.h>
       
    23 #include <mctwritablecertstore.h>
       
    24 #include <unifiedkeystore.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CpCertManUISyncWrapper;
       
    28 class CpCertManUICertData;
       
    29 
       
    30 // CONSTANTS
       
    31 const TUid KCMDeviceCertStoreTokenUid = { 0x101FB668 };
       
    32 const TUid KCMDeviceKeyStoreTokenUid = { 0x101FB66A };
       
    33 const TUid KCMTrustedServerTokenUid = { 0x101FB66F };
       
    34 const TUid KCMFileKeyStoreTokenUid = { 0x101F7333 };
       
    35 const TUid KCMFileCertStoreTokenUid = { 0x101F501A };
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  CpCertDataContainer retrieves and holds certificates.
       
    42 *
       
    43 */
       
    44 class CpCertDataContainer : public CBase
       
    45     {
       
    46     public: // functions
       
    47 
       
    48         /**
       
    49         * Default constructor
       
    50         */
       
    51 		CpCertDataContainer();
       
    52 
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         ~CpCertDataContainer();
       
    57 
       
    58         /**
       
    59         * NewL
       
    60         */
       
    61         static class CpCertDataContainer* NewL();
       
    62 
       
    63         /**
       
    64         * NewLC
       
    65         */
       
    66         static class CpCertDataContainer* NewLC();
       
    67 
       
    68         CUnifiedCertStore*& CertManager();
       
    69 
       
    70         CUnifiedKeyStore*& KeyManager();
       
    71 
       
    72         /**
       
    73         * Checks that cacerts.dat file is not corrupt
       
    74         * and returns CA certificates from it.
       
    75         */
       
    76         void RefreshCAEntriesL();
       
    77 
       
    78         /**
       
    79         * Checks that cacerts.dat file is not corrupt
       
    80         * and returns user certificates from it.
       
    81         */
       
    82         void RefreshUserCertEntriesL();
       
    83 
       
    84         /**
       
    85         * Returns peer certificates.
       
    86         */
       
    87         void RefreshPeerCertEntriesL();
       
    88 
       
    89         /**
       
    90         * Returns peer certificates.
       
    91         */
       
    92         void RefreshDeviceCertEntriesL();
       
    93 
       
    94         /**
       
    95         * Shows error note
       
    96         */
       
    97         void ShowErrorNoteL(TInt aError);
       
    98 
       
    99     public: //data
       
   100 
       
   101         /**
       
   102         * To store CA certificate entries for Authority and Trust view
       
   103         * Includes label from x509certnameparser.
       
   104         */
       
   105         RMPointerArray<CpCertManUICertData>     iCALabelEntries;
       
   106 
       
   107         /**
       
   108         * To store CA certificate entries for Authority and Trust view
       
   109         * Includes label from x509certnameparser.
       
   110         */
       
   111         RMPointerArray<CpCertManUICertData>     iUserLabelEntries;
       
   112 
       
   113         /**
       
   114         * To store Peer certificate entries for Trusted Site view
       
   115         * Includes label from x509certnameparser.
       
   116         */
       
   117         RMPointerArray<CpCertManUICertData>     iPeerLabelEntries;
       
   118 
       
   119         /**
       
   120         * To store Peer certificate entries for Device certificate view
       
   121         * Includes label from x509certnameparser.
       
   122         */
       
   123         RMPointerArray<CpCertManUICertData>     iDeviceLabelEntries;
       
   124 
       
   125         /**
       
   126         * Used to wrap asynchronous calls
       
   127         */
       
   128         CpCertManUISyncWrapper*          iWrapper;
       
   129 
       
   130         /**
       
   131         * File session handle.
       
   132         */
       
   133         RFs                             iRfs;
       
   134 
       
   135     private: // functions
       
   136 
       
   137         void ConstructL();
       
   138 
       
   139     private: //data
       
   140 
       
   141         /**
       
   142         * To list certificates with criteria.
       
   143         */
       
   144         CCertAttributeFilter*   iFilter;
       
   145 
       
   146         /**
       
   147         * To list keys with criteria.
       
   148         */
       
   149 
       
   150         TCTKeyAttributeFilter*    iKeyFilter;
       
   151 
       
   152         /**
       
   153         * UnifiedCertStore
       
   154         */
       
   155         CUnifiedCertStore*    iStore;
       
   156 
       
   157         /**
       
   158         * UnifiedKeyStore
       
   159         */
       
   160         CUnifiedKeyStore*   iKeyStore;
       
   161 
       
   162         /**
       
   163         * To store CA certificate entries.
       
   164         */
       
   165         RMPointerArray<CCTCertInfo>     iCAEntries;
       
   166 
       
   167         /**
       
   168         * To store User certificate entries.
       
   169         */
       
   170         RMPointerArray<CCTCertInfo>     iUserEntries;
       
   171 
       
   172         /**
       
   173         * To store Peer certificate entries.
       
   174         */
       
   175         RMPointerArray<CCTCertInfo>     iPeerEntries;
       
   176 
       
   177         /**
       
   178         * To store Device certificate entries.
       
   179         */
       
   180         RMPointerArray<CCTCertInfo>     iDeviceEntries;
       
   181 
       
   182         /**
       
   183         * To store Key entries
       
   184         */
       
   185         RMPointerArray<CCTKeyInfo>      iKeyEntries;
       
   186 
       
   187    };
       
   188 
       
   189 /**
       
   190 *  Small helper class to put label and certificate in same class.
       
   191 *
       
   192 */
       
   193 class CpCertManUICertData : public CBase
       
   194     {
       
   195     public:
       
   196 
       
   197 	CpCertManUICertData();
       
   198 
       
   199         void Release();
       
   200 
       
   201         HBufC* iCAEntryLabel;
       
   202         HBufC* iUserEntryLabel;
       
   203         HBufC* iPeerEntryLabel;
       
   204         HBufC* iDeviceEntryLabel;
       
   205         CCTCertInfo* iCAEntry;
       
   206         CCTCertInfo* iUserEntry;
       
   207         CCTCertInfo* iPeerEntry;
       
   208         CCTCertInfo* iDeviceEntry;
       
   209 
       
   210     private:
       
   211         ~CpCertManUICertData();
       
   212 
       
   213     };
       
   214 
       
   215 
       
   216 #endif // CPCERTDATACONTAINER_H