terminalsecurity/server/inc/TcTrustedSession.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2000 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 terminalsecurity components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _TRUSTED_SESSION_HEADER_
       
    20 #define _TRUSTED_SESSION_HEADER_
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <ssl.h>
       
    26 #include <PolicyEngineClient.h>
       
    27 
       
    28 // CONSTANTS
       
    29 // MACROS
       
    30 // DATA TYPES
       
    31 // FUNCTION PROTOTYPES
       
    32 // FORWARD DECLARATIONS
       
    33 class CTcFileScan;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 class CTcTrustedSession : public CObject
       
    38 {
       
    39 public:
       
    40     virtual ~CTcTrustedSession();
       
    41 
       
    42     enum TTcAccessLevel
       
    43         {
       
    44         EAccessLevelNone        = 0,
       
    45         EAccessLevelApplication = 1,
       
    46         EAccessLevelDMAdapter   = 2
       
    47         };
       
    48 
       
    49 public:
       
    50 	static CTcTrustedSession*   NewL            ( TSecureId &aSID, TCertInfo &aCert );
       
    51 	static CTcTrustedSession*   NewL            ( TSecureId &aSID );
       
    52 	void                        SetAccessLevel  ( TInt aAccessLevel );
       
    53 
       
    54     TInt                        Certificate     ( TCertInfo& aCertInfo );
       
    55     TSecureId                   SecureId        ( );
       
    56 	TInt                        AccessLevel     ( );
       
    57 
       
    58 	TInt                        FileScanL           ( const TDesC8 &aFileName,
       
    59 	                                                  TBool aRecursive );
       
    60 	HBufC8*                     FileScanResultsL    ( );
       
    61 
       
    62 private:
       
    63     void                        SetCertificate      ( TCertInfo& aCertInfo );
       
    64     void                        ConstructL          ( TSecureId &aSID, TCertInfo &aCert );
       
    65     void                        ConstructL          ( TSecureId &aSID );
       
    66     void                        DoConstructL        ( );
       
    67     void                        UpdateAccessLevelL  ( );
       
    68     TInt                        CheckTerminalControlPolicyL ( );
       
    69     TInt                        CheckTerminalControl3rdPartySecureIDL ( );
       
    70     TBool                       CertificatesAreEqual( const TCertInfo &aCert1, const TCertInfo &aCert2 );
       
    71     
       
    72 private:
       
    73     RPolicyEngine   iPE;
       
    74     RPolicyRequest  iPR;
       
    75 
       
    76     TBool           iHasCertificate;
       
    77 	TCertInfo       iCertificate;
       
    78 	TSecureId       iSecureId;
       
    79 	TInt            iAccessLevel;
       
    80     CTcFileScan     *iFileScan;
       
    81 
       
    82 public:
       
    83 	CBufBase        *iProcessList;
       
    84 	CBufBase        *iProcessData;	
       
    85     TBool           iRebootRequested;
       
    86     TBool           iWipeRequested;
       
    87 };
       
    88 
       
    89 #endif //_TRUSTED_SESSION_HEADER_