|
1 /* |
|
2 * Copyright (c) 2008 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 the License "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: WAPI authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _WAPICERTIFICATES_H_ |
|
20 #define _WAPICERTIFICATES_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <e32std.h> |
|
24 |
|
25 |
|
26 const TInt KMaxLabelLength = 255; |
|
27 const TInt KMaxIdentityLength = 310; |
|
28 class CCertificateStoreDatabase; |
|
29 class abs_eap_am_tools_c; |
|
30 class dummy_wapi_core_c; |
|
31 class wapi_am_core_symbian_c; |
|
32 class ec_certificate_store_c; |
|
33 |
|
34 /** |
|
35 * This is a wrapper class which can be used to handle WAPI related certificates |
|
36 */ |
|
37 class CWapiCertificates : /*public CBase,*/ public CActive |
|
38 { |
|
39 |
|
40 public: |
|
41 |
|
42 IMPORT_C CWapiCertificates(); |
|
43 IMPORT_C ~CWapiCertificates(); |
|
44 |
|
45 /** |
|
46 * Function for creating the CWapiCertificates object |
|
47 * |
|
48 */ |
|
49 IMPORT_C static CWapiCertificates* NewL(); |
|
50 |
|
51 /** |
|
52 * Function for reserving memory for the internal data types |
|
53 * |
|
54 */ |
|
55 void ConstructL(); |
|
56 |
|
57 /** |
|
58 * Gets a list of the available WAPI user and CA certificates |
|
59 * |
|
60 * NOTE that the caller is responsible for freeing the memory of the arrays |
|
61 * |
|
62 * @param aUserCerts Array of available WAPI User certificate labels |
|
63 * @param aUserCertData Array of available WAPI User certificate identities |
|
64 * @param aCACerts Array of available WAPI CA certificate labels |
|
65 * @param aCACertData Array of available WAPI CA certificate identities |
|
66 */ |
|
67 IMPORT_C void GetAllCertificateLabelsL( RArray<TBuf<KMaxLabelLength> > **aUserCerts, RArray<TBuf8<KMaxIdentityLength> > **aUserCertData, |
|
68 RArray<TBuf<KMaxLabelLength> > **aCACerts, RArray<TBuf8<KMaxIdentityLength> >**aCACertData ); |
|
69 |
|
70 /** |
|
71 * Resets the WAPI Certificate store |
|
72 * |
|
73 */ |
|
74 IMPORT_C void ResetCertificateStoreL( ); |
|
75 |
|
76 /** |
|
77 * Gets the WAPI certificate configuration of a specific AP |
|
78 * |
|
79 * @param aId Service table id |
|
80 * @param aUserCert Id matching the selected WAPI User certificate |
|
81 * @param aCACert Id matching the selected WAPI CA certificate |
|
82 */ |
|
83 IMPORT_C void GetConfigurationL( const TInt aId, TDes& aCACert, TDes& aUserCert ); |
|
84 |
|
85 /** |
|
86 * Sets the WAPI certificate configuration of a specific AP |
|
87 * |
|
88 * @param aId Service table id |
|
89 * @param aCACertData Selected WAPI CA certificate identity |
|
90 */ |
|
91 IMPORT_C void SetCACertL( const TInt aId, const TBuf8<KMaxIdentityLength> aCACertData ); |
|
92 |
|
93 /** |
|
94 * Sets the WAPI certificate configuration of a specific AP |
|
95 * |
|
96 * @param aId Service table id |
|
97 * @param aUserCertData Selected WAPI User certificate identity |
|
98 */ |
|
99 IMPORT_C void SetUserCertL( const TInt aId, const TBuf8<KMaxIdentityLength> aUserCertData ); |
|
100 |
|
101 /** |
|
102 * Delete AP related data from certificate database tables |
|
103 * |
|
104 * @param aId Service table id |
|
105 */ |
|
106 IMPORT_C void DeleteAPSpecificDataL( const TInt aId ); |
|
107 |
|
108 protected: // from CActive |
|
109 |
|
110 /** |
|
111 * RunL from CActive |
|
112 */ |
|
113 void RunL(); |
|
114 |
|
115 /** |
|
116 * DoCancel from CActive |
|
117 */ |
|
118 void DoCancel(); |
|
119 private: |
|
120 // Pointer to the used certificate store object |
|
121 CCertificateStoreDatabase* iCertDB; |
|
122 // amTools is needed for the certificate store object creation |
|
123 abs_eap_am_tools_c* iAmTools; |
|
124 dummy_wapi_core_c* iDummyCore; |
|
125 // The pointer to the ec_certificate_store_c needed to create the wapi_am_core_symbian |
|
126 ec_certificate_store_c* iEcCertStore; |
|
127 // The pointer to the object needed to start the certificate import and reading of labels |
|
128 wapi_am_core_symbian_c* iWapiCore; |
|
129 |
|
130 // For wrapping asynchronous calls. |
|
131 CActiveSchedulerWait iWait; |
|
132 }; |
|
133 |
|
134 #endif // _WAPICERTIFICATES_H_ |
|
135 |
|
136 // End of file |