gba/uicc/inc/GBAAkaIsa.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     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 CAkaIsaInterface definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _AKAISAINTERFACE_H_
       
    20 #define _AKAISAINTERFACE_H_
       
    21 
       
    22 #include "gbauicc.h"
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <rmmcustomapi.h>
       
    27 
       
    28 //Constants
       
    29 const TUint8 KAKA_RES_LENGTH =  16;
       
    30 const TUint8 KAKA_IK_LENGTH  = 16;
       
    31 const TUint8 KAKA_CK_LENGTH  = 16;
       
    32 const TUint8 KAKA_KEY_LENGTH = 16;
       
    33 const TUint8 KAKA_RAND_LENGTH = 16;
       
    34 const TUint8 KRESPONSE_2G_LENGTH = 16;
       
    35 
       
    36 #define GBA_UICC_INTERFACE_IMPLE 0x20029F0F
       
    37 const TUid KGBAUICCImpleUID = { GBA_UICC_INTERFACE_IMPLE };
       
    38 
       
    39 // CLASS DECLARATION
       
    40 class CAkaIsaInterface : public CBase, public MUICCInterface 
       
    41     {
       
    42     public:
       
    43         static MUICCInterface* NewL(); 
       
    44         virtual ~CAkaIsaInterface();
       
    45         // Inherited from CUICCInterface  
       
    46         void QueryIdentityL(TDes8& aIdentity);
       
    47         void QueryHomeNetworkDnL(TDes8& aHNDN);
       
    48         TBool QueryAuthenticationL(const TDesC8& aNonce, TDes8& aResponse, TDes8& aResync );
       
    49         void QueryKeyMaterialL(const TDesC8& aKeyMaterial, const TDesC8& aRand, const TDesC8& aIMPI, const TDesC8& aUTF8_NAF_ID, TDes8& aDerivedKey ); 
       
    50         TBool QueryKs(TDes8& aKS);
       
    51         // Check the GBA_U availability from smart card apps
       
    52         void QueryGBAUAvailabilityL( TBool& aGBAAvail );
       
    53         // Save B-TID and key lifttime from BSF to smart card 
       
    54         TInt UpdateGBADataL( const TDesC8& aBTID, const TDesC8& aLifetime );  
       
    55         TBool InterfaceIs2G(); 
       
    56         void Release(); 
       
    57         void NotifyCardChangeL();
       
    58         void QueryCardInterfaceL();
       
    59     
       
    60     private:
       
    61     
       
    62         CAkaIsaInterface();
       
    63         void ConstructL();
       
    64 		//run aka
       
    65         TBool QueryAuthenticationGBAUL(const TDesC8& aNonce, TDes8& aResponse, TDes8& aResync );
       
    66         //run aka
       
    67         TBool QueryAuthentication3GL(const TDesC8& aNonce, TDes8& aResponse, TDes8& aResync );
       
    68         //run simulated aka for 2G
       
    69         void QueryAuthentication2GL( const TDesC8& aNonce, TDes8& aResponse ); 
       
    70     
       
    71     private:
       
    72         enum TCardInterface
       
    73            {
       
    74            ENoInterface = 0,
       
    75            E2GInterface,	
       
    76            E3GInterface,	// UICC with USIM not supporting Ks_NAF derivation
       
    77            EGBAUInterface	// UICC with USIM application supporting Ks_NAF derivation.
       
    78            };
       
    79         
       
    80     private:
       
    81         TBuf8<KAKA_RES_LENGTH>  iResBuf;
       
    82         TBuf8<KAKA_IK_LENGTH>   iIKBuf;
       
    83         TBuf8<KAKA_CK_LENGTH>   iCKBuf;
       
    84         TCardInterface          iCardInterface;
       
    85         RTelServer              iEtelServer;
       
    86         RMobilePhone            iPhone;
       
    87         RMmCustomAPI            iCustomAPI;
       
    88         
       
    89         }; 
       
    90 
       
    91 #endif // _AKAISAINTERFACE_H_
       
    92 
       
    93 //EOF