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