os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreEntryList.h
First public contribution.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * CSWICertStoreEntryList class implementation
25 #ifndef __CSWICERTSTOREENTRYLIST_H__
26 #define __CSWICERTSTOREENTRYLIST_H__
31 class TCTTokenObjectHandle;
32 class CSWICertStoreEntry;
35 * An in-memory list of the certs in the store.
37 NONSHARABLE_CLASS(CSWICertStoreEntryList) : public CBase
40 /// Read the cert list from a stream
41 static CSWICertStoreEntryList* NewL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex = 0, TInt aStoreIndex = 0);
43 static CSWICertStoreEntryList* NewL();
45 virtual ~CSWICertStoreEntryList();
47 /// Get the number of certificates in the list
50 /// Determine whether a certificate exists with the specified label
51 TBool LabelExists(const TDesC& aLabel) const;
53 /// Add a mapping and return its index, takes ownership
54 TInt AppendL(CSWICertStoreEntry* aEntry);
56 /// Removes and an entry from the list
57 void Remove(TInt aIndex);
59 /// Get a mapping given its index.
60 const CSWICertStoreEntry& GetByIndex(TInt aIndex) const;
62 /// Get a mapping given the cert handle.
63 /// @leave KErrNotFound If the specified cert is not present.
64 const CSWICertStoreEntry& GetByHandleL(const TCTTokenObjectHandle& aHandle) const;
67 CSWICertStoreEntryList();
68 void InternalizeL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex, TInt aStoreIndex);
71 RPointerArray<CSWICertStoreEntry> iEntries;