os/security/cryptoservices/certificateandkeymgmt/tpkcs12intgrtn/inc/tpkcs12common.h
Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * This file contains the declaration of classe CPkcs12Parser to parse the PKCS12 data
24 #ifndef __TPKCS12COMMON_H
25 #define __TPKCS12COMMON_H
29 using namespace PKCS12;
32 #include <pkcs12bags.h>
33 #include <pkcs12attribute.h>
34 #include <pkcs12macdata.h>
36 #include <asymmetrickeys.h>
39 #include "tpkcs12data.h"
42 Contains methods to parse the PFX structure.
44 class CPkcs12Parser : public CBase
48 static CPkcs12Parser* NewL();
50 static CPkcs12Parser* NewLC();
52 void SetIntegrityPasswordL(const TDesC& aIntegrityPassword);
54 void SetPrivacyPassword(RPointerArray<TDesC>& aPrivacyPassword);
56 void SetDataL(const TDesC& aDatapath);
59 /** to get the reference to PfxHeader object*/
60 inline CPfxHeader& PfxHeader() {return *iPkcs12Header;}
61 /** to get the reference to array contains the pointers to CSafeContentBag objects*/
62 inline RPointerArray<CSafeContentBag>& ArraySafeContentBag() {return iArraySafecontentBag;}
63 /** to get the reference to array contains the pointers to CSafeBagData objects*/
64 inline RPointerArray<CSafeBagData>& ArraySafeBagData() {return iArrayBagData;}
71 CSafeBagData* CreateBagDataL(TInt aContentInfo, TInt aContentType );
73 void ParseSafeBagL(TInt aContentInfo , TInt aContentType ,CDecPkcs12SafeBag& aSafeBag);
75 void BagAttributesL(const CDecPkcs12SafeBag& aSafeBag ,CSafeBagData& abagData) ;
77 void ParseKeyBag(CDecPkcs12KeyBag& aKeyBag , CSafeBagData& abagData);
79 void ParseShroudedKeyBagL(CDecPkcs12ShroudedKeyBag& aKeyBag , CSafeBagData& abagData , TInt aPassIndex);
81 void ParseCertBag(CDecPkcs12CertBag& aCertBag , CSafeBagData& abagData);
83 void ParseSafeContentBagL(CDecPkcs12SafeContentsBag& safeContentsBag, TInt aContentinfo , TInt aContentType ) ;
88 /** Contains the pointers to the safes bags in the PKCS12 PFX Structure*/
89 RPointerArray<CSafeBagData> iArrayBagData;
90 /** Contains the safe content bag number and the number of bags in it */
91 RPointerArray<CSafeContentBag> iArraySafecontentBag ;
92 /** Contains the details of the PKCS12 PFX Structure*/
93 CPfxHeader* iPkcs12Header ;
94 /**contains the integritypassword of the PKCS#12 file */
95 HBufC* iIntegrityPassword;
96 /**contains the privacy passwords of the PKCS#12 file */
97 RPointerArray<TDesC>* iPrivacyPassword;
98 /**contains the PKCS#12 data */
101 /**store the safebag number */
102 TInt iSafebagNumber ;