|
1 /* |
|
2 * Copyright (c) 1997-2009 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: |
|
15 * CPKIXChainBuilder class implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 /** |
|
23 @file |
|
24 @internalTechnology |
|
25 */ |
|
26 |
|
27 #ifndef __PKIXCHAINBUILDER_H__ |
|
28 #define __PKIXCHAINBUILDER_H__ |
|
29 |
|
30 #include <e32base.h> |
|
31 #include "pkixcerts.h" |
|
32 |
|
33 class CPKIXCertChainAO; |
|
34 |
|
35 class CPKIXChainBuilder : public CActive |
|
36 { |
|
37 friend class CPKIXCertChainAO; |
|
38 |
|
39 public: |
|
40 static CPKIXChainBuilder* NewL(); |
|
41 static CPKIXChainBuilder* NewLC(); |
|
42 ~CPKIXChainBuilder(); |
|
43 |
|
44 public: |
|
45 void AddSourceL(MPKIXCertSource* aSource);//takes ownership of aSource... |
|
46 void AddIssuer(TInt& aNumberOfCertsAdded, TBool& aResult, CArrayPtrFlat<CX509Certificate>& aChain, |
|
47 TRequestStatus& aStatus); |
|
48 |
|
49 private: |
|
50 CPKIXChainBuilder(); |
|
51 void ConstructL(); |
|
52 TBool ResolveIssuersL(CArrayPtr<CX509Certificate>& aChain, |
|
53 const RPointerArray<CX509Certificate>& aCandidates) const; |
|
54 |
|
55 private: |
|
56 void RunL(); |
|
57 void DoCancel(); |
|
58 TInt RunError(TInt aError); |
|
59 |
|
60 private: |
|
61 enum TState |
|
62 { |
|
63 EIdle = 0, |
|
64 EAddCandidate, |
|
65 EFinished |
|
66 }; |
|
67 |
|
68 private: |
|
69 RMPointerArray<MPKIXCertSource> iSources; |
|
70 |
|
71 /** |
|
72 * We don't own that object, it's only a pointer to a certificate |
|
73 * in the CX509CertChain from which CPKIXCertChainBase derives. |
|
74 */ |
|
75 CX509Certificate* iSubject; |
|
76 TRequestStatus* iOriginalRequestStatus; |
|
77 TBool* iResult; |
|
78 CArrayPtrFlat<CX509Certificate>* iChain; |
|
79 TInt iIndex; |
|
80 TState iState; |
|
81 RPointerArray<CX509Certificate> iCandidates; |
|
82 TInt* iNumberOfCertsAdded; |
|
83 }; |
|
84 |
|
85 #endif |