|
1 /* |
|
2 * Copyright (c) 2006-2007 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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CNATFWUNSAFNONCEATTRIBUTE_H |
|
22 #define CNATFWUNSAFNONCEATTRIBUTE_H |
|
23 |
|
24 #include "natfwunsafattribute.h" |
|
25 |
|
26 /** |
|
27 * Class for NONCE attribute. |
|
28 * |
|
29 * @lib natfwunsafprotocols.lib |
|
30 * @since S60 3.2 |
|
31 */ |
|
32 class CNATFWUNSAFNonceAttribute : public CNATFWUNSAFAttribute |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * Decodes a UNSAF attribute from a byte stream. |
|
38 * This version is for lookup table. |
|
39 * @param aByteStream Byte stream, containing attribute type, length and |
|
40 * value. |
|
41 * @return Decoded UNSAF attribute, ownership is transferred. |
|
42 */ |
|
43 static CNATFWUNSAFAttribute* DecodeAttributeL( |
|
44 const TDesC8& aByteStream); |
|
45 |
|
46 /** |
|
47 * Creates a new instance of CNATFWUNSAFNonceAttribute |
|
48 * @pre Nonce's length has to be a multiple of 4 |
|
49 * @param aNonce Nonce |
|
50 * @return A new instance of CNATFWUNSAFNonceAttribute |
|
51 * ownership is transferred. |
|
52 */ |
|
53 IMPORT_C static CNATFWUNSAFNonceAttribute* NewL( |
|
54 const TDesC8& aNonce); |
|
55 |
|
56 /** |
|
57 * Creates a new instance of CNATFWUNSAFNonceAttribute and |
|
58 * pushes it to the CleanupStack. |
|
59 * @pre Nonce's length has to be a multiple of 4 |
|
60 * @param aNonce Nonce |
|
61 * @return A new instance of CNATFWUNSAFNonceAttribute, |
|
62 * ownership is transferred. |
|
63 */ |
|
64 IMPORT_C static CNATFWUNSAFNonceAttribute* NewLC( |
|
65 const TDesC8& aNonce); |
|
66 |
|
67 /** |
|
68 * Destructor, deletes the resources of CNATFWUNSAFNonceAttribute. |
|
69 */ |
|
70 ~CNATFWUNSAFNonceAttribute(); |
|
71 |
|
72 public: // From CNATFWUNSAFAttribute |
|
73 |
|
74 CNATFWUNSAFAttribute::TType Type() const; |
|
75 |
|
76 HBufC8* EncodeValueL() const; |
|
77 |
|
78 public: // New function |
|
79 |
|
80 /** |
|
81 * Returns the attribute value |
|
82 * @return Attribute value |
|
83 */ |
|
84 IMPORT_C const TDesC8& Value() const; |
|
85 |
|
86 private: // Constructors |
|
87 |
|
88 CNATFWUNSAFNonceAttribute(); |
|
89 |
|
90 void ConstructL(const TDesC8& aNonce); |
|
91 |
|
92 private: // Data |
|
93 |
|
94 HBufC8* iNonce; |
|
95 }; |
|
96 |
|
97 #endif // CNATFWUNSAFNONCEATTRIBUTE_H |
|
98 |
|
99 |