os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreEntryList.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2004-2009 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 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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 * CSWICertStoreEntryList class implementation
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file 
    22  @internalTechnology
    23 */
    24  
    25 #ifndef __CSWICERTSTOREENTRYLIST_H__
    26 #define __CSWICERTSTOREENTRYLIST_H__
    27 
    28 #include <s32file.h>
    29 
    30 class MCTToken;
    31 class TCTTokenObjectHandle;
    32 class CSWICertStoreEntry;
    33 
    34 /**
    35  * An in-memory list of the certs in the store.
    36  */
    37 NONSHARABLE_CLASS(CSWICertStoreEntryList) : public CBase
    38 	{
    39  public:
    40 	/// Read the cert list from a stream
    41 	static CSWICertStoreEntryList* NewL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex = 0, TInt aStoreIndex = 0);
    42 
    43 	static CSWICertStoreEntryList* NewL();
    44 	
    45 	virtual ~CSWICertStoreEntryList();
    46 
    47 	/// Get the number of certificates in the list
    48 	TInt Count() const;
    49 
    50 	/// Determine whether a certificate exists with the specified label
    51 	TBool LabelExists(const TDesC& aLabel) const;
    52 	
    53 	/// Add a mapping and return its index, takes ownership
    54 	TInt AppendL(CSWICertStoreEntry* aEntry);
    55 	
    56 	/// Removes and an entry from the list
    57 	void Remove(TInt aIndex);
    58 	
    59 	/// Get a mapping given its index.
    60 	const CSWICertStoreEntry& GetByIndex(TInt aIndex) const;
    61 
    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;
    65 	
    66  private:
    67 	CSWICertStoreEntryList();
    68 	void InternalizeL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex, TInt aStoreIndex);
    69 
    70  private:
    71 	RPointerArray<CSWICertStoreEntry> iEntries;
    72 	};
    73 
    74 #endif