|
1 /* |
|
2 * Copyright (c) 2010 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: VPN Agile provision Web Service Client |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AGILEPROVISIONWS_H |
|
20 #define C_AGILEPROVISIONWS_H |
|
21 |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <MSenServiceConsumer.h> |
|
25 #include "agileprovisionservice.h" |
|
26 #include "agilecrypto.h" |
|
27 #include "base64.h" |
|
28 |
|
29 const TInt KPublicKeyLen = 1024; |
|
30 |
|
31 NONSHARABLE_CLASS(CAgileProvisionWs) : public CBase, public MAgileProvisionServiceConsumer |
|
32 { |
|
33 public: |
|
34 IMPORT_C static CAgileProvisionWs* NewL(); |
|
35 IMPORT_C static CAgileProvisionWs* NewLC(); |
|
36 ~CAgileProvisionWs(); |
|
37 |
|
38 public: |
|
39 /** |
|
40 * Gets policy. |
|
41 * @param aEndpointUri Service endpoint |
|
42 * @param aStatus Completion status (returned) |
|
43 */ |
|
44 IMPORT_C void GetPolicy( const TDesC8& aEndPointUri, TUint aIapId, |
|
45 TRequestStatus& aStatus ); |
|
46 |
|
47 /** |
|
48 * Cancels Get policy request. |
|
49 */ |
|
50 IMPORT_C void CancelGetPolicy(); |
|
51 |
|
52 |
|
53 //gets ownership of aServiceAddr |
|
54 IMPORT_C void SetServiceAddr(const HBufC8* aServiceAddr); |
|
55 |
|
56 // from base class MAgileProvisionServiceConsumer |
|
57 public: |
|
58 void HandleMessageL(const TDesC8& aMessage); |
|
59 void HandleErrorL(const TInt aErrorCode, const TDesC8& aError); |
|
60 void SetStatus(const TInt aStatus); |
|
61 |
|
62 |
|
63 /* |
|
64 * Callback methods, for each asynchronous remote operation |
|
65 */ |
|
66 |
|
67 IMPORT_C void HandleGetConfSoapInL(const TDesC8& aMessage); |
|
68 |
|
69 IMPORT_C void HandleGetCertificateSoapInL(const TDesC8& aMessage); |
|
70 |
|
71 IMPORT_C void GenerateCertReqL( ); |
|
72 |
|
73 |
|
74 private: |
|
75 enum |
|
76 { |
|
77 KStateInitial, |
|
78 KStateGettingConf, |
|
79 KStateGettingCertificate |
|
80 }; |
|
81 |
|
82 CAgileProvisionWs(); |
|
83 |
|
84 void ConstructL(); |
|
85 |
|
86 void DoGetPolicyL( const TDesC8& aEndPointUri, const TUint aIapId ); |
|
87 void ParseFileFromSoapEnvelopeL( RPointerArray<CSenElement>& aArray, |
|
88 TInt aContentType, TInt aLevel, |
|
89 TDesC& aFileName ); |
|
90 |
|
91 |
|
92 void DoComplete( const TInt aStatus ); |
|
93 |
|
94 private: // data |
|
95 |
|
96 /** |
|
97 * State. |
|
98 * Own. |
|
99 */ |
|
100 TInt iState; |
|
101 |
|
102 |
|
103 CAgileProvisionServiceService* iPService; |
|
104 |
|
105 /** |
|
106 * Client's request's status. |
|
107 * Not own. |
|
108 */ |
|
109 TRequestStatus* iClientStatus; |
|
110 |
|
111 TPrivKeyRef iKeyRef; |
|
112 |
|
113 const HBufC8* iServiceAddr; |
|
114 |
|
115 const TDesC8* iEndPointUri; |
|
116 |
|
117 }; |
|
118 |
|
119 #endif // C_AGILEPROVISIONWS_H |