os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreEntryList.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreEntryList.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +/*
1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* CSWICertStoreEntryList class implementation
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @internalTechnology
1.26 +*/
1.27 +
1.28 +#ifndef __CSWICERTSTOREENTRYLIST_H__
1.29 +#define __CSWICERTSTOREENTRYLIST_H__
1.30 +
1.31 +#include <s32file.h>
1.32 +
1.33 +class MCTToken;
1.34 +class TCTTokenObjectHandle;
1.35 +class CSWICertStoreEntry;
1.36 +
1.37 +/**
1.38 + * An in-memory list of the certs in the store.
1.39 + */
1.40 +NONSHARABLE_CLASS(CSWICertStoreEntryList) : public CBase
1.41 + {
1.42 + public:
1.43 + /// Read the cert list from a stream
1.44 + static CSWICertStoreEntryList* NewL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex = 0, TInt aStoreIndex = 0);
1.45 +
1.46 + static CSWICertStoreEntryList* NewL();
1.47 +
1.48 + virtual ~CSWICertStoreEntryList();
1.49 +
1.50 + /// Get the number of certificates in the list
1.51 + TInt Count() const;
1.52 +
1.53 + /// Determine whether a certificate exists with the specified label
1.54 + TBool LabelExists(const TDesC& aLabel) const;
1.55 +
1.56 + /// Add a mapping and return its index, takes ownership
1.57 + TInt AppendL(CSWICertStoreEntry* aEntry);
1.58 +
1.59 + /// Removes and an entry from the list
1.60 + void Remove(TInt aIndex);
1.61 +
1.62 + /// Get a mapping given its index.
1.63 + const CSWICertStoreEntry& GetByIndex(TInt aIndex) const;
1.64 +
1.65 + /// Get a mapping given the cert handle.
1.66 + /// @leave KErrNotFound If the specified cert is not present.
1.67 + const CSWICertStoreEntry& GetByHandleL(const TCTTokenObjectHandle& aHandle) const;
1.68 +
1.69 + private:
1.70 + CSWICertStoreEntryList();
1.71 + void InternalizeL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex, TInt aStoreIndex);
1.72 +
1.73 + private:
1.74 + RPointerArray<CSWICertStoreEntry> iEntries;
1.75 + };
1.76 +
1.77 +#endif