|
1 /* |
|
2 * Copyright (c) 2006-2006 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef WSSTAR_RST_RESPONSE_MESSAGE_H |
|
26 #define WSSTAR_RST_RESPONSE_MESSAGE_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "SenBaseFragment.h" |
|
30 #include "wsstarplugin.h" |
|
31 #include "wsstarvalidatehandler.h" |
|
32 #include "SenCredential.h" |
|
33 #include "senwsdescription.h" //credential const |
|
34 |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 |
|
38 |
|
39 // CLASS DECLARATION |
|
40 /** |
|
41 * Class: CWSStarRSTResponse |
|
42 * |
|
43 * Description: Structure which is self parsing. Holds information about |
|
44 * RST response. See WS-Trust specification |
|
45 */ |
|
46 class CWSStarRSTResponse : public CSenBaseFragment |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Standard 2 phase constructor |
|
52 * @since Series60 4.0 |
|
53 * @param aParseIssuedTokens determine if token will searched only in header under issuedToken tag |
|
54 * @param aAppliedTo precise which token in response collection is used after sts negotation. |
|
55 * If null passed 1st token from collection is taken |
|
56 * @return new instance of rst response |
|
57 */ |
|
58 static CWSStarRSTResponse* NewL(TBool aParseIssuedTokens, const TDesC8& aAppliedTo, const TDesC8* aVersion); |
|
59 |
|
60 /** |
|
61 * Standard 2 phase constructor |
|
62 * @since Series60 4.0 |
|
63 * @param aParseIssuedTokens determine if token will searched only in header under issuedToken tag |
|
64 * @param aAppliedTo precise which token in response collection is used after sts negotation |
|
65 * If null passed 1st token from collection is taken |
|
66 * @return new instance of rst response (also pushed on cleanupStack) |
|
67 */ |
|
68 static CWSStarRSTResponse* NewLC(TBool aParseIssuedTokens, const TDesC8& aAppliedTo, const TDesC8* aVersion); |
|
69 |
|
70 /** |
|
71 * Normal destructor |
|
72 */ |
|
73 virtual ~CWSStarRSTResponse(); |
|
74 |
|
75 // New functions |
|
76 |
|
77 /** |
|
78 * Getter for credential |
|
79 * @return credential |
|
80 */ |
|
81 CSenCredential* Credential(); |
|
82 |
|
83 /** |
|
84 * Getter for POP encoded as Base64 |
|
85 * @return credential |
|
86 */ |
|
87 TPtrC8 POPBase64(); |
|
88 |
|
89 /** |
|
90 * Getter for TokenType |
|
91 * @return credential |
|
92 */ |
|
93 TPtrC8 TokenType(); |
|
94 |
|
95 /** |
|
96 * Getter for type of binary |
|
97 * @return type of binary |
|
98 */ |
|
99 TPtrC8 BinaryType(); |
|
100 |
|
101 /** |
|
102 * Getter for entropy of STS |
|
103 * @return entropy of STS |
|
104 */ |
|
105 TPtrC8 EntropySTS(); |
|
106 |
|
107 /** |
|
108 * Getter for computed key |
|
109 * @return computed key |
|
110 */ |
|
111 TPtrC8 ComputedKey(); |
|
112 |
|
113 /** |
|
114 * Getter for time of credential expired time |
|
115 * @return expired time in XSD time-date format |
|
116 */ |
|
117 TPtrC8 CredentialExpires(); |
|
118 |
|
119 /** |
|
120 * Getter for time of credential creation time |
|
121 * @return creation time in XSD time-date format |
|
122 */ |
|
123 TPtrC8 CredentialCreated(); |
|
124 |
|
125 /** |
|
126 * Getter for security token referenve |
|
127 * @return security token reference |
|
128 */ |
|
129 TPtrC8 STR(); |
|
130 |
|
131 /** |
|
132 * Determine type of token (binary token or SCT) |
|
133 * @return Etrue if token is SCT (security Context Token). |
|
134 * See WS-SecureConversation specification. |
|
135 */ |
|
136 TBool IsContextToken(); |
|
137 |
|
138 /** |
|
139 * Deteremine if this really is a response (RST) |
|
140 * @return ETrue if reponse is RST |
|
141 */ |
|
142 TBool IsResponse(); |
|
143 |
|
144 /** |
|
145 * Getter for KeySize (used during calculating computed Key in PSHA1 algorithm). |
|
146 * @return Size in bites. |
|
147 */ |
|
148 TInt KeySize(); |
|
149 |
|
150 /** |
|
151 * Set addressing holders for endpoint.In message phase |
|
152 * addressing handler shuld set values for addressing holders. |
|
153 */ |
|
154 void UpdateAddressingHoldersL(MSenSessionContext& aCtx); |
|
155 void SetPolicyVersion(const TDesC8* aVersion); |
|
156 |
|
157 |
|
158 private: |
|
159 |
|
160 /** |
|
161 * C++ default constructor. |
|
162 */ |
|
163 CWSStarRSTResponse(TBool aParseIssuedTokens, const TDesC8& aAppliedTo); |
|
164 |
|
165 /** |
|
166 * By default Symbian 2nd phase constructors is private. |
|
167 */ |
|
168 void ConstructL(const TDesC8* aVersion); |
|
169 |
|
170 // From CBaseFragment |
|
171 virtual void StartElementL(const TDesC8& aNsUri, |
|
172 const TDesC8& aLocalName, |
|
173 const TDesC8& aQName, |
|
174 const RAttributeArray& aAttributes); |
|
175 |
|
176 virtual void EndElementL(const TDesC8& aNsUri, |
|
177 const TDesC8& aLocalName, |
|
178 const TDesC8& aQName); |
|
179 |
|
180 //reset state machine |
|
181 void Reset(); |
|
182 |
|
183 |
|
184 private: // Data |
|
185 |
|
186 TBool iIsResponse; |
|
187 /** |
|
188 * Should be set to ETrue when parsing header for issued tokens |
|
189 */ |
|
190 TBool iParseIssuedTokens; |
|
191 |
|
192 //now this flag is not used anywhere. How to use it, any idea? |
|
193 TBool iCollection; |
|
194 TBool iContextToken; |
|
195 |
|
196 //This bool determine if token appliedTo has been found. |
|
197 //Next RSTRs are not processing if iTokenEstablished == TRUE |
|
198 //Set to true only in positive case (when NO reset of machine state) |
|
199 TBool iTokenEstablished; |
|
200 TBool iParsingApliedTo; |
|
201 TBool iDefTokenEstablished; |
|
202 |
|
203 CSenCredential* iCredential; |
|
204 CSenCredential* iCredentialDef; |
|
205 CSenBaseFragment* iSTRFr; |
|
206 HBufC8* iSTR; |
|
207 HBufC8* iSTRDef; |
|
208 HBufC8* iPOPencodedAsBase64; |
|
209 HBufC8* iPOPencodedAsBase64Def; |
|
210 HBufC8* iTokenType; |
|
211 HBufC8* iTokenTypeDef; |
|
212 HBufC8* iTypeOfBinary; |
|
213 HBufC8* iTypeOfBinaryDef; |
|
214 HBufC8* iEntropySTS; |
|
215 HBufC8* iEntropySTSDef; |
|
216 const TDesC8* iActiveXmlns; |
|
217 TTime iNotOnOrAfter; |
|
218 HBufC8* iComputedKey; |
|
219 TInt* iKeySize; |
|
220 TInt* iKeySizeDef; |
|
221 HBufC8* iComputedKeyDef; |
|
222 HBufC8* iCredentialExpires; |
|
223 HBufC8* iCredentialExpiresDef; |
|
224 HBufC8* iCredentialCreated; |
|
225 HBufC8* iCredentialCreatedDef; |
|
226 TPtrC8 iAppliedTo; |
|
227 const TDesC8* iAddressingNs; //not owned |
|
228 const TDesC8* iAddressingEndpointTag; //not owned |
|
229 const TDesC8* iPolicyVersion;//not owned |
|
230 }; |
|
231 |
|
232 #endif // WSSTAR_RST_RESPONSE_MESSAGE_H |
|
233 |
|
234 // End of File |
|
235 |