vpnengine/ikecert/src/ikecalist.cpp
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2007 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:   Class containing list of CAs
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "ikecalist.h"
       
    21 #include "ikecaelem.h"
       
    22 
       
    23 
       
    24 EXPORT_C CIkeCaList::CIkeCaList(TInt aGranularity)
       
    25 :CArrayPtrFlat<CIkeCaElem>(aGranularity) 
       
    26     {
       
    27     }
       
    28 
       
    29 
       
    30 CIkeCaList::~CIkeCaList() 
       
    31     { 
       
    32     ResetAndDestroy(); 
       
    33     }
       
    34 
       
    35 CIkeCaElem* CIkeCaList::FindCaElem(const TDesC8& aKeyIdentifier) const
       
    36     {
       
    37 	//
       
    38 	// Find a CIkeCaElem element using aKeyIdentifier as search argument
       
    39 	//
       
    40 	CIkeCaElem* result = NULL;
       
    41 	TInt i = 0;
       
    42 	TInt count = Count();
       
    43 	while ( i < count )
       
    44 	    {
       
    45 		CIkeCaElem* caElem = At(i);
       
    46 		if ( caElem->KeyHash().Compare(aKeyIdentifier) == 0 )
       
    47     		{
       
    48     		result = caElem;
       
    49     		break;	
       
    50     		}	
       
    51 		i ++;
       
    52 	    }
       
    53 	return result;
       
    54     }