sl@0: /* sl@0: * Copyright (c) 2005-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: * This file contains the declaration of classe CPkcs12Parser to parse the PKCS12 data sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: #ifndef __TPKCS12COMMON_H sl@0: #define __TPKCS12COMMON_H sl@0: sl@0: #include sl@0: sl@0: using namespace PKCS12; sl@0: //System Include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: //user include sl@0: #include "tpkcs12data.h" sl@0: sl@0: /** sl@0: Contains methods to parse the PFX structure. sl@0: */ sl@0: class CPkcs12Parser : public CBase sl@0: { sl@0: public: sl@0: sl@0: static CPkcs12Parser* NewL(); sl@0: sl@0: static CPkcs12Parser* NewLC(); sl@0: sl@0: void SetIntegrityPasswordL(const TDesC& aIntegrityPassword); sl@0: sl@0: void SetPrivacyPassword(RPointerArray& aPrivacyPassword); sl@0: sl@0: void SetDataL(const TDesC& aDatapath); sl@0: sl@0: void ParseL(); sl@0: /** to get the reference to PfxHeader object*/ sl@0: inline CPfxHeader& PfxHeader() {return *iPkcs12Header;} sl@0: /** to get the reference to array contains the pointers to CSafeContentBag objects*/ sl@0: inline RPointerArray& ArraySafeContentBag() {return iArraySafecontentBag;} sl@0: /** to get the reference to array contains the pointers to CSafeBagData objects*/ sl@0: inline RPointerArray& ArraySafeBagData() {return iArrayBagData;} sl@0: sl@0: ~CPkcs12Parser(); sl@0: private: sl@0: sl@0: CPkcs12Parser(); sl@0: sl@0: CSafeBagData* CreateBagDataL(TInt aContentInfo, TInt aContentType ); sl@0: sl@0: void ParseSafeBagL(TInt aContentInfo , TInt aContentType ,CDecPkcs12SafeBag& aSafeBag); sl@0: sl@0: void BagAttributesL(const CDecPkcs12SafeBag& aSafeBag ,CSafeBagData& abagData) ; sl@0: sl@0: void ParseKeyBag(CDecPkcs12KeyBag& aKeyBag , CSafeBagData& abagData); sl@0: sl@0: void ParseShroudedKeyBagL(CDecPkcs12ShroudedKeyBag& aKeyBag , CSafeBagData& abagData , TInt aPassIndex); sl@0: sl@0: void ParseCertBag(CDecPkcs12CertBag& aCertBag , CSafeBagData& abagData); sl@0: sl@0: void ParseSafeContentBagL(CDecPkcs12SafeContentsBag& safeContentsBag, TInt aContentinfo , TInt aContentType ) ; sl@0: sl@0: sl@0: sl@0: private: sl@0: /** Contains the pointers to the safes bags in the PKCS12 PFX Structure*/ sl@0: RPointerArray iArrayBagData; sl@0: /** Contains the safe content bag number and the number of bags in it */ sl@0: RPointerArray iArraySafecontentBag ; sl@0: /** Contains the details of the PKCS12 PFX Structure*/ sl@0: CPfxHeader* iPkcs12Header ; sl@0: /**contains the integritypassword of the PKCS#12 file */ sl@0: HBufC* iIntegrityPassword; sl@0: /**contains the privacy passwords of the PKCS#12 file */ sl@0: RPointerArray* iPrivacyPassword; sl@0: /**contains the PKCS#12 data */ sl@0: HBufC8* iRawData; sl@0: sl@0: /**store the safebag number */ sl@0: TInt iSafebagNumber ; sl@0: sl@0: }; sl@0: sl@0: #endif sl@0: