sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * CPKIXChainBuilder class implementation sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef __PKIXCHAINBUILDER_H__ sl@0: #define __PKIXCHAINBUILDER_H__ sl@0: sl@0: #include sl@0: #include "pkixcerts.h" sl@0: sl@0: class CPKIXCertChainAO; sl@0: sl@0: class CPKIXChainBuilder : public CActive sl@0: { sl@0: friend class CPKIXCertChainAO; sl@0: sl@0: public: sl@0: static CPKIXChainBuilder* NewL(); sl@0: static CPKIXChainBuilder* NewLC(); sl@0: ~CPKIXChainBuilder(); sl@0: sl@0: public: sl@0: void AddSourceL(MPKIXCertSource* aSource);//takes ownership of aSource... sl@0: void AddIssuer(TInt& aNumberOfCertsAdded, TBool& aResult, CArrayPtrFlat& aChain, sl@0: TRequestStatus& aStatus); sl@0: sl@0: private: sl@0: CPKIXChainBuilder(); sl@0: void ConstructL(); sl@0: TBool ResolveIssuersL(CArrayPtr& aChain, sl@0: const RPointerArray& aCandidates) const; sl@0: sl@0: private: sl@0: void RunL(); sl@0: void DoCancel(); sl@0: TInt RunError(TInt aError); sl@0: sl@0: private: sl@0: enum TState sl@0: { sl@0: EIdle = 0, sl@0: EAddCandidate, sl@0: EFinished sl@0: }; sl@0: sl@0: private: sl@0: RMPointerArray iSources; sl@0: sl@0: /** sl@0: * We don't own that object, it's only a pointer to a certificate sl@0: * in the CX509CertChain from which CPKIXCertChainBase derives. sl@0: */ sl@0: CX509Certificate* iSubject; sl@0: TRequestStatus* iOriginalRequestStatus; sl@0: TBool* iResult; sl@0: CArrayPtrFlat* iChain; sl@0: TInt iIndex; sl@0: TState iState; sl@0: RPointerArray iCandidates; sl@0: TInt* iNumberOfCertsAdded; sl@0: }; sl@0: sl@0: #endif