realtimenetprots/sipfw/SIP/SIPSec/TlsPlugin/inc/csipsectlsplugin.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2008-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 "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 * Name        : csipsectlsplugin.h
       
    16 * Part of     : SIPSec TLS Plugin
       
    17 * Interface   : 
       
    18 * Version     : %version: 2.1.1 %
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 /**
       
    26  @internalComponent
       
    27 */
       
    28 
       
    29 #ifndef C_SIPSECTLSPLUGIN_H
       
    30 #define C_SIPSECTLSPLUGIN_H
       
    31 
       
    32 // INCLUDES
       
    33 #include "sipsecsecuritymechanism.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class MSIPTransportMgr;
       
    37 class CTLSCache;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42  * @brief This class implements TLS mechanism, and is an ECOM plugin
       
    43  */
       
    44 class CSIPSecTlsPlugin : public CSIPSecSecurityMechanism 
       
    45     {
       
    46 public: // Constructors and destructor
       
    47 
       
    48     /**
       
    49     * Constructs the object.
       
    50 	* @param aInitParams Initialization parameters
       
    51     * @return Return New object, ownership is transferred.    
       
    52     */
       
    53     static CSIPSecTlsPlugin* NewL( TAny* aInitParams );
       
    54     
       
    55     /**
       
    56     * Destructor
       
    57     */
       
    58     ~CSIPSecTlsPlugin();
       
    59 
       
    60 public: // From MSIPSecSecurityMechanism
       
    61 
       
    62 	const TDesC8& Name() const;
       
    63 
       
    64   	void InitializeSecurityClientL( CSIPSecurityClientHeader& aSecurityClient );
       
    65   
       
    66   	void ProcessSecurityVerifyL( TSIPTransportParams& aTransportParams,
       
    67   				CSIPRequest& aRequest,
       
    68                 TInetAddr& aNextHop,
       
    69                 const CUri8& aRemoteTarget,
       
    70                 const TDesC8& aOutboundProxy,
       
    71                 MSIPSecUser* aUser,
       
    72                 TRegistrationId aRegistrationId,
       
    73                 RPointerArray<CSIPSecurityServerHeader>& aSecurityServer,
       
    74   				RPointerArray<CSIPSecurityVerifyHeader>& aSecurityVerify );
       
    75 
       
    76 	void AddSecurityParamsL( TSIPTransportParams& aTransportParams,
       
    77 							 CSIPRequest& aRequest,
       
    78 							 TRegistrationId aRegistrationId,
       
    79 							 TTransactionId aTransactionId,
       
    80 		                     TInetAddr& aNextHop,
       
    81 		                     const CUri8& aRemoteTarget,
       
    82 		                     const TDesC8& aOutboundProxy,
       
    83 						     MSIPSecUser* aUser );
       
    84 
       
    85 	TBool ResponseReceivedL( TSIPTransportParams& aTransportParams,
       
    86 							 CSIPResponse& aResponse,
       
    87 							 CSIPRequest& aRequest,
       
    88 							 TRegistrationId aRegistrationId,
       
    89 							 TTransactionId aTransactionId,
       
    90 		                     TInetAddr& aNextHop,
       
    91 		                     const CUri8& aRemoteTarget,
       
    92 		                     const TDesC8& aOutboundProxy,
       
    93 						     MSIPSecUser* aUser,
       
    94 						     MSIPSecSecurityMechanismObserver& aObserver );
       
    95 
       
    96 	TBool IsServerInitiatedSecAgreeAllowed() const;
       
    97 
       
    98 	TBool ParametersUpdatedL(MSIPSecUser* aUser);
       
    99 
       
   100 	void CancelPendingOperations( MSIPSecSecurityMechanismObserver* aObserver );
       
   101 
       
   102 	void ClearCache(MSIPSecUser* aUser);
       
   103 
       
   104 	void SetCredentialsL( TTransactionId aTransactionId,
       
   105 	                      const TDesC8& aRealm,
       
   106 			              const TDesC8& aOutboundProxy, 
       
   107 						  const TDesC8& aUserName,
       
   108 						  const TDesC8& aPassword);
       
   109 
       
   110 	void SetCredentialsL( const MSIPSecUser& aUser,
       
   111 	                      const TDesC8& aRealm,
       
   112 			              const TDesC8& aOutboundProxy, 
       
   113 						  const TDesC8& aUserName,
       
   114 						  const TDesC8& aPassword );
       
   115 
       
   116 	TInt IgnoreChallenge( TTransactionId aTransactionId,
       
   117 	                      const TDesC8& aRealm,
       
   118 	                      const MSIPSecUser* aTrustedUser );
       
   119 	
       
   120 	TInt RemoveCredentials( const TDesC8& aRealm );
       
   121 
       
   122 private: // Constructors, for internal use
       
   123 
       
   124 	/*
       
   125      * Constructor
       
   126      * @param aTransportMgr Transport manager
       
   127      */
       
   128     CSIPSecTlsPlugin( MSIPTransportMgr& aTransportMgr );
       
   129 
       
   130     /*
       
   131      * Second phase constructor	 
       
   132      */
       
   133     void ConstructL();    
       
   134 
       
   135 private: // New functions, for internal use
       
   136 
       
   137 	void ProcessRequestL( TSIPTransportParams& aTransportParams,
       
   138 						  const TInetAddr& aNextHop,	
       
   139 						  const MSIPSecUser& aUser );
       
   140 
       
   141 private: // Data
       
   142 
       
   143 	//For handling TLS transports
       
   144     MSIPTransportMgr& iTransportMgr;
       
   145 
       
   146     //Owned
       
   147     CTLSCache* iCache;
       
   148 
       
   149 #ifdef CPPUNIT_TEST
       
   150 	friend class CSIPSecTlsPluginTest;
       
   151 #endif
       
   152     };
       
   153 
       
   154 #endif //end of C_SIPSECTLSPLUGIN_H
       
   155 
       
   156 // End of File