pkiutilities/DeviceToken/Src/Generic/Client/DevTokenInterfaceFactory.cpp
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Implementation of DevTokenInterfaceFactory
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    21 #include <mctkeystoreuids.h>
       
    22 #endif
       
    23 #include <e32debug.h>
       
    24 #include "DevTokenInterfaceFactory.h"
       
    25 #include "DevCertKeyStore.h"
       
    26 #include "DevandTruSrvCertStore.h"
       
    27 #include "DevTokenImplementationUID.hrh"
       
    28 #include "DevtokenLog.h"
       
    29 
       
    30 // ======== MEMBER FUNCTIONS ========
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // DevTokenInterfaceFactory::ClientInterfaceL()
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 MCTTokenInterface* DevTokenInterfaceFactory::ClientInterfaceL(
       
    37                TInt32 aUid, 
       
    38                MCTToken& aToken, 
       
    39                RDevTokenClientSession& aClient)
       
    40     {
       
    41     MCTTokenInterface* tokenInterface = NULL; 
       
    42     TRACE_PRINT("ClientInterfaceL --> 1");
       
    43     switch ( aUid )
       
    44          {
       
    45          case KInterfaceKeyStore:
       
    46              TRACE_PRINT("ClientInterfaceL --> 4");
       
    47              tokenInterface = CDevCertKeyStore::NewKeyStoreUserInterfaceL(aToken, aClient);
       
    48              TRACE_PRINT("ClientInterfaceL --> 5");
       
    49              break;
       
    50 
       
    51          case KInterfaceKeyStoreManager:
       
    52              TRACE_PRINT("ClientInterfaceL --> 2");
       
    53              tokenInterface = CDevCertKeyStore::NewKeyStoreManagerInterfaceL(aToken, aClient);
       
    54              TRACE_PRINT("ClientInterfaceL --> 3");
       
    55              break;
       
    56 
       
    57          case KInterfaceCertStore:
       
    58              tokenInterface  = CDevandTruSrvCertStore::NewReadableInterfaceL( aToken, aClient );
       
    59              break;
       
    60 
       
    61          case KInterfaceWritableCertStore: 
       
    62              tokenInterface = CDevandTruSrvCertStore::NewWritableInterfaceL( aToken, aClient );
       
    63              break;
       
    64 
       
    65          default:
       
    66              User::Leave(KErrArgument);
       
    67              break;
       
    68          }
       
    69 
       
    70     return (tokenInterface);
       
    71     }
       
    72 //EOF
       
    73