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