pkiutilities/DeviceToken/Inc/DevandTruSrvCertStoreEntryList.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2006 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:   The header file of DevandTruSrvCertStoreEntryList
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __DEVANDTRUSRVCERTSTOREENTRYLIST_H__
       
    21 #define __DEVANDTRUSRVCERTSTOREENTRYLIST_H__
       
    22 
       
    23 #include <s32file.h>
       
    24 
       
    25 class CDevandTruSrvCertStoreEntry;
       
    26 
       
    27 /**
       
    28  * An in-memory list of the certs in the store
       
    29  *
       
    30  * @lib
       
    31  * @since S60 v3.2.
       
    32  */
       
    33 class CDevandTruSrvCertStoreEntryList : public CBase
       
    34     {
       
    35     public:
       
    36     
       
    37         // Create a new, empty cert list
       
    38         static CDevandTruSrvCertStoreEntryList* NewLC();
       
    39 
       
    40         // Read the cert list from a stream
       
    41         static CDevandTruSrvCertStoreEntryList* NewL(RReadStream& aStream);
       
    42 
       
    43         virtual ~CDevandTruSrvCertStoreEntryList();
       
    44 
       
    45         // Write the cert list to a stream
       
    46         void ExternalizeL(RWriteStream& aStream) const;
       
    47 
       
    48         // Get the number of certificates in the list
       
    49         TInt Count() const;
       
    50 
       
    51         /**
       
    52          * Get the index of a mapping given the cert handle
       
    53          *
       
    54          * @param aHandle 
       
    55          * @return The index of the cert or KErrNotFound if it is not present
       
    56          */
       
    57         TInt IndexForHandle(TInt aHandle) const;
       
    58 
       
    59         // Determine whether a certificate exists with the specified label
       
    60         TBool LabelExists(const TDesC& aLabel) const;
       
    61 
       
    62         /**
       
    63          * Get a mapping given the cert handle
       
    64          * leave KErrNotFound If the specified cert is not present
       
    65          * 
       
    66          * @param aHandle 
       
    67          * @return 
       
    68          */
       
    69         const CDevandTruSrvCertStoreEntry& GetByHandleL(TInt aHandle) const;
       
    70 
       
    71         // Get a mapping given its index.
       
    72         const CDevandTruSrvCertStoreEntry& GetByIndex(TInt aIndex) const;
       
    73 
       
    74         // Get the next free handle to use when adding a cert
       
    75         TInt NextFreeHandle() const;
       
    76 
       
    77         // Add a mapping and return its index, takes ownership
       
    78         TInt AppendL(CDevandTruSrvCertStoreEntry* aEntry);
       
    79 
       
    80         // Removes and returns an entry from the list, relinquishes ownership
       
    81         CDevandTruSrvCertStoreEntry* Remove(TInt aIndex);
       
    82 
       
    83         // Replace an entry and return the old one, takes/relinquishes ownership
       
    84         CDevandTruSrvCertStoreEntry* Replace(TInt aIndex, CDevandTruSrvCertStoreEntry* aEntry); 
       
    85 
       
    86     private:
       
    87         
       
    88         CDevandTruSrvCertStoreEntryList();
       
    89         
       
    90         void InternalizeL(RReadStream& aStream);
       
    91 
       
    92     private:
       
    93         
       
    94         RPointerArray<CDevandTruSrvCertStoreEntry> iEntries;
       
    95     };
       
    96 
       
    97 #endif //__DEVANDTRUSRVCERTSTOREENTRYLIST_H__
       
    98 
       
    99 //EOF
       
   100