1 /* |
|
2 * Copyright (c) 2004 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 PnPMS components |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __HTTP_PROV_CONTENT__H |
|
20 #define __HTTP_PROV_CONTENT__H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // Authentication result: Authenticated |
|
26 const TInt KHttpProvAuthResultAuthenticated = 0; |
|
27 |
|
28 // Authentication result: PIN required, but not supplied |
|
29 const TInt KHttpProvAuthResultPinRequired = 1; |
|
30 |
|
31 // Authentication result: Authentication failed |
|
32 const TInt KHttpProvAuthResultAuthenticationFailed = 2; |
|
33 |
|
34 // Authentication result: No authentication contained in message |
|
35 const TInt KHttpProvAuthResultNoAuthentication = 3; |
|
36 |
|
37 // Authentication result: The token has expired |
|
38 const TInt KHttpProvAuthResultTokenExpired = 4; |
|
39 |
|
40 // FORWARD DECLARATIONS |
|
41 class CHttpProvContentType; |
|
42 class CHttpProvHeaders; |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * CHttpProvContent holds http provisioning content |
|
47 */ |
|
48 class CHttpProvContent : public CBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CHttpProvContent* NewL(const TPtrC8 aContent); |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static CHttpProvContent* NewLC(const TPtrC8 aContent); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CHttpProvContent(); |
|
66 |
|
67 public: |
|
68 |
|
69 /** |
|
70 * Return state of authetication |
|
71 * @returns ETrue if authenticated |
|
72 */ |
|
73 TBool Authenticated(); |
|
74 |
|
75 /** |
|
76 * Authenticates mcontent |
|
77 * @returns error value defined at start of this file |
|
78 */ |
|
79 TInt AuthenticateL( const CHttpProvHeaders& aHeaders, CHttpProvContentType& aContentType ); |
|
80 |
|
81 private: |
|
82 /** |
|
83 * C++ default constructor. |
|
84 */ |
|
85 CHttpProvContent(); |
|
86 |
|
87 /** |
|
88 * By default Symbian 2nd phase constructor is private. |
|
89 */ |
|
90 void ConstructL(const TPtrC8 aContent); |
|
91 |
|
92 void AuthenticateSenderL( const TDesC8& aKey, CHttpProvContentType& aContentType, TInt& aResult ); |
|
93 |
|
94 /** |
|
95 * Converter |
|
96 */ |
|
97 HBufC8* PackLC( const TDesC8& aHex ) const; |
|
98 |
|
99 /** |
|
100 * Converts IMSI code |
|
101 */ |
|
102 void ConvertIMSIL( const TDesC& aIMSI, TPtr8& aKey ) const; |
|
103 |
|
104 private: // Data |
|
105 // Authentication status |
|
106 TBool iAuthenticated; |
|
107 // Content |
|
108 TPtrC8 iContent; |
|
109 }; |
|
110 |
|
111 #endif // __HTTP_PROV_CONTENT__H |
|
112 |
|
113 // End of File |
|