os/security/cryptoservices/certificateandkeymgmt/swicertstore/CSWICertStoreEntry.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 1998-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 * CSWICertStoreEntry class implementation
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file 
    22  @internalTechnology
    23 */
    24  
    25 #ifndef __CSWICERTSTOREENTRY_H__
    26 #define __CSWICERTSTOREENTRY_H__
    27 
    28 #include <e32base.h>
    29 #include <s32std.h>
    30 #include <swicertstore.h>
    31 
    32 class MCTToken;
    33 class CCTCertInfo;
    34 
    35 /**
    36  * This class is used to associate an entry with the TStreamId of the stream
    37  * where the data of the certificate is stored.
    38  */
    39 NONSHARABLE_CLASS(CSWICertStoreEntry) : public CBase
    40 	{
    41 public:
    42 	static CSWICertStoreEntry* NewL(const CCTCertInfo& aCertInfo,const RArray<TUid>& aCertificateApps,TBool aTrusted,TStreamId aDataStreamId,const TCertMetaInfo& aCertMetaInfo,TInt aStoreIndex);
    43 
    44 	/// Read a CSWICertStoreEntry from a stream.
    45 	static CSWICertStoreEntry* NewLC(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex, TInt aStoreIndex = 0);
    46 
    47 	virtual ~CSWICertStoreEntry();
    48 
    49 	// Accessors
    50 	const CCTCertInfo& CertInfo() const;
    51 	TStreamId DataStreamId() const;
    52 	const RArray<TUid>& CertificateApps() const;
    53 	TBool IsApplicable(const TUid& aApplication) const;
    54 	TBool Trusted() const;
    55 	const TCertMetaInfo& CertMetaInfo() const;
    56 	//returns the store index to which the entry belongs
    57 	TInt StoreIndex() const;
    58 	
    59 private:
    60 	CSWICertStoreEntry(TInt aStoreIndex = 0);
    61 	void ConstructL(const CCTCertInfo& aCertInfo,const RArray<TUid>& aCertificateApps,TBool aTrusted,TStreamId aDataStreamId,const TCertMetaInfo& aCertMetaInfo);
    62 	void InternalizeL(RReadStream& aStream, MCTToken& aToken, TInt aCertIndex);
    63 
    64 private:
    65 	CCTCertInfo* iCertInfo;
    66 	RArray<TUid> iCertificateApps;
    67 	TBool iTrusted;
    68 	TStreamId iDataStreamId;
    69 	TCertMetaInfo iCertMetaInfo;
    70 	//represents the store in which the certificate entry resides
    71 	TInt iStoreIndex;
    72 	};
    73 
    74 #endif