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