os/security/cryptoservices/certificateandkeymgmt/pkixcertbase/pkixchainbuilder.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/pkixcertbase/pkixchainbuilder.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,83 @@
     1.4 +/*
     1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of the License "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* CPKIXChainBuilder class implementation
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file 
    1.25 + @internalTechnology
    1.26 +*/
    1.27 + 
    1.28 +#ifndef __PKIXCHAINBUILDER_H__
    1.29 +#define __PKIXCHAINBUILDER_H__
    1.30 +
    1.31 +#include <e32base.h>
    1.32 +#include "pkixcerts.h"
    1.33 +
    1.34 +class CPKIXCertChainAO;
    1.35 +
    1.36 +class CPKIXChainBuilder : public CActive
    1.37 +	{
    1.38 +	friend class CPKIXCertChainAO;
    1.39 +
    1.40 +public:
    1.41 +	static CPKIXChainBuilder* NewL();
    1.42 +	static CPKIXChainBuilder* NewLC();
    1.43 +	~CPKIXChainBuilder();
    1.44 +
    1.45 +public:
    1.46 +	void AddSourceL(MPKIXCertSource* aSource);//takes ownership of aSource...
    1.47 +	void AddIssuer(TInt& aNumberOfCertsAdded, TBool& aResult, CArrayPtrFlat<CX509Certificate>& aChain, 
    1.48 +		TRequestStatus& aStatus);
    1.49 +
    1.50 +private:
    1.51 +	CPKIXChainBuilder();
    1.52 +	void ConstructL();
    1.53 +	TBool ResolveIssuersL(CArrayPtr<CX509Certificate>& aChain, 
    1.54 +		const RPointerArray<CX509Certificate>& aCandidates) const;
    1.55 +
    1.56 +private:
    1.57 +	void RunL();
    1.58 +	void DoCancel();
    1.59 +	TInt RunError(TInt aError);
    1.60 +
    1.61 +private:
    1.62 +	enum TState
    1.63 +		{
    1.64 +		EIdle = 0,
    1.65 +		EAddCandidate,
    1.66 +		EFinished
    1.67 +		};
    1.68 +
    1.69 +private:
    1.70 +	RMPointerArray<MPKIXCertSource> iSources;
    1.71 +
    1.72 +	/**
    1.73 +	 * We don't own that object, it's only a pointer to a certificate
    1.74 +	 * in the CX509CertChain from which CPKIXCertChainBase derives.
    1.75 +	 */
    1.76 +	CX509Certificate* iSubject;
    1.77 +	TRequestStatus* iOriginalRequestStatus;
    1.78 +	TBool* iResult;
    1.79 +	CArrayPtrFlat<CX509Certificate>* iChain;
    1.80 +	TInt iIndex;
    1.81 +	TState iState;
    1.82 +	RPointerArray<CX509Certificate> iCandidates;
    1.83 +	TInt* iNumberOfCertsAdded;
    1.84 +	};
    1.85 +
    1.86 +#endif